File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2222
2323#define TAG "http_app_token"
2424
25- static char * data_ptr = NULL ;
25+ static char * token_string = NULL ;
2626
2727esp_err_t http_app_token_event_handler (esp_http_client_event_t * evt )
2828{
@@ -80,15 +80,18 @@ void http_app_token_prepare_data(char *buf, int len)
8080 cJSON * root = NULL ;
8181 root = cJSON_CreateObject ();
8282 cJSON_AddNumberToObject (root , "request" , 100 );
83- cJSON_AddStringToObject (root , "token" , data_ptr );
83+ cJSON_AddStringToObject (root , "token" , token_string );
8484 cJSON_AddStringToObject (root , "mac" , wifi_mac_string );
8585 cJSON_PrintPreallocated (root , buf , len , 0 );
8686 cJSON_Delete (root );
8787}
8888
8989void http_app_verify_token (char * token )
9090{
91- data_ptr = token ;
91+ if (token == NULL ) {
92+ return ;
93+ }
94+ token_string = token ;
9295 EventBits_t uxBits = xEventGroupSync (
9396 user_event_group ,
9497 HTTP_APP_TOKEN_RUN_BIT ,
You can’t perform that action at this time.
0 commit comments