diff --git a/Project/applications/smartcities/include/globals.h b/Project/applications/smartcities/include/globals.h index 79b64d7..2088933 100644 --- a/Project/applications/smartcities/include/globals.h +++ b/Project/applications/smartcities/include/globals.h @@ -1,11 +1,11 @@ #ifndef GLOBALS_H #define GLOBALS_H -#define SERVER_IP "10.0.60.241" +#define SERVER_IP "147.83.39.240" #define SERVER_HOSTNAME SERVER_IP #define MODULE_ID_LENGTH 6 #define BUFFER_LENGTH 30 #define MAX_RAM 30000 #define MODULE_ID "123456" -#endif \ No newline at end of file +#endif diff --git a/Project/applications/smartcities/json.c b/Project/applications/smartcities/json.c index 508f57b..97c958d 100644 --- a/Project/applications/smartcities/json.c +++ b/Project/applications/smartcities/json.c @@ -128,13 +128,11 @@ uint8_t send_json(char* statement, uint32_t length, char* provider_ID, char* sen URL = (char*) chHeapAlloc(NULL,1+strlen(SERVER_HOSTNAME)); strcpy(URL,SERVER_HOSTNAME); //VANILLA SERVER (SENTILO) - PATH = (char*) chHeapAlloc(NULL,19); - strcpy(PATH,"/catalog/register"); - //FUCKING LEWIS... - //TODO /*PATH = (char*) chHeapAlloc(NULL,19); - strcpy(PATH,"/catalog/register"); - */ + strcpy(PATH,"/catalog/register");*/ + //FUCKING LEWIS... + PATH = (char*) chHeapAlloc(NULL,50); + strcpy(PATH,"/modularsense/wordpress/opendata/catalog/register"); } else //Post data { @@ -142,19 +140,18 @@ uint8_t send_json(char* statement, uint32_t length, char* provider_ID, char* sen strcpy(URL,SERVER_HOSTNAME); URL[strlen(SERVER_HOSTNAME)] = '\0'; //VANILLA SERVER (SENTILO) - PATH = (char*) chHeapAlloc(NULL,22+strlen(provider_ID)+strlen(sensor_ID)); + /*PATH = (char*) chHeapAlloc(NULL,22+strlen(provider_ID)+strlen(sensor_ID)); strcpy(PATH,"/data/modularupload/"); strcpy(PATH+20,provider_ID); - strcpy(PATH+20+strlen(provider_ID),sensor_ID); + strcpy(PATH+20+strlen(provider_ID),sensor_ID);*/ //PATH[21+strlen(provider_ID)+strlen(sensor_ID)] = '\0'; //FUCKING LEWIS... - //TODO - /*PATH = (char*) chHeapAlloc(NULL,22+strlen(provider_ID)+strlen(sensor_ID)); - strcpy(PATH,"/data/modularupload/"); - strcpy(PATH+20,provider_ID); - strcpy(PATH+20+strlen(provider_ID),sensor_ID); - PATH[21+strlen(provider_ID)+strlen(sensor_ID)] = '\0';*/ + PATH = (char*) chHeapAlloc(NULL,54+strlen(provider_ID)+strlen(sensor_ID)); + strcpy(PATH,"/modularsense/wordpress/opendata/data/modularupload/"); + strcpy(PATH+52,provider_ID); + strcpy(PATH+52+strlen(provider_ID),sensor_ID); + //PATH[53+strlen(provider_ID)+strlen(sensor_ID)] = '\0'; } struct httpHeaders server = { put,PATH,strlen(PATH),URL,strlen(URL)}; response_code = httpRequest(server, statement, length);