ESP-AT Lib  Version v0.3
Advanced AT parser for ESP8266 WiFi module
Hostname

Hostname. More...

Functions

espr_t esp_hostname_set (const char *hostname, const esp_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
 Set hostname of WiFi station. More...
 
espr_t esp_hostname_get (char *hostname, size_t length, const esp_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
 Get hostname of WiFi station. More...
 

Detailed Description

Hostname.

By setting hostname, you can identify your device in your DHCP server.

Set hostname of device before connecting to access point.

Note
ESP_CFG_MODE_STATION and ESP_CFG_HOSTNAME must be enabled if you want to use hostname features

Function Documentation

◆ esp_hostname_get()

espr_t esp_hostname_get ( char *  hostname,
size_t  length,
const esp_api_cmd_evt_fn  evt_fn,
void *const  evt_arg,
const uint32_t  blocking 
)

Get hostname of WiFi station.

Parameters
[in]hostnamePointer to output variable holding memory to save hostname
[in]lengthLength of buffer for hostname. Length includes memory for NULL termination
[in]evt_fnCallback function called when command is finished. Set to NULL when not used
[in]evt_argCustom argument for event callback function
[in]blockingStatus whether command should be blocking or not
Returns
espOK on success, member of espr_t enumeration otherwise

◆ esp_hostname_set()

espr_t esp_hostname_set ( const char *  hostname,
const esp_api_cmd_evt_fn  evt_fn,
void *const  evt_arg,
const uint32_t  blocking 
)

Set hostname of WiFi station.

Parameters
[in]hostnameName of ESP host
[in]evt_fnCallback function called when command is finished. Set to NULL when not used
[in]evt_argCustom argument for event callback function
[in]blockingStatus whether command should be blocking or not
Returns
espOK on success, member of espr_t enumeration otherwise