|
|
@ -599,6 +599,7 @@ static void gatts_profile_b_event_handler(esp_gatts_cb_event_t event, esp_gatt_i |
|
|
|
example_write_event_env(gatts_if, &b_prepare_write_env, param); |
|
|
|
break; |
|
|
|
} |
|
|
|
timer_set_pause_and_counter_zero(TIMER_GROUP_0, TIMER_0); |
|
|
|
ESP_LOGW(GATTS_TAG, "Processing buffer data,write data to buferr warning"); |
|
|
|
example_write_event_env(gatts_if, &b_prepare_write_env, param); |
|
|
|
break; |
|
|
@ -895,7 +896,6 @@ void bluetooth_gatts_try_process_data() |
|
|
|
{ |
|
|
|
cJSON *json_tmp; |
|
|
|
cJSON *ch; |
|
|
|
uint8_t json_temp_size = 10; |
|
|
|
//接收完毕 |
|
|
|
if (bluetooth_rx_buffer_processing) |
|
|
|
{ |
|
|
@ -906,13 +906,22 @@ void bluetooth_gatts_try_process_data() |
|
|
|
|
|
|
|
//处理数据 |
|
|
|
json_tmp = cJSON_Parse(&bluetooth_rx_buffer[0]); |
|
|
|
if (json_tmp == NULL) |
|
|
|
{ |
|
|
|
ESP_LOGE("ERROR","json_tmp null"); |
|
|
|
cJSON_Delete(json_tmp); |
|
|
|
buffer_all_init(); |
|
|
|
bluetooth_rx_buffer_processing = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
ch = json_tmp->child; |
|
|
|
|
|
|
|
while (ch != NULL) |
|
|
|
{ |
|
|
|
ESP_LOGI(GATTS_TAG, "%s", ch->string); |
|
|
|
if (strcmp(ch->string,"order") == 0){ |
|
|
|
ESP_LOGI("!!!!!!!!","##############"); |
|
|
|
if (strcmp(ch->string, "order") == 0) |
|
|
|
{ |
|
|
|
ESP_LOGI("!!!!!!!!", "##############"); |
|
|
|
} |
|
|
|
ch = ch->next; |
|
|
|
} |
|
|
|