qgsm/cellular_qgsm.c
CellularError_t Cellular_ModuleInit( const CellularContext_t * pContext,
                                     void ** ppModuleContext )
{
    CellularError_t cellularStatus = CELLULAR_SUCCESS;
    bool status = false;

    if( pContext == NULL )
    {
        cellularStatus = CELLULAR_INVALID_HANDLE;
    }
    else if( ppModuleContext == NULL )
    {
        cellularStatus = CELLULAR_BAD_PARAMETER;
    }
    else
    {
        /* Initialize the module context. */
        ( void ) memset( &cellularqgsmContext, 0, sizeof( cellularModuleContext_t ) );

        /* Create the mutex for DNS. */
        status = PlatformMutex_Create( &cellularqgsmContext.dnsQueryMutex, false );

        if( status == false )
        {
            cellularStatus = CELLULAR_NO_MEMORY;
        }
        else
        {
            /* Create the queue for DNS. */
            cellularqgsmContext.pktDnsQueue = xQueueCreate( 1, sizeof( cellularDnsQueryResult_t ) );

            if( cellularqgsmContext.pktDnsQueue == NULL )
            {
                PlatformMutex_Destroy( &cellularqgsmContext.dnsQueryMutex );
                cellularStatus = CELLULAR_NO_MEMORY;
            }
            else
            {
                *ppModuleContext = ( void * ) &cellularqgsmContext;
            }
        }
    }

    if( cellularStatus == CELLULAR_SUCCESS )
    {
        cellularStatus = _Cellular_RegisterUndefinedRespCallback( pContext, prvUndefinedRespHandler, pContext );
    }

    return cellularStatus;
}
/* FreeRTOS Cellular Common Library porting interface. */
/* coverity[misra_c_2012_rule_8_7_violation] */
FreeRTOS Cellular Common Library porting interface.
FreeRTOS Cellular Common Library porting interface .
CellularError_t Cellular_ModuleInit( const CellularContext_t * pContext,
                                     void ** ppModuleContext )
{
    CellularError_t cellularStatus = CELLULAR_SUCCESS;
    bool status = false;
    if( pContext == NULL )
    {
        cellularStatus = CELLULAR_INVALID_HANDLE;
    }
    else if( ppModuleContext == NULL )
    {
        cellularStatus = CELLULAR_BAD_PARAMETER;
    }
    else
    {
        ( void ) memset( &cellularqgsmContext, 0, sizeof( cellularModuleContext_t ) );
        status = PlatformMutex_Create( &cellularqgsmContext.dnsQueryMutex, false );
        if( status == false )
        {
            cellularStatus = CELLULAR_NO_MEMORY;
        }
        else
        {
            cellularqgsmContext.pktDnsQueue = xQueueCreate( 1, sizeof( cellularDnsQueryResult_t ) );
            if( cellularqgsmContext.pktDnsQueue == NULL )
            {
                PlatformMutex_Destroy( &cellularqgsmContext.dnsQueryMutex );
                cellularStatus = CELLULAR_NO_MEMORY;
            }
            else
            {
                *ppModuleContext = ( void * ) &cellularqgsmContext;
            }
        }
    }
    if( cellularStatus == CELLULAR_SUCCESS )
    {
        cellularStatus = _Cellular_RegisterUndefinedRespCallback( pContext, prvUndefinedRespHandler, pContext );
    }
    return cellularStatus;
}
CellularError_t Cellular_ModuleInit ( const CellularContext_t * pContext , void * * ppModuleContext ) { CellularError_t cellularStatus = CELLULAR_SUCCESS ; bool status = false ; if ( pContext == NULL ) { cellularStatus = CELLULAR_INVALID_HANDLE ; } else if ( ppModuleContext == NULL ) { cellularStatus = CELLULAR_BAD_PARAMETER ; } else { ( void ) memset ( & cellularqgsmContext , 0 , sizeof ( cellularModuleContext_t ) ) ; status = PlatformMutex_Create ( & cellularqgsmContext . dnsQueryMutex , false ) ; if ( status == false ) { cellularStatus = CELLULAR_NO_MEMORY ; } else { cellularqgsmContext . pktDnsQueue = xQueueCreate ( 1 , sizeof ( cellularDnsQueryResult_t ) ) ; if ( cellularqgsmContext . pktDnsQueue == NULL ) { PlatformMutex_Destroy ( & cellularqgsmContext . dnsQueryMutex ) ; cellularStatus = CELLULAR_NO_MEMORY ; } else { * ppModuleContext = ( void * ) & cellularqgsmContext ; } } } if ( cellularStatus == CELLULAR_SUCCESS ) { cellularStatus = _Cellular_RegisterUndefinedRespCallback ( pContext , prvUndefinedRespHandler , pContext ) ; } return cellularStatus ; }
FreeRTOS Cellular Common Library porting interface.
FreeRTOS Cellular Common Library porting interface .
/* Initialize the module context. */ /* Create the mutex for DNS. */ /* Create the queue for DNS. */