bool AiaGetIotEndpoint()

in ports/Registration/src/aia_registration_config.c [88:113]


bool AiaGetIotEndpoint( char* iotEndpoint, size_t* len )
{
    if( !len )
    {
        AiaLogError( "Null len." );
        return false;
    }

    size_t iotEndpointLen = strlen( g_aiaIotEndpoint ) + 1;
    if( !iotEndpointLen )
    {
        AiaLogError( "Failed to retrieve IoT endpoint length" );
        return false;
    }
    if( iotEndpoint )
    {
        if( *len < iotEndpointLen )
        {
            AiaLogError( "iotEndpoint buffer too small to hold IoT endpoint." );
            return false;
        }
        strncpy( iotEndpoint, g_aiaIotEndpoint, iotEndpointLen );
    }
    *len = iotEndpointLen;
    return true;
}