mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-19 13:32:21 +02:00
doc: Update English pages with generic target name
* Original commit: espressif/esp-idf@9352899d69
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
d9fa457b4f
commit
881ca095f0
@ -12,8 +12,8 @@ mDNS is installed by default on most operating systems or is available as separa
|
|||||||
mDNS Properties
|
mDNS Properties
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
* ``hostname``: the hostname that the device will respond to. If not set, the ``hostname`` will be read from the interface. Example: ``my-esp32`` will resolve to ``my-esp32.local``
|
* ``hostname``: the hostname that the device will respond to. If not set, the ``hostname`` will be read from the interface. Example: ``my-{IDF_TARGET_PATH_NAME}`` will resolve to ``my-{IDF_TARGET_PATH_NAME}.local``
|
||||||
* ``default_instance``: friendly name for your device, like ``Jhon's ESP32 Thing``. If not set, ``hostname`` will be used.
|
* ``default_instance``: friendly name for your device, like ``Jhon's {IDF_TARGET_NAME} Thing``. If not set, ``hostname`` will be used.
|
||||||
|
|
||||||
Example method to start mDNS for the STA interface and set ``hostname`` and ``default_instance``:
|
Example method to start mDNS for the STA interface and set ``hostname`` and ``default_instance``:
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ Example method to start mDNS for the STA interface and set ``hostname`` and ``de
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set hostname
|
//set hostname
|
||||||
mdns_hostname_set("my-esp32");
|
mdns_hostname_set("my-{IDF_TARGET_PATH_NAME}");
|
||||||
//set default instance
|
//set default instance
|
||||||
mdns_instance_name_set("Jhon's ESP32 Thing");
|
mdns_instance_name_set("Jhon's {IDF_TARGET_NAME} Thing");
|
||||||
}
|
}
|
||||||
|
|
||||||
mDNS Services
|
mDNS Services
|
||||||
@ -41,7 +41,7 @@ mDNS Services
|
|||||||
|
|
||||||
mDNS can advertise information about network services that your device offers. Each service is defined by a few properties.
|
mDNS can advertise information about network services that your device offers. Each service is defined by a few properties.
|
||||||
|
|
||||||
* ``instance_name``: friendly name for your service, like ``Jhon's ESP32 Web Server``. If not defined, ``default_instance`` will be used.
|
* ``instance_name``: friendly name for your service, like ``Jhon's E{IDF_TARGET_NAME} Web Server``. If not defined, ``default_instance`` will be used.
|
||||||
* ``service_type``: (required) service type, prepended with underscore. Some common types can be found `here <http://www.dns-sd.org/serviceTypes.html>`_.
|
* ``service_type``: (required) service type, prepended with underscore. Some common types can be found `here <http://www.dns-sd.org/serviceTypes.html>`_.
|
||||||
* ``proto``: (required) protocol that the service runs on, prepended with underscore. Example: ``_tcp`` or ``_udp``
|
* ``proto``: (required) protocol that the service runs on, prepended with underscore. Example: ``_tcp`` or ``_udp``
|
||||||
* ``port``: (required) network port that the service runs on
|
* ``port``: (required) network port that the service runs on
|
||||||
@ -58,10 +58,10 @@ Example method to add a few services and different properties::
|
|||||||
|
|
||||||
//NOTE: services must be added before their properties can be set
|
//NOTE: services must be added before their properties can be set
|
||||||
//use custom instance for the web server
|
//use custom instance for the web server
|
||||||
mdns_service_instance_name_set("_http", "_tcp", "Jhon's ESP32 Web Server");
|
mdns_service_instance_name_set("_http", "_tcp", "Jhon's {IDF_TARGET_NAME} Web Server");
|
||||||
|
|
||||||
mdns_txt_item_t serviceTxtData[3] = {
|
mdns_txt_item_t serviceTxtData[3] = {
|
||||||
{"board","esp32"},
|
{"board","{{IDF_TARGET_PATH_NAME}}"},
|
||||||
{"u","user"},
|
{"u","user"},
|
||||||
{"p","password"}
|
{"p","password"}
|
||||||
};
|
};
|
||||||
@ -161,8 +161,8 @@ Example method to resolve local services::
|
|||||||
Example of using the methods above::
|
Example of using the methods above::
|
||||||
|
|
||||||
void my_app_some_method(){
|
void my_app_some_method(){
|
||||||
//search for esp32-mdns.local
|
//search for {IDF_TARGET_PATH_NAME}-mdns.local
|
||||||
resolve_mdns_host("esp32-mdns");
|
resolve_mdns_host("{IDF_TARGET_PATH_NAME}-mdns");
|
||||||
|
|
||||||
//search for HTTP servers
|
//search for HTTP servers
|
||||||
find_mdns_service("_http", "_tcp");
|
find_mdns_service("_http", "_tcp");
|
||||||
|
Reference in New Issue
Block a user