Compare commits

..

2 Commits

3 changed files with 18 additions and 7 deletions

View File

@ -675,12 +675,7 @@ static void handle_system_event(key_event_t event)
thing_init(); thing_init();
init_bat_timer(); init_bat_timer();
// spi_led_init(); // spi_led_init();
<<<<<<< HEAD
bk_printf("VER:%s\r\n","1.0.6"); bk_printf("VER:%s\r\n","1.0.6");
=======
bk_printf("bk_misc_get_reset_reason = 0x%02X \n",bk_misc_get_reset_reason());
bk_printf("VER:1.0.3 2025.05.27\r\n");
>>>>>>> 0c7475e0d398483dba561d0acb30a572a0d6c861
#endif #endif
#endif #endif

View File

@ -184,8 +184,12 @@ static uint16_t *const s_boarding_attr_handle_list[sizeof(s_gatts_attr_db_servic
//helloyifa //helloyifa
&s_char_cmd_char_handle, &s_char_cmd_char_handle,
}; };
static boarding_state m_state = BOARDING_STATE_IDLE;
int ble_notify_boarding_state(boarding_state state){ int ble_notify_boarding_state(boarding_state state){
if(m_state == state){
return 0;
}
m_state = state;
uint8_t str_respone [32] = {0}; uint8_t str_respone [32] = {0};
memset(str_respone,0,sizeof(str_respone)); memset(str_respone,0,sizeof(str_respone));
switch (state) switch (state)

View File

@ -36,6 +36,8 @@
#include "boarding_service.h" #include "boarding_service.h"
#include "components/bluetooth/bk_dm_bluetooth.h" #include "components/bluetooth/bk_dm_bluetooth.h"
#include "wifi_boarding_utils.h"
#define TAG "bk_sconf" #define TAG "bk_sconf"
#define RCV_BUF_SIZE 256 #define RCV_BUF_SIZE 256
#define SEND_HEADER_SIZE 1024 #define SEND_HEADER_SIZE 1024
@ -836,7 +838,17 @@ static int bk_genie_sconf_wifi_event_cb(void *arg, event_module_t event_module,
case EVENT_WIFI_STA_DISCONNECTED: case EVENT_WIFI_STA_DISCONNECTED:
sta_disconnected = (wifi_event_sta_disconnected_t *)event_data; sta_disconnected = (wifi_event_sta_disconnected_t *)event_data;
BK_LOGI(TAG, "STA disconnected, reason(%d)\n", sta_disconnected->disconnect_reason); BK_LOGE(TAG, "STA disconnected, reason(%d)\n", sta_disconnected->disconnect_reason);
//AP 不存在
if(sta_disconnected->disconnect_reason == 257){
ble_notify_boarding_state(BOARDING_STATE_AP_NOFOUND);
}
//密码错误
if(sta_disconnected->disconnect_reason == 258 || sta_disconnected->disconnect_reason == WIFI_REASON_PREV_AUTH_NOT_VALID){
ble_notify_boarding_state(BOARDING_STATE_PASSWORD_ERROR);
}
/*drop local generated disconnect event by user*/ /*drop local generated disconnect event by user*/
if ((sta_disconnected->disconnect_reason == WIFI_REASON_DEAUTH_LEAVING && if ((sta_disconnected->disconnect_reason == WIFI_REASON_DEAUTH_LEAVING &&
sta_disconnected->local_generated == 1) || sta_disconnected->local_generated == 1) ||