MDNSClass Class

MDNSClass Class

Description
A class used for registering and removing MDNS service records.

Syntax
class MDNSClass

Members

Public Constructors 
The public constructor should not be used as this class is intended to be a singleton class. Access member functions using the object instance named MDNS.
Public Methods 
MDNSClass::beginStart MDNS operations.
MDNSClass::endStop MDNS operations.
MDNSClass::registerServiceAdd a service record.
MDNSClass::deregisterServiceRemove service record.
MDNSClass::updateServiceUpdate service record.

MDNSClass::begin

Description
Start MDNS operations to begin responding to MDNS queries.

Syntax
void begin(void);

Parameters
NA

Returns
NA

Example Code
Example: mDNS_On_Arduino_IDE
(https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/MDNS/examples/mDNS_On_Arduino_IDE/mDNS_On_Arduino_IDE.ino)

Notes and Warnings
“AmebaMDNS.h” must be included to use the class function.

MDNSClass::end

Description
Stop MDNS operations and stop responding to MDNS queries.

Syntax
void end(void);

Parameters
NA

Returns
NA

Example Code
NA

Notes and Warnings
“AmebaMDNS.h” must be included to use the class function.

MDNSClass::registerService

Description
Add a service record to be included in MDNS responses.

Syntax
void register service(MDNSService service);

Parameters
service: MDNSService class object with required MDNS service data.

Returns
NA

Example Code
Example: mDNS_On_Arduino_IDE
(https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/MDNS/examples/mDNS_On_Arduino_IDE/mDNS_On_Arduino_IDE.ino)

Notes and Warnings
“AmebaMDNS.h” must be included to use the class function.

MDNSClass::deregisterService

Description
Remove a service record from MDNS responses.

Syntax
void deregisterService(MDNSService service);

Parameters
service: MDNSService class object to be removed.

Returns
NA

Example Code
Example: mDNS_On_Arduino_IDE
(https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/MDNS/examples/mDNS_On_Arduino_IDE/mDNS_On_Arduino_IDE.ino)

Notes and Warnings
“AmebaMDNS.h” must be included to use the class function.

MDNSClass::updateService

Description
Update a service record.

Syntax
void updateService(MDNSService service, unsigned int ttl);

Parameters
service: MDNSService class object to be updated.
ttl: time-to-live(TTL) for service.

Returns
NA

Example Code
NA

Notes and Warnings
“AmebaMDNS.h” must be included to use the class function.

Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved. 使用條款
請先確認已安裝QQ通訊軟體