MDNSService Class

MDNSService Class

Description
A class used for creating MDNS service records.

Syntax
class MDNSService

Members

Public Constructors 
MDNSService::MDNSServiceCreate a MDNS service record.
Public Methods 
MDNSService::addTxtRecordAdd text to MDNS service record.

MDNSService::MDNSService

Description
Create a MDNS service record.

Syntax
MDNSService(char* name, char* service_type, char* domain, unsigned short port, int bufsize);

Parameters
name: device name
service_type: MDNS service type
domain: host domain
port: network port
bufsize: size of buffer for MDNS text record. Default value: 128

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.

MDNSService::addTxtRecord

Description
Add text to MDNS service record.

Syntax
int addTextRecord(char* key, int value_len, char* value);

Parameters
key: item key name expressed as character string.
value_len: length of value in string.
value: new value of the key expressed as character string.

Returns
This function returns 0 if the text record is added to the MDNS service record successfully.

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.

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