// limitations under the License.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#include "common.h"
+#include "ocstack.h"
+#include "logger.h"
#include <stdio.h>
#include <stdlib.h>
-#include <ocstack.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#define TAG "sample-common"
const char *getResult(OCStackResult result) {
switch (result) {
return "OC_STACK_SLOW_RESOURCE";
case OC_STACK_NO_OBSERVERS:
return "OC_STACK_NO_OBSERVERS";
+ case OC_STACK_UNAUTHORIZED_REQ:
+ return "OC_STACK_UNAUTHORIZED_REQ";
#ifdef WITH_PRESENCE
- case OC_STACK_VIRTUAL_DO_NOT_HANDLE:
- return "OC_STACK_VIRTUAL_DO_NOT_HANDLE";
case OC_STACK_PRESENCE_STOPPED:
return "OC_STACK_PRESENCE_STOPPED";
#endif
return "UNKNOWN";
}
}
+
+void StripNewLineChar(char* str) {
+ int i = 0;
+ if (str)
+ {
+ while( str[i])
+ {
+ if (str[i] == '\n')
+ str[i] = '\0';
+ i++;
+ }
+ }
+}
+