![]() |
WL865E4-P
36.07.001
|
This section describes the M2MB APIs to perform various multicast Domain Name System(mDNS) operations. More...
#define | M2MB_MDNS_MAX_TXT_RECORDS 10 |
enum | M2MB_MDNS_COMMAND { M2MB_MDNS_START_E, M2MB_MDNS_STOP_E, M2MB_MDNS_DISABLE_E, M2MB_MDNS_ADDSVC_E, M2MB_MDNS_RMSVC_E, M2MB_MDNS_SET_HOSTNAME_E, M2MB_MDNS_UPDATE_TXT_RECORD_E } |
Commands supported by the mDNS service. More... | |
typedef enum M2MB_MDNS_COMMAND | M2MB_MDNS_COMMAND_T |
Commands supported by the mDNS service. More... | |
typedef struct M2MB_MDNS_TXT_RECORD | M2MB_MDNS_TXT_RECORD_T |
Structure for updating or adding a new text record. More... | |
typedef struct M2MB_MDNS_SVC_REG_STATUS | M2MB_MDNS_SVC_REG_STATUS_T |
Structure for registration status information. More... | |
typedef struct M2MB_MDNS_SVC_INFO | M2MB_MDNS_SVC_INFO_T |
Structure for registering the new service or advertising a service. More... | |
typedef struct M2MB_MDNS_START | M2MB_MDNS_START_T |
mDNS start command structure. More... | |
typedef struct M2MB_MDNS_TXT | M2MB_MDNS_TXT_T |
typedef UINT32(* | M2MB_MDNS_CB_T) (VOID *arg) |
mDNS application callback. More... | |
M2MB_STATUS_T | m2mb_mdns_start (M2MB_MDNS_START_T *start, M2MB_MDNS_CB_T app_cb, UINT8 blocking) |
m2mb_mdns_start is called to Start the mDNS service. More... | |
M2MB_STATUS_T | m2mb_mdns_stop (VOID) |
Stops the mDNS service. More... | |
M2MB_STATUS_T | m2mb_mdns_set_hostname (const CHAR *host_name) |
Sets the hostname for mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_register_service (M2MB_MDNS_SVC_INFO_T *svc_info, UINT8 blocking) |
Registers a new service with mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_unregister_service (const CHAR *svc_name) |
unregisters a service with mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_update_txt (M2MB_MDNS_TXT_T *txt_update) |
Updates a text record of registered service of mDNS. More... | |
This section describes the M2MB APIs to perform various multicast Domain Name System(mDNS) operations.
#define M2MB_MDNS_MAX_TXT_RECORDS 10 |
Maximum text records in a service information structure.
Definition at line 54 of file m2mb_mdns.h.
mDNS application callback.
Callback to be registered when the mDNS service is started. The callback will be invoked for all mDNS commands (Nonblocking mode) and for all asynchronous responses from mDNS.
Definition at line 174 of file m2mb_mdns.h.
typedef enum M2MB_MDNS_COMMAND M2MB_MDNS_COMMAND_T |
Commands supported by the mDNS service.
List of commands to start, stop, or disable an mDNS responder, and to register/unregister services with mDNS.
typedef struct M2MB_MDNS_START M2MB_MDNS_START_T |
mDNS start command structure.
This structure contains the information needed to start the mDNS.
typedef struct M2MB_MDNS_SVC_INFO M2MB_MDNS_SVC_INFO_T |
Structure for registering the new service or advertising a service.
This structure contains information related to an mdns service.
typedef struct M2MB_MDNS_SVC_REG_STATUS M2MB_MDNS_SVC_REG_STATUS_T |
Structure for registration status information.
This structure contains the name of the service/hostname and status code to denote if the registration is successful or to report if there is a subsequent conflict of hostname/servicename. An application callback will receive this asynchronously in the following cases:
typedef struct M2MB_MDNS_TXT_RECORD M2MB_MDNS_TXT_RECORD_T |
Structure for updating or adding a new text record.
This structure contains the text record in the format key=value and a service name that is already registered. If the key in the text record already exists for the given service name, the value is updated with the given value, otherwise, the text record is added as a new text record.
typedef struct M2MB_MDNS_TXT M2MB_MDNS_TXT_T |
enum M2MB_MDNS_COMMAND |
Commands supported by the mDNS service.
List of commands to start, stop, or disable an mDNS responder, and to register/unregister services with mDNS.
Definition at line 67 of file m2mb_mdns.h.
M2MB_STATUS_T m2mb_mdns_register_service | ( | M2MB_MDNS_SVC_INFO_T * | svc_info, |
UINT8 | blocking | ||
) |
Registers a new service with mDNS.
m2mb_mdns_register_service registers a service with the mDNS module
[in] | svc_info | Service information, such as name, type, port, txt records, etc. |
[in] | blocking | Flag to indicate if the service registration is blocking or nonblocking.
|
m2mb_mdns_register_service( &svc_info, 0 );
M2MB_STATUS_T m2mb_mdns_set_hostname | ( | const CHAR * | host_name | ) |
Sets the hostname for mDNS.
m2mb_mdns_set_hostname sets the mDNS hostname
[in] | host_name | Hostname to be set for mDNS. This is the hostname that will be used by queriers to query for an IP address or a record. |
m2mb_mdns_set_hostname("Telit Host Name");
M2MB_STATUS_T m2mb_mdns_start | ( | M2MB_MDNS_START_T * | start, |
M2MB_MDNS_CB_T | app_cb, | ||
UINT8 | blocking | ||
) |
m2mb_mdns_start is called to Start the mDNS service.
m2mb_mdns_start starts the mDNS service
[in] | start | Parameters required to start mDNS, such as ip_Version, if_Name, etc. |
[in] | app_cb | Application callback. The callback is invoked for nonblocking operations and to return asynchronous responses, e.g., hostname conflicts in the local network. |
[in] | blocking | Flag to indicate if the mDNS function is in Blocking or Nonblocking mode.
|
m2mb_mdns_start( &mdns, m2mb_profile_mdns_cb, TRUE );
M2MB_STATUS_T m2mb_mdns_stop | ( | VOID | ) |
Stops the mDNS service.
m2mb_mdns_stop stops the mDNS module
M2MB_STATUS_T m2mb_mdns_unregister_service | ( | const CHAR * | svc_name | ) |
unregisters a service with mDNS.
m2mb_mdns_unregister_service unregisters a service with the mDNS module
[in] | svc_name | Name of the service to be unregistered. |
m2mb_mdns_unregister_service( "_MyDevice._http._tcp.local" );
M2MB_STATUS_T m2mb_mdns_update_txt | ( | M2MB_MDNS_TXT_T * | txt_update | ) |
Updates a text record of registered service of mDNS.
m2mb_mdns_update_txt updates the text record of a registered service with the mDNS module
[in] | txt_update | Contains the service name and the text record to be updated. If the text record does not exist, a new text record will be created. The text record should be of the form key=value. |
m2mb_mdns_update_txt( &txt_update );