#ifndef __MISCELLANEOUS_INTERFACE_H__ #define __MISCELLANEOUS_INTERFACE_H__ #include #include "esp_err.h" // 网关存储命名空间 #define YX_NVS_NAME_SPACE "YX_NVS_SPACE" // 默认空调码库KEY #define AC_DEFAULT "ac-code" // 空调码库存储命名空间 #define IR_STORAGE_NAME_SPACE = "ir_data" #define SDK_VERSION_NAME "version" #define AC_CODE_NAMESPACE "ac_code" uint64_t get_sys_time_ms(); // 是否接入网络 bool net_connect_check(); // 获取设备唯一标识-mac void get_device_serial(char *serial_buf); // 根据 Key获取本地数据 char *yx_data_get(char *key); /** * 清除键值 * @param key */ void yx_data_clear(char * key); // 写入数据 void yx_data_set(char *key, char *value); esp_err_t nvs_set_int8(int8_t code, const char *key); int8_t *nvs_get_int8(const char *key); esp_err_t nvs_set_uint8(uint8_t code, const char *key); uint8_t *nvs_get_uint8(const char *key); esp_err_t nvs_set_uint16(uint16_t code, const char *key); uint16_t *nvs_get_uint16(const char *key); // 网关系统信息参数 typedef struct gateway_sys_info { char *ip_address; // IP 地址 char mac[21]; // MAC 地址 uint16_t revision; // chip revision number uint8_t cores; // 内核芯数 char idf_version[32]; // idf 版本号 char version[32]; // 固件版本号 size_t total; // spiffs 总数 size_t used; // spiffs 已使用 } gateway_sys_info; // 获取网关系统信息 void get_sys_info(gateway_sys_info *info); #endif