Beispiel #1
0
void CAEDRUpdateDeviceState(CAConnectedState_t state, const char *address)
{
    state_t *newstate = (state_t*) OICCalloc(1, sizeof(state_t));
    if (!newstate) {
        OIC_LOG(ERROR, TAG, "[EDR][Native] newstate is null");
        return;
    }
    strcpy(newstate->address, address);
    newstate->state = state;

    CAEDRNativeAddDeviceStateToList(newstate);
}
void CAEDRUpdateDeviceState(CAConnectedState_t state, const char *address)
{
    if (!address)
    {
        OIC_LOG(ERROR, TAG, "address is null");
        return;
    }
    CAConnectedDeviceInfo_t *deviceInfo =
            (CAConnectedDeviceInfo_t *) OICCalloc(1, sizeof(CAConnectedDeviceInfo_t));
    if (!deviceInfo)
    {
        OIC_LOG(ERROR, TAG, "deviceInfo is null");
        return;
    }
    OICStrcpy((char*) deviceInfo->address, sizeof(deviceInfo->address), address);
    deviceInfo->state = state;

    CAEDRNativeAddDeviceStateToList(deviceInfo);
}