![]() |
WE310F5
39.00.000
|
This section describes the M2MB APIs to perform various multi-cast Domain Name System(mDNS) operations. More...
#define | M2MB_MDNS_MAX_TXT_RECORDS 10 |
enum | M2MB_MDNS_CONF_ID { M2MB_MDNS_CONF_INVALID = 0, M2MB_MDNS_CONF_SET_UPDATE_TXT = 1 } |
MDNS SET Configuration enumeration. 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_TXT | M2MB_MDNS_TXT_T |
typedef UINT32(* | M2MB_MDNS_CB_T) (VOID *arg) |
mDNS application callback. More... | |
typedef enum M2MB_MDNS_CONF_ID | M2MB_MDNS_CONF_ID_E |
MDNS SET Configuration enumeration. More... | |
typedef struct M2MB_MDNS_INIT_PARAMS | M2MB_MDNS_INIT_PARAMS_T |
MDNS initialization parameters. More... | |
typedef void(* | MDNS_NAME_RESULT_CB_T) (struct netif *netif, UINT8 result) |
void | m2mb_mdns_resp_register_name_result_cb (MDNS_NAME_RESULT_CB_T cb) |
M2MB_STATUS_T | m2mb_mdns_init (HANDLE *handle, M2MB_MDNS_INIT_PARAMS_T *init_params) |
m2mb_mdns_init is called to Start the mDNS service. More... | |
M2MB_STATUS_T | m2mb_mdns_set_hostname (HANDLE handle, const CHAR *host_name) |
Sets the hostname for mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_register_service (HANDLE handle, M2MB_MDNS_SVC_INFO_T *svc_info, UINT8 blocking) |
Registers a new service with mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_unregister_service (HANDLE handle, const CHAR *svc_name) |
unregisters a service with mDNS. More... | |
M2MB_STATUS_T | m2mb_mdns_set_cfg (HANDLE handle, M2MB_MDNS_CONF_ID_E conf_id, M2MB_MDNS_CONF_PARAMS_T *conf_params) |
SET the MDNS configuration parameters. More... | |
M2MB_STATUS_T | m2mb_mdns_deinit (HANDLE handle) |
m2mb_mdns_deinit API de-initializes the mDNS module. More... | |
This section describes the M2MB APIs to perform various multi-cast Domain Name System(mDNS) operations.
The mDNS module provides APIs to register service which can be discovered in the local network by other device using the mDNS protocol. User must call the below sequence of APIs in this module.
#define M2MB_MDNS_MAX_TXT_RECORDS 10 |
Maximum text records in a service information structure.
Definition at line 67 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 193 of file m2mb_mdns.h.
typedef enum M2MB_MDNS_CONF_ID M2MB_MDNS_CONF_ID_E |
MDNS SET Configuration enumeration.
This enum defines macros for various SET Configuration for MDNS module.
typedef struct M2MB_MDNS_INIT_PARAMS M2MB_MDNS_INIT_PARAMS_T |
MDNS initialization parameters.
Contains information needed to initialize the MDNS module, such as user callback, user context and poll interval.
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 |
typedef void(* MDNS_NAME_RESULT_CB_T) (struct netif *netif, UINT8 result) |
Callback function to let application know the result of probing network for name uniqueness, called with result MDNS_PROBING_SUCCESSFUL if no other node claimed use for the name for the netif or a service and is safe to use, or MDNS_PROBING_CONFLICT if another node is already using it and mdns is disabled on this interface
Definition at line 247 of file m2mb_mdns.h.
enum M2MB_MDNS_CONF_ID |
MDNS SET Configuration enumeration.
This enum defines macros for various SET Configuration for MDNS module.
Enumerator | |
---|---|
M2MB_MDNS_CONF_INVALID | |
M2MB_MDNS_CONF_SET_UPDATE_TXT | ONLY SET CONF, update the text record, maximum M2MB_MDNS_MAX_TXT_RECORDS supported |
Definition at line 202 of file m2mb_mdns.h.
M2MB_STATUS_T m2mb_mdns_deinit | ( | HANDLE | handle | ) |
m2mb_mdns_deinit API de-initializes the mDNS module.
m2mb_mdns_deinit API de-initializes the mDNS module.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_mdns_init API. |
m2mb_mdns_stop();
M2MB_STATUS_T m2mb_mdns_init | ( | HANDLE * | handle, |
M2MB_MDNS_INIT_PARAMS_T * | init_params | ||
) |
m2mb_mdns_init is called to Start the mDNS service.
m2mb_mdns_init starts the mDNS service
[in] | handle | Specifies the pointer to the context handle that can be used by other MDNS APIs. |
[in] | init_params | Pointer to the initialization parameters required for MDNS module initialization. |
m2mb_mdns_init( &handle, &init_params );
M2MB_STATUS_T m2mb_mdns_register_service | ( | HANDLE | handle, |
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] | handle | Specifies the pointer to the context handle initialized by m2mb_mdns_init API. |
[in] | svc_info | Service information, such as name, type, port, txt records, etc. |
[in] | blocking | Flag fLAG to indicate if the service registration is blocking or nonblocking.
|
m2mb_mdns_register_service( &svc_info, 0 );
void m2mb_mdns_resp_register_name_result_cb | ( | MDNS_NAME_RESULT_CB_T | cb | ) |
M2MB_STATUS_T m2mb_mdns_set_cfg | ( | HANDLE | handle, |
M2MB_MDNS_CONF_ID_E | conf_id, | ||
M2MB_MDNS_CONF_PARAMS_T * | conf_params | ||
) |
SET the MDNS configuration parameters.
This API is called to configure the MDNS module based on the conf IDs.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_mdns_init API. |
[in] | conf_id | SET configuration ID form enum M2MB_MDNS_CONF_ID_E. |
[in] | conf_params | configuration params to be passed according to the configuration to be done. |
M2MB_STATUS_T m2mb_mdns_set_hostname | ( | HANDLE | handle, |
const CHAR * | host_name | ||
) |
Sets the hostname for mDNS.
m2mb_mdns_set_hostname sets the mDNS hostname
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_mdns_init API. |
[in] | host_name | Hostname to be set for mDNS. This is the host-name that Will be used by querier to query for an IP address or a record. |
m2mb_mdns_set_hostname("Telit Host Name");
M2MB_STATUS_T m2mb_mdns_unregister_service | ( | HANDLE | handle, |
const CHAR * | svc_name | ||
) |
unregisters a service with mDNS.
m2mb_mdns_unregister_service unregisters a service with the mDNS module
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_mdns_init API. |
[in] | svc_name | Name of the service to be unregistered. |
m2mb_mdns_unregister_service( "_MyDevice._http._tcp.local" );