qgsm/cellular_qgsm_api.c
static CellularPktStatus_t _parseSocketOpenNextTok( const char * pToken,
                                                    uint32_t sockIndex,
                                                    CellularSocketContext_t * pSocketData )
{
    int32_t sockStatus = 0;
    CellularATError_t atCoreStatus = CELLULAR_AT_SUCCESS;
    CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK;

    if( atCoreStatus == CELLULAR_AT_SUCCESS )
    {
        if( strcmp( pToken, "CONNECTOK" ) != 0 )
        {
            pSocketData->socketState = SOCKETSTATE_DISCONNECTED;
            LogError( ( "_parseSocketOpen: Socket open failed, conn %d, status %d", sockIndex, sockStatus ) );
        }
        else
        {
            pSocketData->socketState = SOCKETSTATE_CONNECTED;
            LogDebug( ( "_parseSocketOpen: Socket open success, conn %d", sockIndex ) );
        }

        /* Indicate the upper layer about the socket open status. */
        if( pSocketData->openCallback != NULL )
        {
            if( sockStatus != 0 )
            {
                pSocketData->openCallback( CELLULAR_URC_SOCKET_OPEN_FAILED,
                                           pSocketData, pSocketData->pOpenCallbackContext );
            }
            else
            {
                pSocketData->openCallback( CELLULAR_URC_SOCKET_OPENED,
                                           pSocketData, pSocketData->pOpenCallbackContext );
            }
        }
        else
        {
            LogError( ( "_parseSocketOpen: Socket open callback for conn %d is not set!!", sockIndex ) );
        }
    }

    pktStatus = _Cellular_TranslateAtCoreStatus( atCoreStatus );
    return pktStatus;
}
/*-----------------------------------------------------------*/
/* internal function of _parseSocketOpen to reduce complexity. */
internal function of _parseSocketOpen to reduce complexity.
internal function of _parseSocketOpen to reduce complexity .
static CellularPktStatus_t _parseSocketOpenNextTok( const char * pToken,
                                                    uint32_t sockIndex,
                                                    CellularSocketContext_t * pSocketData )
{
    int32_t sockStatus = 0;
    CellularATError_t atCoreStatus = CELLULAR_AT_SUCCESS;
    CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK;
    if( atCoreStatus == CELLULAR_AT_SUCCESS )
    {
        if( strcmp( pToken, "CONNECTOK" ) != 0 )
        {
            pSocketData->socketState = SOCKETSTATE_DISCONNECTED;
            LogError( ( "_parseSocketOpen: Socket open failed, conn %d, status %d", sockIndex, sockStatus ) );
        }
        else
        {
            pSocketData->socketState = SOCKETSTATE_CONNECTED;
            LogDebug( ( "_parseSocketOpen: Socket open success, conn %d", sockIndex ) );
        }
        if( pSocketData->openCallback != NULL )
        {
            if( sockStatus != 0 )
            {
                pSocketData->openCallback( CELLULAR_URC_SOCKET_OPEN_FAILED,
                                           pSocketData, pSocketData->pOpenCallbackContext );
            }
            else
            {
                pSocketData->openCallback( CELLULAR_URC_SOCKET_OPENED,
                                           pSocketData, pSocketData->pOpenCallbackContext );
            }
        }
        else
        {
            LogError( ( "_parseSocketOpen: Socket open callback for conn %d is not set!!", sockIndex ) );
        }
    }
    pktStatus = _Cellular_TranslateAtCoreStatus( atCoreStatus );
    return pktStatus;
}
static CellularPktStatus_t _parseSocketOpenNextTok ( const char * pToken , uint32_t sockIndex , CellularSocketContext_t * pSocketData ) { int32_t sockStatus = 0 ; CellularATError_t atCoreStatus = CELLULAR_AT_SUCCESS ; CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK ; if ( atCoreStatus == CELLULAR_AT_SUCCESS ) { if ( strcmp ( pToken , " " ) != 0 ) { pSocketData -> socketState = SOCKETSTATE_DISCONNECTED ; LogError ( ( " " , sockIndex , sockStatus ) ) ; } else { pSocketData -> socketState = SOCKETSTATE_CONNECTED ; LogDebug ( ( " " , sockIndex ) ) ; } if ( pSocketData -> openCallback != NULL ) { if ( sockStatus != 0 ) { pSocketData -> openCallback ( CELLULAR_URC_SOCKET_OPEN_FAILED , pSocketData , pSocketData -> pOpenCallbackContext ) ; } else { pSocketData -> openCallback ( CELLULAR_URC_SOCKET_OPENED , pSocketData , pSocketData -> pOpenCallbackContext ) ; } } else { LogError ( ( " " , sockIndex ) ) ; } } pktStatus = _Cellular_TranslateAtCoreStatus ( atCoreStatus ) ; return pktStatus ; }
internal function of _parseSocketOpen to reduce complexity.
internal function of _parseSocketOpen to reduce complexity .
/* Indicate the upper layer about the socket open status. */