mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
fix:字符串长度不足导致的数据异常及mac地址异常
fix:mac地址错误(为ap设备mac地址)的问题 add:mqtt配置/idx配置/device name配置
This commit is contained in:
@@ -34,7 +34,7 @@ void wifi_start_easylink( )
|
||||
micoWlanStartEasyLink( 20000 );
|
||||
user_led_set( 1 );
|
||||
}
|
||||
uint32_t ip=0xd248912c;
|
||||
uint32_t ip = 0xd248912c;
|
||||
//easylink <20><><EFBFBD>ɻص<C9BB>
|
||||
void wifi_easylink_completed_handle( network_InitTypeDef_st *nwkpara, void * arg )
|
||||
{
|
||||
@@ -67,9 +67,8 @@ void wifi_easylink_completed_handle( network_InitTypeDef_st *nwkpara, void * arg
|
||||
//wifi<66><69><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD>ȡ<EFBFBD><C8A1>IP<49><50>ַ <20>ص<EFBFBD>
|
||||
static void wifi_get_ip_callback( IPStatusTypedef *pnet, void * arg )
|
||||
{
|
||||
os_log("got IP:%s, MAC:%s", pnet->ip,pnet->mac);
|
||||
os_log("got IP:%s", pnet->ip);
|
||||
wifi_status = WIFI_STATE_CONNECTED;
|
||||
strcpy(strMac, pnet->mac);
|
||||
}
|
||||
//wifi<66><69><EFBFBD><EFBFBD>״̬<D7B4>ı<EFBFBD><C4B1>ص<EFBFBD>
|
||||
static void wifi_status_callback( WiFiEvent status, void *arg )
|
||||
@@ -101,10 +100,10 @@ static void wifi_led_timer_callback( void* arg )
|
||||
|
||||
case WIFI_STATE_CONNECTING:
|
||||
//if ( num > 1 )
|
||||
{
|
||||
num = 0;
|
||||
user_led_set( -1 );
|
||||
}
|
||||
{
|
||||
num = 0;
|
||||
user_led_set( -1 );
|
||||
}
|
||||
break;
|
||||
case WIFI_STATE_NOEASYLINK:
|
||||
wifi_start_easylink( );
|
||||
@@ -144,5 +143,9 @@ void wifi_init( void )
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>wifi<66><69><EFBFBD><EFBFBD>
|
||||
if ( !mico_rtos_is_timer_running( &wifi_led_timer ) ) mico_rtos_start_timer( &wifi_led_timer );
|
||||
|
||||
IPStatusTypedef para;
|
||||
micoWlanGetIPStatus( ¶, Station );
|
||||
strcpy( strMac, para.mac );
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user