get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${ProjectId})
-FILE(GLOB SRCS enrolleewifi.c easysetup_x.c)
+FILE(GLOB SRCS enrolleewifi.c easysetup_x.c register_device.cpp)
add_executable(${PROJECT_NAME} ${SRCS})
#include <stdlib.h>
#include <pthread.h>
+#include "register_device.h"
+
#define TAG "ENROLLEE_SAMPLE"
void *listeningFunc(void *);
deviceProperty.DevConf.deviceName,
deviceProperty.DevConf.modelNumber);
+ registerDeviceInfoX(deviceProperty.DevConf.deviceName, deviceProperty.DevConf.modelNumber);
+
// Set user properties if needed
char userValue_str[] = "user_str";
g_userProperties.userValue_int = 0;
--- /dev/null
+/**
+ * @brief TODO
+ * @date Created 28.04.2017
+ * @author Created 2017 in Samsung Ukraine R&D Center (SURC) under a contract
+ * between LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine)
+ * and "Samsung Electronics Co", Ltd (Seoul, Republic of Korea).
+ * Copyright: (c) Samsung Electronics Co, Ltd 2017. All rights reserved.
+ * @author Mail to: <A HREF="mailto:a.gudz@samsung.com">Andriy Gudz, a.gudz@samsung.com</A>
+ */
+
+#include <string>
+
+#include "register_device.h"
+
+#include <OCApi.h>
+#include <OCPlatform.h>
+
+void registerDeviceInfoX(char* name, char* model)
+{
+ OCDeviceInfo devInfoAirConditioner;
+ OCStringLL deviceType;
+ OCStringLL deviceModel;
+
+ deviceType.value = "oic.d.airconditioner";
+ deviceType.next = NULL;
+
+ deviceModel.value = model;
+ deviceModel.next = NULL;
+
+ devInfoAirConditioner.deviceName = name;
+ devInfoAirConditioner.types = &deviceType;
+ devInfoAirConditioner.specVersion = NULL;
+ devInfoAirConditioner.dataModelVersions = &deviceModel;
+
+ OC::OCPlatform::registerDeviceInfo(devInfoAirConditioner);
+}
--- /dev/null
+/**
+ * @brief TODO
+ * @date Created 28.04.2017
+ * @author Created 2017 in Samsung Ukraine R&D Center (SURC) under a contract
+ * between LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine)
+ * and "Samsung Electronics Co", Ltd (Seoul, Republic of Korea).
+ * Copyright: (c) Samsung Electronics Co, Ltd 2017. All rights reserved.
+ * @author Mail to: <A HREF="mailto:a.gudz@samsung.com">Andriy Gudz, a.gudz@samsung.com</A>
+ */
+#ifndef REGISTER_DEVICE_H
+#define REGISTER_DEVICE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void registerDeviceInfoX(char* name, char* model);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // REGISTER_DEVICE_H