static bool validateStruct()

in source/core_mqtt_agent.c [878:904]


static bool validateStruct( const MQTTAgentContext_t * pMqttAgentContext,
                            const MQTTAgentCommandInfo_t * pCommandInfo )
{
    bool ret = false;

    if( ( pMqttAgentContext == NULL ) ||
        ( pCommandInfo == NULL ) )
    {
        LogError( ( "Pointer cannot be NULL. pMqttAgentContext=%p, pCommandInfo=%p.",
                    ( void * ) pMqttAgentContext,
                    ( void * ) pCommandInfo ) );
    }
    else if( ( pMqttAgentContext->agentInterface.send == NULL ) ||
             ( pMqttAgentContext->agentInterface.recv == NULL ) ||
             ( pMqttAgentContext->agentInterface.getCommand == NULL ) ||
             ( pMqttAgentContext->agentInterface.releaseCommand == NULL ) ||
             ( pMqttAgentContext->agentInterface.pMsgCtx == NULL ) )
    {
        LogError( ( "pMqttAgentContext must have initialized its messaging interface." ) );
    }
    else
    {
        ret = true;
    }

    return ret;
}