//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#include "iotivity_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
#include <signal.h>
+#ifdef HAVE_PTHREAD_H
#include <pthread.h>
+#endif
#include "ocstack.h"
#include "logger.h"
#include "ocpayload.h"
gResourceUri = (char *) "/a/led/1";
}
- if(OC_REST_PUT == ehRequest->method)
+ if(OC_REST_PUT == ehRequest->method
+ || OC_REST_POST == ehRequest->method)
{
// Get pointer to query
int64_t pow;
* resource is created with default representation (if representation is included in
* POST payload it can be used as initial values) as long as the instance is
* lesser than max new instance count. Once max instance count is reached, POST on
- * /a/led updated the representation of /a/led (just like PUT)
+ * /a/led updated the representation of /a/led.
*/
if (ehRequest->resource == LED.handle)
}
}
- OCPayloadDestroy(response.payload);
+ OCRepPayloadDestroy(payload);
return ehResult;
}