J Daniel Martinez C
/
C-Conv
PIC to Mbed errors
Embed:
(wiki syntax)
Show/hide line numbers
ubidots.c
00001 #include "ubidots.h" 00002 00003 uint8_t buffer[256]; 00004 00005 /*const char* ubidotsPOST( const char* token, const char* variable_id, float value){ 00006 uint8_t httpBody[SIZE_HTTP_BODY]; 00007 memset(&buffer, 0,sizeof(buffer)); 00008 sprintf(httpBody,"{\"value\":%2.2f}", value); 00009 00010 sprintf(buffer, "POST /api/v1.6/variables/%s/values HTTP/1.1\r\n", variable_id); 00011 sprintf(buffer, "%sHost: things.ubidots.com\r\n",buffer); 00012 sprintf(buffer, "%sContent-Type: application/json\r\n", buffer); 00013 sprintf(buffer, "%sX-Auth-Token: %s\r\n", buffer, token); 00014 sprintf(buffer, "%sContent-Length: %i\r\n\r\n%s", buffer, strlen(httpBody), httpBody); 00015 00016 return (uint8_t*)buffer; 00017 }*/ 00018 uint8_t* ubidotsGET(const char* token, const char* variable_id ) 00019 { 00020 memset(&buffer, 0,sizeof(buffer)); 00021 sprintf(buffer,"http://www.things.com/variables/%*s/?token=%*s",sizeof(variable_id),variable_id,sizeof(token),token); 00022 return (uint8_t*)buffer; 00023 } 00024 00025
Generated on Thu Jul 14 2022 10:33:01 by 1.7.2