uint8_t?*notify_str?=?(uint8_t?*)cJSON_PrintUnformatted(root); ??????unsigned?int?notify_len?=?strlen(notify_str); ??????printf("notify_len:%d?\r\n",notify_len); ??????snprintf(num_string,sizeof(num_string),"%d",notify_len); ??????sprintf(num_stringg,"0,%s,",num_string); ??????sprintf(temp,"AT+GATTSEND=%s",num_stringg); ??????//unsigned?char?output[370]; ??????unsigned?char?*j?=?malloc(31); ??????if(j?==?NULL) ????????????{ ??????????printred("malloc?failed\r\n"); ????????????} ??????j?=?temp; ??????//sprintf(output,temp,j); ??????printf("j:????%s?\r\n",j); ??????char?*result?=?malloc(strlen(j)+strlen(notify_str)+1); ??????printred("result:%p?\r\n",result); ??????if(result?==?NULL) ??????{ ??????????printred("malloc?failed\r\n"); ??????} ??????strcpy(result,j); ??????char?*jj?=?strcat(result,notify_str); ??????char?*res1?=?malloc(strlen(jj)+strlen("\r\n")+1); ??????if(res1?==?NULL) ??????{ ??????????printred("malloc?failed\r\n"); ??????} ??????strcpy(res1,jj); ??????char?*kk?=?strcat(res1,"\r\n"); ??????//printf("output:%s?\r\n",strcat()); ??????//uint8_t?*output_s?=?strcat(result,notify_str); ??????//output_s?=?strcat(output_s,"\r\n"); ??????UART0_SendString(kk,strlen(kk)); ??????printf("output_s:%s\r\n",kk); ??????printf("strlen?output_s:%d\r\n",strlen(kk)); ??????free(result); ??????//free(j); ??????free(res1);
熱門產品 :
CH394: 以太網協(xié)議棧芯片