APIs#
This section provides a reference to the Multicast Domain Name System (mDNS) API including functions, data types, and constants.
Modules#
Typedefs#
mDNS event handler
Functions#
Initialize mDNS instance.
De-initialize mDNS instance.
Add network interface to mDNS instance.
Remove network interface to mDNS instance.
Register a service in mDNS instance.
Unregister a service from mDNS instance.
Update service message of a service in mDNS instance.
Discover services using mDNS instance.
Enumeration Documentation#
sl_mdns_event_t#
sl_mdns_event_t
mDNS events
| Enumerator | |
|---|---|
| SL_MDNS_SERVICE_DISCOVERED_EVENT | Event for mDNS service discovery. (Currently not supported.) | 
sl_mdns_protocol_t#
sl_mdns_protocol_t
mDNS protocol
| Enumerator | |
|---|---|
| SL_MDNS_PROTO_PHY | Run mDNS using ethernet frames. (Not supported in offload mode.) | 
| SL_MDNS_PROTO_UDP | Run mDNS using UDP. | 
Typedef Documentation#
sl_mdns_event_handler_t#
sl_mdns_event_handler_t )(sl_mdns_t *mdns, sl_mdns_event_t event, void *data)
mDNS event handler
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| [in] | mdns | mDNS instance handle of type sl_mdns_t. | |
| [in] | event | mDNS event of type sl_mdns_event_t. | |
| [in] | data | Data pointer containing data structure of corresponding to corresponding event of type sl_mdns_event_t. | 
Function Documentation#
sl_mdns_init#
sl_status_t sl_mdns_init (sl_mdns_t * mdns, const sl_mdns_configuration_t * config, sl_mdns_event_handler_t event_handler)
Initialize mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. This cannot be modified by the application after this API call. | 
| const sl_mdns_configuration_t * | [in] | config | Valid pointer to mDNS configuration structure of type sl_mdns_configuration_t. This value cannot be null. | 
| sl_mdns_event_handler_t | [in] | event_handler | Event handler of type sl_mdns_event_handler_t for receiving asynchronous events. | 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
Note
- This API needs to be called before calling any other mDNS API 
- sl_mdns_event_handler_t currently not supported. User should pass NULL for event_handler. 
sl_mdns_deinit#
sl_status_t sl_mdns_deinit (sl_mdns_t * mdns)
De-initialize mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. | 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_add_interface#
sl_status_t sl_mdns_add_interface (sl_mdns_t * mdns, sl_net_interface_t interface)
Add network interface to mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. | 
| sl_net_interface_t | [in] | interface | Network interface of type sl_net_interface_t that needs to be added to mDNS instance. | 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_remove_interface#
sl_status_t sl_mdns_remove_interface (sl_mdns_t * mdns, sl_net_interface_t interface)
Remove network interface to mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. | 
| sl_net_interface_t | [in] | interface | Network interface of type sl_net_interface_t that needs to be removed from mDNS instance. | 
(Currently not supported.) Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_register_service#
sl_status_t sl_mdns_register_service (sl_mdns_t * mdns, sl_net_interface_t interface, sl_mdns_service_t * service)
Register a service in mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. | 
| sl_net_interface_t | [in] | interface | Network interface of type sl_net_interface_t to which service needed to be added to mDNS instance. | 
| sl_mdns_service_t * | [in] | service | Valid pointer to mDNS service configuration structure of type sl_mdns_service_t . This value cannot be null. | 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_unregister_service#
sl_status_t sl_mdns_unregister_service (sl_mdns_t * mdns, sl_mdns_service_query_t * service_query)
Unregister a service from mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t | 
| sl_mdns_service_query_t * | [in] | service_query | Valid pointer to mDNS service query structure of type sl_mdns_service_query_t . This value cannot be null. | 
(Currently not supported.) Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_update_service_message#
sl_status_t sl_mdns_update_service_message (sl_mdns_t * mdns, sl_mdns_service_query_t * service_query, const char * message, uint32_t message_length)
Update service message of a service in mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t. | 
| sl_mdns_service_query_t * | [in] | service_query | Valid pointer to mDNS service query structure of type sl_mdns_service_query_t. This value cannot be null. | 
| const char * | [in] | message | Valid pointer to a buffer containing service message string . This value cannot be null. | 
| uint32_t | [in] | message_length | Length of the message buffer. | 
(Currently not supported.) Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_mdns_discover_service#
sl_status_t sl_mdns_discover_service (sl_mdns_t * mdns, sl_mdns_service_query_t * service_query)
Discover services using mDNS instance.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_mdns_t * | [in] | mdns | mDNS instance handle of type sl_mdns_t | 
| sl_mdns_service_query_t * | [in] | service_query | Valid pointer to mDNS service query structure of type sl_mdns_service_query_t . This value cannot be null. | 
(Currently not supported.) Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details.