#ifndef __COMP_MOT_AGENT_H__
#define __COMP_MOT_AGENT_H__
- int agent_dbus_start();
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int agent_dbus_start();
int agent_dbus_stop();
int agent_enable();
int agent_remove_cred_at_local(char* uuid_str);
int agent_remove_myowned_device(char* uuid_str);
- #endif /* __COMP_MOT_AGENT_H__ */
\ No newline at end of file
+#ifdef __cplusplus
+}
+#endif
+
+ #endif /* __COMP_MOT_AGENT_H__ */
ma_req_cb_s *con = (ma_req_cb_s *)data;
OCProvisionDev_t *src_dev = NULL;
+ OCProvisionDev_t *clone_dev = NULL;
OicUuid_t *uuid_target = NULL;
if (!con->uuid_target_str) {
MA_LOGE("We can't find in MOT dev list");
goto MOT_ENDED;
}
+ /* Copy subject device and related information */
+ clone_dev = PMCloneOCProvisionDev(src_dev);
+ /* To do ACL provisioning only one */
+ clone_dev->next = NULL;
g_client->g_doneCB = false;
OCProvisionDev_t* dev = NULL;
- LL_FOREACH(src_dev, dev) {
+ LL_FOREACH(clone_dev, dev) {
if(OIC_PRECONFIG_PIN == dev->doxm->oxmSel) {
/* Pre-Configured PIN initialization */
const char* testPreconfigPin = con->pin;/* Ex) "12341234" */
}
}
- ret = OCDoMultipleOwnershipTransfer(g_client, src_dev, _mot_cb);
+ ret = OCDoMultipleOwnershipTransfer(g_client, clone_dev, _mot_cb);
if (OC_STACK_OK != ret ) {
MA_LOGE( "OCDoMultipleOwnershipTransfer: ret = %d (%s)", ret, _error_to_string(ret));
goto MOT_ENDED;
net_ma_emit_mot_done(ma_dbus_get_object(), (int)ret);
if (uuid_target)
g_free(uuid_target);
+ if (clone_dev)
+ PMDeleteDeviceList(clone_dev);
_request_cleanup(data);
g_thread_exit(GINT_TO_POINTER (1));