diff --git a/examples/evkbmimxrt1060/test/app_main.c b/examples/evkbmimxrt1060/test/app_main.c index b974b71..9e9b4ef 100644 --- a/examples/evkbmimxrt1060/test/app_main.c +++ b/examples/evkbmimxrt1060/test/app_main.c @@ -35,8 +35,6 @@ #include "test_execution_config.h" -#define appmainRUN_DEVICE_ADVISOR_TEST_SUITE ( 0 ) - #define appmainPROVISIONING_MODE ( 0 ) @@ -70,6 +68,32 @@ extern void vCLITask( void * pvParam ); extern void vOTAUpdateTask( void * pvParam ); +int RunDeviceAdvisorDemo( void ) +{ + BaseType_t xResult = pdFAIL; + + if( xGetMQTTAgentState() < MQTT_AGENT_STATE_INITIALIZED ) + { + xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY ); + } + else + { + xResult = pdPASS; + } + + if( xResult == pdPASS ) + { + xResult = xTaskCreate( vSubscribePublishTestTask, + "TEST", + appmainTEST_TASK_STACK_SIZE, + NULL, + appmainTEST_TASK_PRIORITY, + NULL ); + } + + return ( xResult == pdPASS ) ? 0 : -1; +} + int app_main( void ) { BaseType_t xResult = pdFAIL; @@ -126,28 +150,5 @@ int app_main( void ) } } - - -#if ( appmainRUN_DEVICE_ADVISOR_TEST_SUITE == 1 ) - { - if( xResult == pdPASS ) - { - xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY ); - } - - if( xResult == pdPASS ) - { - xResult = xTaskCreate( vSubscribePublishTestTask, - "TEST", - appmainTEST_TASK_STACK_SIZE, - NULL, - appmainTEST_TASK_PRIORITY, - NULL ); - } - } -#endif /* if ( appmainRUN_DEVICE_ADVISOR_TEST_SUITE == 1 ) */ - - - return pdPASS; } diff --git a/examples/evkbmimxrt1060/test/include/test_execution_config.h b/examples/evkbmimxrt1060/test/include/test_execution_config.h index 5ae6911..9cbee8a 100644 --- a/examples/evkbmimxrt1060/test/include/test_execution_config.h +++ b/examples/evkbmimxrt1060/test/include/test_execution_config.h @@ -28,6 +28,13 @@ #ifndef TEST_EXECUTION_CONFIG_H #define TEST_EXECUTION_CONFIG_H +/** + * @brief Configuration to enable Device Advisor testing. + * + * #define DEVICE_ADVISOR_TEST_ENABLED (0) + */ +#define DEVICE_ADVISOR_TEST_ENABLED ( 0 ) + /** * @brief Configuration to enable the MQTT test. *