INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/capi/include)
MESSAGE(" - Checking...packages dependency")
-SET(COMMON_DEPS glib-2.0 gio-2.0 gio-unix-2.0 dlog dbus-1 iotivity uuid capi-base-common capi-system-info vconf boost gmock sqlite3 capi-system-system-settings liblazymount)
+SET(COMMON_DEPS glib-2.0 gio-2.0 gio-unix-2.0 dlog dbus-1 iotivity uuid capi-base-common capi-system-info vconf boost gmock sqlite3 capi-system-system-settings)
IF (LINUX)
PKG_CHECK_MODULES(daemon_pkgs REQUIRED ${COMMON_DEPS})
ADD_DEFINITIONS("-DLINUX")
BuildRequires: pkgconfig(gmock)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(capi-system-system-settings)
-BuildRequires: pkgconfig(liblazymount)
%description
Multi Device Group Manager
MESSAGE("===================================================================")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
+INCLUDE_DIRECTORIES(${daemon_pkgs_INCLUDE_DIRS})
FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
" \\
unsigned char *data, int len, int *msg_id);
int mdgd_group_send_response(char *sender, char *uuid, char *channel_id,
int msg_id, unsigned char *data, int len);
+int mdgd_group_set_preconfigured_pin(char *pin);
/* Group Request to remote */
int mdgd_group_request(mdgd_request_type_e type, char *sender, char *uuid,
int mdgd_iot_get_device_description(mdgd_command_t *cmd, char *host_addr, int conn_type);
int mdgd_iot_send_response(char *sender, char *uuid, char *channel_id,
int msg_id, unsigned char *data, int len, bool timeout);
+int mdgd_iot_set_preconfigured_pin(char *pin);
int mdgd_iot_deinitialize();
#ifdef __cplusplus
<arg type="s" name="uuid" direction="in" />
<arg type="i" name="result" direction="out" />
</method>
+ <method name="SetPreconfiguredPin">
+ <arg type="s" name="preconfigured_pin" direction="in" />
+ <arg type="i" name="result" direction="out" />
+ </method>
<!-- Signal (D-Bus) definitions -->
<signal name="Event">
<arg type="i" name="type" direction="out" />
return TRUE;
}
+gboolean group_set_preconfigured_pin(Group *group, GDBusMethodInvocation *invocation,
+ gchar *preconfigured_pin, gpointer user_data)
+{
+ int ret = MDGD_ERROR_NONE;
+ const gchar *sender = g_dbus_method_invocation_get_sender(invocation);
+
+ LOG_BEGIN();
+
+ ret = mdgd_group_set_preconfigured_pin(preconfigured_pin);
+
+ group_complete_set_preconfigured_pin(group, invocation, ret);
+
+ LOG_END();
+
+ return TRUE;
+}
+
void mdgd_gdbus_emit_event(char *sender, mdgd_event_type_e type, int ret, GVariant *data)
{
mdgd_context_t *mdgd_ctx = mdgd_context_get_context();
G_CALLBACK(group_request_channel_list),
NULL);
+ g_signal_connect(group_skeleton,
+ "handle-set-preconfigured-pin",
+ G_CALLBACK(group_set_preconfigured_pin),
+ NULL);
+
group = g_dbus_object_manager_server_new(MDGD_DBUS_GROUP_PATH);
// Set connection to 'manager'
return ret;
}
+int mdgd_group_set_preconfigured_pin(char *pin)
+{
+ int ret;
+
+ ret = mdgd_iot_set_preconfigured_pin(pin);
+
+ return ret;
+}
+
int mdgd_group_request(mdgd_request_type_e type, char *sender, char *uuid,
char *arg1, char *arg2, char *arg3, void *user_data)
{
#include "OCProvisioningManager.hpp"
#include "OCPlatform.h"
#include "OCApi.h"
+#include "credresource.h"
using namespace OC;
using namespace std;
OCPersistentStorage ps;
+int mdgd_iot_set_preconfigured_pin(char *pin)
+{
+ int ret = MDGD_ERROR_NONE;
+
+ ret = AddPreconfPinCredential(pin);
+ if (ret != OC_STACK_OK) {
+ LOG_ERR("set preconfigure pin failed : %d", ret);
+ return MDGD_ERROR_OPERATION_FAILED;
+ }
+
+ return ret;
+}
+
int mdgd_iot_initialize()
{
char *device_id = NULL;
#include <mdgd_gdbus.h>
#include <mdgd_db.h>
#include <mdgd_mot_agent.h>
-#include <lazy_mount.h>
int main(int argc, char *argv[])
{
int ret;
LOG_DEBUG("COMP Manager start");
-/*
- if (wait_mount_user() != 0) {
- LOG_ERR("The user data space is not mounted");
- goto EXIT;
- }
-*/
+
//1. create & get context
ret = mdgd_context_create();
if (ret != MDGD_ERROR_NONE) {