APIs#

This section provides a reference to the Multicast Domain Name System (mDNS) API including functions, data types, and constants.

Modules#

sl_mdns_service_query_t

sl_mdns_service_t

sl_mdns_discover_request_t

sl_mdns_configuration_t

sl_mdns_interface_t

sl_mdns_s

Enumerations#

enum
SL_MDNS_SERVICE_DISCOVERED_EVENT = 0
}

mDNS events

enum
SL_MDNS_PROTO_PHY = 0
SL_MDNS_PROTO_UDP
}

mDNS protocol

Typedefs#

typedef struct sl_mdns_s

mDNS instance handle

typedef void(*
sl_mdns_event_handler_t)(sl_mdns_t *mdns, sl_mdns_event_t event, void *data)

mDNS event handler

Functions#

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.

sl_status_t
sl_mdns_deinit(sl_mdns_t *mdns)

De-initialize mDNS instance.

sl_status_t
sl_mdns_add_interface(sl_mdns_t *mdns, sl_net_interface_t interface)

Add network interface to mDNS instance.

sl_status_t
sl_mdns_remove_interface(sl_mdns_t *mdns, sl_net_interface_t interface)

Remove network interface to mDNS instance.

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.

sl_status_t
sl_mdns_unregister_service(sl_mdns_t *mdns, sl_mdns_service_query_t *service_query)

Unregister a service from mDNS instance.

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.

sl_status_t
sl_mdns_discover_service(sl_mdns_t *mdns, sl_mdns_service_query_t *service_query)

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.)


Definition at line 29 of file components/service/mdns/inc/sl_mdns.h

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.


Definition at line 34 of file components/service/mdns/inc/sl_mdns.h

Typedef Documentation#

sl_mdns_t#

typedef struct sl_mdns_s sl_mdns_t

mDNS instance handle


Definition at line 93 of file components/service/mdns/inc/sl_mdns.h

sl_mdns_event_handler_t#

sl_mdns_event_handler_t )(sl_mdns_t *mdns, sl_mdns_event_t event, void *data)

mDNS event handler

Parameters
[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.


Definition at line 102 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t. This cannot be modified by the application after this API call.

[in]config

Valid pointer to mDNS configuration structure of type sl_mdns_configuration_t. This value cannot be null.

[in]event_handler

Event handler of type sl_mdns_event_handler_t for receiving asynchronous events.

Returns

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.


Definition at line 126 of file components/service/mdns/inc/sl_mdns.h

sl_mdns_deinit#

sl_status_t sl_mdns_deinit (sl_mdns_t * mdns)

De-initialize mDNS instance.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t.

Returns


Definition at line 135 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t.

[in]interface

Network interface of type sl_net_interface_t that needs to be added to mDNS instance.

Returns


Definition at line 145 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t.

[in]interface

Network interface of type sl_net_interface_t that needs to be removed from mDNS instance.

(Currently not supported.) Returns


Definition at line 155 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t.

[in]interface

Network interface of type sl_net_interface_t to which service needed to be added to mDNS instance.

[in]service

Valid pointer to mDNS service configuration structure of type sl_mdns_service_t . This value cannot be null.

Returns


Definition at line 166 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_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


Definition at line 176 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_t.

[in]service_query

Valid pointer to mDNS service query structure of type sl_mdns_service_query_t. This value cannot be null.

[in]message

Valid pointer to a buffer containing service message string . This value cannot be null.

[in]message_length

Length of the message buffer.

(Currently not supported.) Returns


Definition at line 188 of file components/service/mdns/inc/sl_mdns.h

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.

Parameters
[in]mdns

mDNS instance handle of type sl_mdns_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


Definition at line 201 of file components/service/mdns/inc/sl_mdns.h