Last Updated on : 2024-11-20 08:51:48
This topic describes the APIs used to enable the gateway to be connected to the internet via a wired Ethernet connection.
typedef struct
{
char ip[16];
char mask[16];
char gw[16];
} NW_IP_S;
Functional specification
The IP address information.
Member description
Member | Description |
---|---|
ip | The IP address of the network adapter. |
mask | The subnet mask of the network adapter. |
gw | The default gateway of the network adapter. |
typedef struct
{
uint8_t mac[TY_MAC_ADDR_LEN];
}NW_MAC_S;
Functional specification
The MAC address information.
Member description
Member | Description |
---|---|
mac | The MAC address, stored byte by byte with the symbol : removed. |
OPERATE_RET tuya_adapter_wired_get_ip(OUT NW_IP_S *ip)
Functional description
Gets the IP address of the wired network adapter.
Parameter description
Parameter name | Description |
---|---|
ip | The IP address information. For more information, see NW_IP_S. |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
BOOL_T tuya_adapter_wired_station_conn(VOID)
Functional description
Gets the status of the wired connection.
Parameter description
Parameter name | Description |
---|---|
VOID | / |
Return value
Return value | Description |
---|---|
TRUE | The wired connection is established. |
FALSE | The wired connection is not established. |
OPERATE_RET tuya_adapter_wired_get_mac(OUT NW_MAC_S *mac)
Functional description
Gets the MAC address of the wired network adapter. This is a reserved interface so implementation is not needed.
Parameter description
Parameter name | Description |
---|---|
mac | The MAC address information. For more information, see NW_MAC_S. |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
OPERATE_RET tuya_adapter_wired_set_mac(IN CONST NW_MAC_S *mac)
Functional description
Sets the MAC address of the wired network adapter. This is a reserved interface so implementation is not needed.
Parameter description
Parameter name | Description |
---|---|
mac | The MAC address information. For more information, see NW_MAC_S. |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
OPERATE_RET tuya_adapter_wired_if_connect_internet(IN CONST CHAR_T *ssid,
IN CONST CHAR_T *passwd)
Functional description
Connects the gateway to the router. This API works only when you use the wireless and wired combo SDK and tuya_adapter_wired_wifi_need_cfg returns TRUE
. This is a reserved interface so implementation is not needed.
Parameter description
Parameter name | Description |
---|---|
ssid | The SSID of the router. |
password | The password of the router. |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
BOOL_T tuya_adapter_wired_wifi_need_cfg(VOID)
Functional description
Specifies whether the wireless connection is supported. This API works only when you use the wireless and wired combo SDK. This is a reserved interface so implementation is not needed.
Parameter description
Parameter name | Description |
---|---|
VOID | / |
Return value
Return value | Description |
---|---|
TRUE | Wireless connection is supported. |
FALSE | Wireless connection is not supported. |
OPERATE_RET tuya_adapter_wired_wifi_station_get_conn_ap_rssi(OUT SCHAR_T *rssi)
Functional description
Gets the signal strength of the wireless network. This API works only when you use the wireless and wired combo SDK and the gateway accesses the internet via the wireless network.
Parameter description
Parameter name | Description |
---|---|
rssi | Assign the obtained signal strength to this variable. |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
OPERATE_RET tuya_adapter_wired_get_nw_stat(GW_BASE_NW_STAT_T *stat)
Functional description
Gets the network status. This is a reserved interface so implementation is not needed.
Parameter description
Parameter name | Description |
---|---|
status | The network status:
|
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
Return value
Return value | Description |
---|---|
OPRT_OK | Operation succeeded. |
Error code | For more information about the error code, see tuya_error_code.h . |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback