Home / Docs Center / Device API Reference / NetworkWIFIConfiguration
NetworkWIFIConfiguration
Project: Device Interface Document (New Version) | page_id: 1346
[TOC]
Brief Description
- Configure WiFi parameters; a device that supports WiFi is required
Request URL
/xsw/api/net/wifi
Request Method
- POST
Parameters
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| enable | Yes | number | WiFi switch, 0 for off, 1 for on |
| mode | Yes | number | WiFi mode, 0 for normal WiFi mode, 1 for hotspot mode |
| essid | Yes | string | WiFi name |
| psk | Yes | string | WiFi password |
| wifiDhcp | Yes | string | Whether to enable DHCP, supported in normal mode, 0 for disabled, 1 for enabled |
| ip | No | string | Required when DHCP is disabled. Sets the IP |
| netmask | No | string | Required when DHCP is disabled. Sets the subnet mask |
| gateway | No | string | Required when DHCP is disabled. Sets the gateway |
| dns1 | No | string | Required when DHCP is disabled. Sets dns1 |
| dns2 | No | string | Required when DHCP is disabled. Sets dns2 |
Return Example
{
"code": 0,
"msg": "1"
}
Return Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| code | int | 0 means success, other values mean failure |
| msg | string | Error information |
Notes
- Both hotspot mode and WiFi mode can only be called if the device supports this function
Didn't find what you need?Contact us,Talk to our engineers directly.