+static void OtmEventHandler(void *ctx, const char *addr, uint16_t port,
+ const char* ownerId, OCOtmEvent_t event)
+{
+ (void)ctx;
+ printf("--------------------------------------\n");
+ printf("Get OTM event.\n");
+ printf("Address : %s\n", addr);
+ printf("Port : %d\n", port);
+ printf("Owner ID : %s\n", ownerId);
+
+ switch (event)
+ {
+ case OIC_OTM_READY:
+ printf("State : OIC_OTM_READY\n");
+ break;
+ case OIC_OTM_STARTED:
+ printf("State : OIC_OTM_STARTED\n");
+ break;
+ case OIC_OTM_DONE:
+ printf("State : OIC_OTM_DONE\n");
+ break;
+ case OIC_OTM_ERROR:
+ printf("State : OIC_OTM_ERROR\n");
+ break;
+ default:
+ printf("State : Unknown state.\n");
+ break;
+ }
+ printf("--------------------------------------\n");
+}
+