SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The SimpleLink Wi-Fi device can issue one-shot queries in which the device triggers only a single mDNS query to the network by calling the API sl_NetAppDnsGetHostByService. The query can be set as IPv4 or IPv6 (If enabled) format, or both. A discovery result returns the first response received with information regarding the remote service: IP address, port, and service text description.
Example:
_i16 Status;
_i8 query[] = "_http._tcp.local";
_u32 addr;
_u32 Port = 0;
_u16 TextLen = 800;
_i8 pText[800];
Status = sl_NetAppDnsGetHostByService(query, (unsigned char)strlen(&query[0]), SL_AF_INET, &addr, &Port, &TextLen,pText);
if( Status )
{
/* Error */
}