Documentation
Includes
tuya_iot_config.h
#include "tuya_iot_config.h"
tuya_cloud_types.h
#include "tuya_cloud_types.h"
tuya_hal_network.h
#include "tuya_hal_network.h"
Macros
Marco __TUYA_BASE_UNI_DNS_CACHE_H__
#define __TUYA_BASE_UNI_DNS_CACHE_H__
Marco MAX_DOMAIN_NAME_LEN
#define MAX_DOMAIN_NAME_LEN 128
Marco HTTP_DNS_SERVER_DOMAIN
#define HTTP_DNS_SERVER_DOMAIN "h3.iot-dns.com"
Marco HTTP_DNS_SERVER_DOMAIN_WE
#define HTTP_DNS_SERVER_DOMAIN_WE "h3-we.iot-dns.com"
Marco HTTP_DNS_SERVER_DOMAIN
#define HTTP_DNS_SERVER_DOMAIN "h4.iot-dns.com"
Marco HTTP_DNS_SERVER_DOMAIN_WE
#define HTTP_DNS_SERVER_DOMAIN_WE "h4-we.iot-dns.com"
Marco HTTP_DNS_SERVER_DOMAIN
#define HTTP_DNS_SERVER_DOMAIN "h2.iot-dns.com"
Marco HTTP_DNS_SERVER_DOMAIN_WE
#define HTTP_DNS_SERVER_DOMAIN_WE "h2-we.iot-dns.com"
Functions
Func unw_gethostbyname
OPERATE_RET unw_gethostbyname(CONST CHAR_T *domain, UNW_IP_ADDR_T *addr);
Func unw_connect_to_domain
OPERATE_RET unw_connect_to_domain(INT_T *sockfd, CHAR_T *hostname, UINT16_T port, UINT_T retry_cnt, UINT_T timeout);
Func unw_init_dns_cache
OPERATE_RET unw_init_dns_cache(VOID);
Func unw_clear_all_dns_cache
OPERATE_RET unw_clear_all_dns_cache(VOID);
Func unw_clear_dns_cache
OPERATE_RET unw_clear_dns_cache(CONST CHAR_T *domain);
Func unw_add_dns_cache
OPERATE_RET unw_add_dns_cache(CONST CHAR_T *domain, CONST UNW_IP_ADDR_T ip);
Func unm_set_dns_region
OPERATE_RET unm_set_dns_region(REGION_E region);
Func unm_set_dns_cache_priority
OPERATE_RET unm_set_dns_cache_priority(TY_DNS_PRIO_T dns_prio);
Func unm_get_dns_cache_priority
TY_DNS_PRIO_T unm_get_dns_cache_priority(VOID);
Func unm_lower_dns_cache_priority
VOID unm_lower_dns_cache_priority(VOID);
Vars
Consts
Types
Typedefs
Typedef REGION_E
typedef UINT_T REGION_E;
#define E_REGION_DYNAMIC 0 // no fixed region
#define E_REGION_CN 1 // china region
#define E_REGION_EU 2 // european region
#define E_REGION_US 3 // american region
#define E_REGION_UE 4 // west american region
#define E_REGION_IN 5 // indian region
#define E_REGION_WE 6 // west european region
#define E_REGION_MAX 7 // region max
Typedef TY_DNS_PRIO_T
typedef UINT_T TY_DNS_PRIO_T;
#define DNS_PRIO_REGION 0 // default priority, use the dns server of current region
#define DNS_PRIO_RANDOM 1 // select a random dns server of the regions except current region
#define DNS_PRIO_SYSTEM 2 // use the system dns service of the router
Typedef TY_DNS_INFO_S;
typedef struct
{
REGION_E region; // the region of the DNS entry
CHAR_T *domain;// the domain of the DNS entry
UNW_IP_ADDR_T ip; // the ip address of the DNS entry
}TY_DNS_INFO_S;