mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
优化代码
This commit is contained in:
13
TC1/main.c
13
TC1/main.c
@@ -117,17 +117,8 @@ int application_start(void)
|
|||||||
|
|
||||||
if (sys_config->micoSystemConfig.name[0] == 1)
|
if (sys_config->micoSystemConfig.name[0] == 1)
|
||||||
{
|
{
|
||||||
IPStatusTypedef para;
|
strcpy(strMac, str_mac);
|
||||||
os_log("micoWlanGetIPStatus:%d", micoWlanGetIPStatus(¶, Station));
|
sprintf(sys_config->micoSystemConfig.name, ZTC1_NAME, str_mac+8);
|
||||||
strcpy(strMac, para.mac); //mac读出来全部是0??!!!
|
|
||||||
os_log("result:%s",strMac);
|
|
||||||
os_log("result:%s",para.mac);
|
|
||||||
|
|
||||||
unsigned char mac1, mac2;
|
|
||||||
mac1 = strtohex(strMac[8], strMac[9]);
|
|
||||||
mac2 = strtohex(strMac[10], strMac[11]);
|
|
||||||
os_log("strtohex:0x%02x%02x",mac1,mac2);
|
|
||||||
sprintf(sys_config->micoSystemConfig.name, ZTC1_NAME, mac1, mac2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
os_log("user:%s",user_config->user);
|
os_log("user:%s",user_config->user);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define TYPE 1
|
#define TYPE 1
|
||||||
#define TYPE_NAME "zTC1"
|
#define TYPE_NAME "zTC1"
|
||||||
|
|
||||||
#define ZTC1_NAME "zTC1_%02X%02X"
|
#define ZTC1_NAME "zTC1-%s"
|
||||||
|
|
||||||
#define USER_CONFIG_VERSION 2
|
#define USER_CONFIG_VERSION 2
|
||||||
#define SETTING_MQTT_STRING_LENGTH_MAX 32 //必须4字节对齐。
|
#define SETTING_MQTT_STRING_LENGTH_MAX 32 //必须4字节对齐。
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ void WifiInit(void)
|
|||||||
void ApInit()
|
void ApInit()
|
||||||
{
|
{
|
||||||
char ap_name[16];
|
char ap_name[16];
|
||||||
sprintf(ap_name, ELAND_AP_SSID"-%s", str_mac+6);
|
sprintf(ap_name, ELAND_AP_SSID, str_mac+6);
|
||||||
os_log("ApInit ap_name[%s]", ap_name);
|
os_log("ApInit ap_name[%s]", ap_name);
|
||||||
|
|
||||||
network_InitTypeDef_st wNetConfig;
|
network_InitTypeDef_st wNetConfig;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ enum
|
|||||||
WIFI_STATE_CONNECTED,
|
WIFI_STATE_CONNECTED,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ELAND_AP_SSID "TC1-AP"
|
#define ELAND_AP_SSID "TC1-AP-%s"
|
||||||
#define ELAND_AP_KEY "12345678"
|
#define ELAND_AP_KEY "12345678"
|
||||||
#define ELAND_AP_LOCAL_IP "192.168.0.1"
|
#define ELAND_AP_LOCAL_IP "192.168.0.1"
|
||||||
#define ELAND_AP_DNS_SERVER "192.168.0.1"
|
#define ELAND_AP_DNS_SERVER "192.168.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user