static void prvFillBaseAduDeviceProperties()

in source/azure_iot_adu_client.c [326:370]


static void prvFillBaseAduDeviceProperties( AzureIoTADUClientDeviceProperties_t * pxDeviceProperties,
                                            az_iot_adu_client_device_properties * pxBaseAduDeviceProperties )
{
    pxBaseAduDeviceProperties->manufacturer = az_span_create(
        ( uint8_t * ) pxDeviceProperties->ucManufacturer,
        ( int32_t ) pxDeviceProperties->ulManufacturerLength );
    pxBaseAduDeviceProperties->model = az_span_create(
        ( uint8_t * ) pxDeviceProperties->ucModel,
        ( int32_t ) pxDeviceProperties->ulModelLength );

    if( pxDeviceProperties->pxCustomProperties == NULL )
    {
        pxBaseAduDeviceProperties->custom_properties = NULL;
    }
    else
    {
        pxDeviceProperties->pxCustomProperties->_internal.xCustomProperties.count =
            ( int32_t ) pxDeviceProperties->pxCustomProperties->ulPropertyCount;

        for( int32_t lPropertyIndex = 0;
             lPropertyIndex < ( int32_t ) pxDeviceProperties->pxCustomProperties->ulPropertyCount;
             lPropertyIndex++ )
        {
            pxDeviceProperties->pxCustomProperties->_internal.xCustomProperties.names[ lPropertyIndex ] =
                az_span_create(
                    pxDeviceProperties->pxCustomProperties->pucPropertyNames[ lPropertyIndex ],
                    ( int32_t ) pxDeviceProperties->pxCustomProperties->ulPropertyNamesLengths[ lPropertyIndex ] );
            pxDeviceProperties->pxCustomProperties->_internal.xCustomProperties.values[ lPropertyIndex ] =
                az_span_create(
                    pxDeviceProperties->pxCustomProperties->pucPropertyValues[ lPropertyIndex ],
                    ( int32_t ) pxDeviceProperties->pxCustomProperties->ulPropertyValuesLengths[ lPropertyIndex ] );
        }

        pxBaseAduDeviceProperties->custom_properties =
            &pxDeviceProperties->pxCustomProperties->_internal.xCustomProperties;
    }

    pxBaseAduDeviceProperties->update_id = az_span_create(
        ( uint8_t * ) pxDeviceProperties->ucCurrentUpdateId,
        ( int32_t ) pxDeviceProperties->ulCurrentUpdateIdLength );
    pxBaseAduDeviceProperties->adu_version = AZ_SPAN_FROM_STR( AZ_IOT_ADU_CLIENT_AGENT_VERSION );
    pxBaseAduDeviceProperties->delivery_optimization_agent_version = az_span_create(
        ( uint8_t * ) pxDeviceProperties->ucDeliveryOptimizationAgentVersion,
        ( int32_t ) pxDeviceProperties->ulDeliveryOptimizationAgentVersionLength );
}