OCProvisionDev_t *src_dev = NULL;
OicUuid_t *uuid_target = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto MOT_ENDED;
+ }
+
+
if (!con->uuid_target_str) {
+ ret = OC_STACK_INVALID_PARAM;
MA_LOGE("Target device UUID is NULL");
goto MOT_ENDED;
}
OicUuid_t uuid_mowner;
OicUuid_t *uuid_target = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto REMOVE_MO_ENDED;
+ }
+
if (!con->uuid_target_str) {
MA_LOGE("Target device UUID is NULL");
- goto MOT_ENDED;
+ goto REMOVE_MO_ENDED;
}
uuid_target = _convert_uuid(con->uuid_target_str);
src_dev = _get_dev_by_uuid(g_client->g_motdev_list, uuid_target);
if (!src_dev) {
MA_LOGE("We can't find in MOT dev list");
- goto MOT_ENDED;
+ goto REMOVE_MO_ENDED;
}
g_client->g_doneCB = false;
ret = GetDoxmDevOwnerId(&uuid_mowner);
if (OC_STACK_OK != ret) {
MA_LOGE("GetDoxmDevOwnerId faild = [%d][%s]", ret, _error_to_string(ret));
- goto MOT_ENDED;
+ goto REMOVE_MO_ENDED;
}
#ifdef MANIPULATE_LOCAL_PDM
ret = ma_open_db();
ret = OCRemoveSubOwner(g_client, src_dev, &uuid_mowner, _remove_mo_cb);
if (OC_STACK_OK != ret ) {
MA_LOGE( "OCRemoveSubOwner: ret = %d (%s)", ret, _error_to_string(ret));
- goto MOT_ENDED;
+ goto REMOVE_MO_ENDED;
}
ret = _wait_cb_ret(CALLBACK_TIMEOUT_5S);
if(ret) {
MA_LOGE( "OCRemoveSubOwner callback error = %d (%s)", ret, _error_to_string(ret));
- goto MOT_ENDED;
+ goto REMOVE_MO_ENDED;
}
MA_LOGE("Remove Multiple Ownership Done");
-MOT_ENDED:
+REMOVE_MO_ENDED:
net_ma_emit_remove_mo_done(ma_dbus_get_object(), (int)ret);
OicUuid_t *uuid = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto REMOVE_LOCAL_CRED_ERROR;
+ }
+
if (!con->target_to_revoke) {
MA_LOGE("Some parameters are wrong");
MA_LOGE("%s", con->target_to_revoke );
- goto PVACL_ERROR;
+ goto REMOVE_LOCAL_CRED_ERROR;
}
uuid = _convert_uuid(con->target_to_revoke);
_remove_remove_cred_local_cb );
if (OC_STACK_OK != ret) {
MA_LOGD( "OCRemoveDeviceWithUuid API error: %d (%s)", ret, _error_to_string(ret));
- goto PVACL_ERROR;
+ goto REMOVE_LOCAL_CRED_ERROR;
}
ret = _wait_cb_ret(CALLBACK_TIMEOUT_5S);
if (ret) {
MA_LOGE( "OCRemoveDeviceWithUuid Faild = %d", errno);
- goto PVACL_ERROR;
+ goto REMOVE_LOCAL_CRED_ERROR;
}
/* Disaply result result */
MA_LOGI(" Removing CRED info. at local SVR DB - Done");
-PVACL_ERROR:
+REMOVE_LOCAL_CRED_ERROR:
/* Notify ACL result */
net_ma_emit_remove_cred_local_done(ma_dbus_get_object(), (int)ret);
if (uuid)
OCProvisionDev_t *target_dev = NULL;
OCProvisionDev_t *subject_dev = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto PVACL_ERROR;
+ }
+
if (!con->uuid_subject_str ||!con->uuid_target_str || !con->rsrc_uri || !con->rsrc_type || !con->rsrc_interface) {
MA_LOGE("Some parameters are wrong");
MA_LOGE("%s", con->uuid_target_str );
OCProvisionDev_t *dev1 = NULL;
OCProvisionDev_t *dev2 = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto PVCRED_ERROR;
+ }
+
if (!con->uuid_dev1 ) {
MA_LOGE("dev1 is NULL");
goto PVCRED_ERROR;
OCProvisionDev_t *subject_dev_1 = NULL;
OCProvisionDev_t *subject_dev_2 = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto PVPAIRWIE_ERROR;
+ }
+
if (!con->subject_1 || !con->rsrc_uri_1 || !con->rsrc_type_1 || !con->rsrc_interface_1 ||
!con->subject_2 || !con->rsrc_uri_2 || !con->rsrc_type_2 || !con->rsrc_interface_2) {
MA_LOGE("Some parameters are wrong");
OCProvisionDev_t *dev1 = NULL;
OCProvisionDev_t *dev2 = NULL;
+ if (!g_client) {
+ ret = OC_STACK_INVALID_PARAM;
+ MA_LOGE("mot agent is not initialized");
+ goto PVUNLINKPAIRWISE_ERROR;
+ }
+
if (!con->uuid_dev1 ) {
MA_LOGE("dev1 is NULL");
goto PVUNLINKPAIRWISE_ERROR;