diff --git a/TC1/main.c b/TC1/main.c index 144c739..497bbb1 100644 --- a/TC1/main.c +++ b/TC1/main.c @@ -117,17 +117,8 @@ int application_start(void) if (sys_config->micoSystemConfig.name[0] == 1) { - IPStatusTypedef para; - os_log("micoWlanGetIPStatus:%d", micoWlanGetIPStatus(¶, Station)); - 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); + strcpy(strMac, str_mac); + sprintf(sys_config->micoSystemConfig.name, ZTC1_NAME, str_mac+8); } os_log("user:%s",user_config->user); diff --git a/TC1/main.h b/TC1/main.h index 7a091d2..24e99df 100644 --- a/TC1/main.h +++ b/TC1/main.h @@ -9,7 +9,7 @@ #define TYPE 1 #define TYPE_NAME "zTC1" -#define ZTC1_NAME "zTC1_%02X%02X" +#define ZTC1_NAME "zTC1-%s" #define USER_CONFIG_VERSION 2 #define SETTING_MQTT_STRING_LENGTH_MAX 32 //必须4字节对齐。 diff --git a/TC1/user_wifi.c b/TC1/user_wifi.c index 267c703..be23163 100644 --- a/TC1/user_wifi.c +++ b/TC1/user_wifi.c @@ -169,7 +169,7 @@ void WifiInit(void) void ApInit() { 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); network_InitTypeDef_st wNetConfig; diff --git a/TC1/user_wifi.h b/TC1/user_wifi.h index 3092217..2fabc7b 100644 --- a/TC1/user_wifi.h +++ b/TC1/user_wifi.h @@ -13,7 +13,7 @@ enum WIFI_STATE_CONNECTED, }; -#define ELAND_AP_SSID "TC1-AP" +#define ELAND_AP_SSID "TC1-AP-%s" #define ELAND_AP_KEY "12345678" #define ELAND_AP_LOCAL_IP "192.168.0.1" #define ELAND_AP_DNS_SERVER "192.168.0.1"