![]() |
SimpleLink Host Driver
0.0.5.1
|
Functions | |
int | sl_NetAppStart (unsigned long AppBitMap) |
Starts a network application. More... | |
int | sl_NetAppStop (unsigned long AppBitMap) |
Stops a network application. More... | |
int | sl_NetAppDnsGetHostByName (char *hostname, unsigned short usNameLen, unsigned long *out_ip_addr, unsigned char family) |
Get host IP by name. More... | |
long | sl_NetAppDnsGetHostByService (char *pServiceName, unsigned char ServiceLen, unsigned char Family, unsigned long pAddr[], unsigned long *pPort, unsigned short *pTextLen, char *pText) |
Return service attributes like IP address, port and text according to service name. More... | |
int | sl_NetAppGetServiceList (unsigned char IndexOffest, unsigned char MaxServiceCount, unsigned char Flags, char *pBuffer, unsigned long RxBufferLength) |
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like: More... | |
int | sl_NetAppMDNSUnRegisterService (const char *pServiceName, unsigned char ServiceNameLen) |
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database. More... | |
int | sl_NetAppMDNSRegisterService (const char *pServiceName, unsigned char ServiceNameLen, const char *pText, unsigned char TextLen, unsigned short Port, unsigned long TTL, unsigned long Options) |
Register a new mDNS service. More... | |
int | sl_NetAppPingStart (SlPingStartCommand_t *pPingParams, unsigned char family, SlPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback) |
send ICMP ECHO_REQUEST to network hosts More... | |
long | sl_NetAppSet (unsigned char AppId, unsigned char Option, unsigned char OptionLen, unsigned char *pOptionValue) |
Internal function for setting network application configurations. More... | |
long | sl_NetAppGet (unsigned char AppId, unsigned char Option, unsigned char *pOptionLen, unsigned char *pOptionValue) |
Internal function for getting network applications configurations. More... | |
int sl_NetAppDnsGetHostByName | ( | char * | hostname, |
unsigned short | usNameLen, | ||
unsigned long * | out_ip_addr, | ||
unsigned char | family | ||
) |
Get host IP by name.
Obtain the IP Address of machine on network, by machine name.
[in] | hostname | host name |
[in] | usNameLen | name length |
[out] | out_ip_addr | This parameter is filled in with host IP address. In case that host name is not resolved, out_ip_addr is zero. |
[in] | family | protocol family |
long sl_NetAppDnsGetHostByService | ( | char * | pServiceName, |
unsigned char | ServiceLen, | ||
unsigned char | Family, | ||
unsigned long | pAddr[], | ||
unsigned long * | pPort, | ||
unsigned short * | pTextLen, | ||
char * | pText | ||
) |
Return service attributes like IP address, port and text according to service name.
Hence it can make a connection to the specific service and use it. It is similar to get host by name method.
It is done by a single shot query with PTR type on the service name.
The command that is sent is from constant parameters and variables parameters.
[in] | pService | Service name can be full or partial. Example for full service name:
|
[in] | ServiceLen | The length of the service name (in_pService). |
[in] | Family | IPv4 or IPv6 (SL_AF_INET , SL_AF_INET6). |
[out] | pAddr | Contains the IP address of the service. |
[out] | pPort | Contains the port of the service. |
[out] | pTextLen | Has 2 options. One as Input field and the other one as output:
|
[out] | pOut_pText | Contains the text of the service full or partial |
Only one sl_NetAppDnsGetHostByService can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
long sl_NetAppGet | ( | unsigned char | AppId, |
unsigned char | Option, | ||
unsigned char * | pOptionLen, | ||
unsigned char * | pOptionValue | ||
) |
Internal function for getting network applications configurations.
[in] | AppId | Application id, could be one of the following:
|
[in] | Options | Get option, could be one of the following: NETAPP_SET_BASIC_OPT |
[in] | OptionLen | The length of the allocated memory as input, when the function complete, the value of this parameter would be the len that actually read from the device. If the device return length that is longer from the input value, the function will cut the end of the returned structure and will return ESMALLBUF |
[out] | pValues | pointer to the option structure which will be filled with the response from the device |
int sl_NetAppGetServiceList | ( | unsigned char | IndexOffest, |
unsigned char | MaxServiceCount, | ||
unsigned char | Flags, | ||
char * | pBuffer, | ||
unsigned long | RxBufferLength | ||
) |
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like:
The different types of struct are made to give the Possibility to save memory in the host
The user also chose how many max services to get and start point index NWP peer cache. For example:
See below - command parameters.
[in] | 1. | indexOffset - The start index in the peer cache that from it the first service is returned. |
[in] | 2. | MaxServiceCount - The Max services that can be returned if existed or if not exceed the max index in the peer cache |
[in] | 3. | Flags - an ENUM number that means which service struct to use (means which types of service to fill) |
[out] | . | Buffer - The Services are inserted into this buffer. In the struct form according to the bit that is set in the Flags input parameter. |
int sl_NetAppMDNSRegisterService | ( | const char * | pServiceName, |
unsigned char | ServiceNameLen, | ||
const char * | pText, | ||
unsigned char | TextLen, | ||
unsigned short | Port, | ||
unsigned long | TTL, | ||
unsigned long | Options | ||
) |
Register a new mDNS service.
This registered service is a service offered by the application. The service name should be full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer. Example for service name:
If the option is_unique is set, mDNS probes the service name to make sure it is unique before starting to announce the service on the network. Instance is the instance portion of the service name.
[in] | ServiceLen | The length of the service. |
[in] | TextLen | The length of the service should be smaller than 64. |
[in] | port | The port on this target host port. |
[in] | TTL | The TTL of the service |
[in] | Options | bitwise parameters:
|
[in] | pServiceName | The service name. Example for service name:
|
[in] | pText | The description of the service. should be as mentioned in the RFC (according to type of the service IPP,FTP...) |
-206 List size buffer is bigger than internally allowed in the NWP (API get service list) Change the APIs’ parameters to decrease the size of the list
int sl_NetAppMDNSUnRegisterService | ( | const char * | pServiceName, |
unsigned char | ServiceNameLen | ||
) |
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database.
The mDNS service that is to be unregistered is a service that the application no longer wishes to provide.
The service name should be the full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.
Examples for service names:
[in] | pServiceName | Full service name. Example for service name:
|
[in] | ServiceLen | The length of the service. |
int sl_NetAppPingStart | ( | SlPingStartCommand_t * | pPingParams, |
unsigned char | family, | ||
SlPingReport_t * | pReport, | ||
const P_SL_DEV_PING_CALLBACK | pPingCallback | ||
) |
send ICMP ECHO_REQUEST to network hosts
Ping uses the ICMP protocol's mandatory ECHO_REQUEST
[in] | pPingParams | Pointer to the ping request structure:
|
[in] | family | SL_AF_INET or SL_AF_INET6 |
[out] | pReport | Ping pReport |
[out] | pCallback | Callback function upon completion. If callback is NULL, the API is blocked until data arrives |
long sl_NetAppSet | ( | unsigned char | AppId, |
unsigned char | Option, | ||
unsigned char | OptionLen, | ||
unsigned char * | pOptionValue | ||
) |
Internal function for setting network application configurations.
[in] | AppId | Application id, could be one of the following:
|
[in] | SetOptions | set option, could be one of the following: NETAPP_SET_BASIC_OPT |
[in] | OptionLen | option structure length |
[in] | pOptionValues | pointer to the option structure |
int sl_NetAppStart | ( | unsigned long | AppBitMap | ) |
Starts a network application.
Gets and starts network application for the current WLAN mode
[in] | AppBitMap | application bitmap, could be one or combination of the following:
|
int sl_NetAppStop | ( | unsigned long | AppBitMap | ) |
Stops a network application.
Gets and stops network application for the current WLAN mode
[in] | AppBitMap | application id, could be one of the following:
|