using namespace conv::acl_manager;
#else
-#include <RemoteACLInterface.h>
+#include <rdm_iface.h>
#endif
using namespace std;
}
vconf_notify_key_changed(VCONFKEY_SETAPPL_D2D_CONVERGENCE_SERVICE, vconf_update_cb, this);
+#if !defined(_D2D_INTERNAL_ACL_)
+ int error = rdm_init();
+ if (error != RDM_ERROR_SUCCESS)
+ _E("rdm init error : %d", error);
+#endif
}
conv::RemoteAppControlServiceProvider::~RemoteAppControlServiceProvider()
{
app_control_cb_map.clear();
response_cb_map.clear();
+
+#if !defined(_D2D_INTERNAL_ACL_)
+ int error = rdm_deinit();
+ if (error != RDM_ERROR_SUCCESS)
+ _E("rdm deinit error : %d", error);
+#endif
}
int conv::RemoteAppControlServiceProvider::handleVconfUpdate(keynode_t *node)
IF_FAIL_RETURN_TAG(ret == IOTCON_ERROR_NONE, CONV_ERROR_INVALID_PARAMETER, _E, "iotcon_representation_get_attributes() Fail(%d)", ret);
if (!strcmp(CONV_ACCESS_CONTROL_REQUEST, access_request_type)) {
+#if defined(_D2D_INTERNAL_ACL_)
ACManagerPolicy acManagerPolicy = ACMANAGER_POLICY_U;
IF_FAIL_RETURN_TAG(AddACLDevice(macAddress, deviceName, ip.c_str(), &acManagerPolicy) == ACLResult_OK, CONV_ERROR_INVALID_OPERATION, _E, "AddACLDevice failed");
_D("UNDECIDED");
policy = CONV_ACCESS_CONTROL_DENIED;
} else if (acManagerPolicy == ACMANAGER_POLICY_U2) {
-#if defined(_D2D_INTERNAL_ACL_)
_D("UNDECIDED");
conv::acl_manager::LaunchPasskeyShowPopup(deviceName);
policy = CONV_ACCESS_CONTROL_PASSKEY_REQUEST;
-#endif
}
_D("acManagerPolicy:%d", acManagerPolicy);
+#else
+ rdm_device_s rdmDevice;
+ IF_FAIL_RETURN_TAG(rdm_init_device(&rdmDevice, deviceName, NULL, macAddress, NULL, RDM_DEVICE_TYPE_PHONE, RDM_DEVICE_ICON_PHONE_DEFAULT) == RDM_ERROR_SUCCESS, CONV_ERROR_INVALID_OPERATION, _E, "rdm_init_device failed");
+
+ ret = rdm_request_access(&rdmDevice);
+
+ if (ret == RDM_ERROR_SUCCESS) {
+ _D("PERMITTED");
+ policy = CONV_ACCESS_CONTROL_PERMITTED;
+ } else if (ret == RDM_ERROR_DEVICE_IS_DENIED) {
+ _D("DENIED");
+ policy = CONV_ACCESS_CONTROL_DENIED;
+ } else if (ret == RDM_ERROR_INPROGRESS){
+ _D("UNDECIDED");
+ policy = CONV_ACCESS_CONTROL_DENIED;
+ }
+ _D("rdm_request_access:%d", ret);
+#endif
} else if (!strcmp(CONV_ACCESS_CONTROL_PASSKEY_RESPONSE, access_request_type)) {
#if defined(_D2D_INTERNAL_ACL_)
char *input_passkey;
IF_FAIL_RETURN_TAG(conv::util::getPeerMac(ip, -1, macAddress), CONV_ERROR_INVALID_PARAMETER, _E, "getPeerMac failed");
_D("Device IP : %s, Mac : %s", ip.c_str(), macAddress);
+
+#if defined(_D2D_INTERNAL_ACL_)
ACManagerPolicy acManagerPolicy = ACMANAGER_POLICY_U;
IF_FAIL_RETURN_TAG(GetACLState(macAddress, &acManagerPolicy) == ACLResult_OK, CONV_ERROR_INVALID_OPERATION, _E, "ACL check failed");
_D("Device is not permitted %d", acManagerPolicy);
return CONV_ERROR_INVALID_OPERATION;
}
+#else
+ rdm_status_e eStatus = RDM_STATUS_NONE;
+ ret = rdm_get_status(macAddress, RDM_TECH_IND_WIFI, &eStatus);
+
+ if (ret == RDM_ERROR_SUCCESS) {
+ if (eStatus == RDM_STATUS_ALLOW) {
+ _D("PERMITTED");
+ } else {
+ _D("Device is not permitted %d", eStatus);
+ return CONV_ERROR_INVALID_OPERATION;
+ }
+ } else if (ret == RDM_ERROR_DEVICE_NOT_FOUND) {
+ _D("Device is not found");
+ return CONV_ERROR_INVALID_OPERATION;
+ } else {
+ _D("rdm_get_status failed (%d)", ret);
+ return CONV_ERROR_INVALID_OPERATION;
+ }
+#endif
app_control_h app_control;
int reply = 0;