void CAEDRNativeAddDeviceStateToList(state_t *state) { if(!state) { OIC_LOG(ERROR, TAG, "[EDR][Native] device is null"); return; } if(!g_deviceStateList) { OIC_LOG(ERROR, TAG, "[EDR][Native] gdevice_list is null"); return; } if(CAEDRNativeIsDeviceInList(state->address)) { CAEDRNativeRemoveDevice(state->address); // delete previous state for update new state } u_arraylist_add(g_deviceStateList, state); // update new state OIC_LOG_V(DEBUG, TAG, "Set State Info to List : %d", state->state); }
void CAEDRNativeAddDeviceStateToList(CAConnectedDeviceInfo_t *deviceInfo) { if (!deviceInfo) { OIC_LOG(ERROR, TAG, "device is null"); return; } if (!g_deviceStateList) { OIC_LOG(ERROR, TAG, "gdevice_list is null"); return; } if (CAEDRNativeIsDeviceInList((const char*) deviceInfo->address)) { // delete previous state for update new state CAEDRNativeRemoveDevice((const char*) deviceInfo->address); } u_arraylist_add(g_deviceStateList, deviceInfo); // update new state OIC_LOG_V(DEBUG, TAG, "Set State Info to List : %d", deviceInfo->state); }