increased content length to enable APIM support

application-manager-new
Shabir Mohamed 10 years ago
parent 8a8b9e6ae1
commit 3e43767efe

@ -21,13 +21,13 @@ void pushData(){
payLoad += "\"}"; payLoad += "\"}";
pushClient.fastrprint(F("POST ")); pushClient.fastrprint(F("POST "));
pushClient.fastrprint(SERVICE_EPOINT); pushClient.fastrprint(F("pushsensordata")); pushClient.fastrprint(SERVICE_EPOINT); pushClient.fastrprint(F("pushsensordata"));
pushClient.fastrprint(F(" HTTP/1.1")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F(" HTTP/1.1")); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(host.c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(host.c_str()); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(F("Content-Length: ")); pushClient.fastrprint(F("Content-Length: "));
int payLength = jsonPayLoad.length() + payLoad.length(); int payLength = jsonPayLoad.length() + payLoad.length() + 2;
pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\n"));
@ -67,7 +67,7 @@ void pushData(){
} }
} }
pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\r\n"));
if(DEBUG) Serial.println(); if(DEBUG) Serial.println();
delay(1000); delay(1000);

@ -21,11 +21,18 @@
#define DEVICE_OWNER "${DEVICE_OWNER}" #define DEVICE_OWNER "${DEVICE_OWNER}"
#define DEVICE_ID "${DEVICE_ID}" #define DEVICE_ID "${DEVICE_ID}"
#define SERVICE_PORT 9763 /**********************************************************************************************
#define SERVICE_EPOINT "/iotdevices/SenseBotController/" The following two parameters are used when pushing data via the API in the API Manager
// pushalarmdata - application/json - {"owner":"","deviceId":"","replyMessage":"","time":"","key":"","value":""} ***********************************************************************************************/
// readcontrols/{owner}/{deviceId} #define SERVICE_PORT 8281
// reply - application/json - {"owner":"","deviceId":"","replyMessage":""} #define SERVICE_EPOINT "/sensebotdata/1.0/controller/"
/**********************************************************************************************
Use the following two parameters when pushing data directly to the JAX-RS Service
***********************************************************************************************/
//#define SERVICE_PORT 9763
//#define SERVICE_EPOINT "/sensebot/controller/"
#define BUZZER A0 #define BUZZER A0
#define LDR_PIN A1 #define LDR_PIN A1
#define TEMP_PIN A2 #define TEMP_PIN A2

@ -27,7 +27,7 @@ void pushData(){
pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("Content-Type: application/json")); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(F("Content-Length: ")); pushClient.fastrprint(F("Content-Length: "));
int payLength = jsonPayLoad.length() + payLoad.length(); int payLength = jsonPayLoad.length() + payLoad.length() + 2;
pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n")); pushClient.fastrprint(String(payLength).c_str()); pushClient.fastrprint(F("\n"));
pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\n"));
@ -67,7 +67,7 @@ void pushData(){
} }
} }
pushClient.fastrprint(F("\n")); pushClient.fastrprint(F("\r\n"));
if(DEBUG) Serial.println(); if(DEBUG) Serial.println();
delay(1000); delay(1000);

@ -21,12 +21,18 @@
#define DEVICE_OWNER "${DEVICE_OWNER}" #define DEVICE_OWNER "${DEVICE_OWNER}"
#define DEVICE_ID "${DEVICE_ID}" #define DEVICE_ID "${DEVICE_ID}"
/**********************************************************************************************
The following two parameters are used when pushing data via the API in the API Manager
***********************************************************************************************/
#define SERVICE_PORT 8281 #define SERVICE_PORT 8281
#define SERVICE_EPOINT "/sensebotdata/1.0/controller/" #define SERVICE_EPOINT "/sensebotdata/1.0/controller/"
// pushalarmdata - application/json - {"owner":"","deviceId":"","replyMessage":"","time":"","key":"","value":""} /**********************************************************************************************
// readcontrols/{owner}/{deviceId} Use the following two parameters when pushing data directly to the JAX-RS Service
// reply - application/json - {"owner":"","deviceId":"","replyMessage":""} ***********************************************************************************************/
//#define SERVICE_PORT 9763
//#define SERVICE_EPOINT "/sensebot/controller/"
#define BUZZER A0 #define BUZZER A0
#define LDR_PIN A1 #define LDR_PIN A1
#define TEMP_PIN A2 #define TEMP_PIN A2

Loading…
Cancel
Save