Skip to content

Commit

Permalink
renaming demos
Browse files Browse the repository at this point in the history
  • Loading branch information
divekarshubham committed Oct 21, 2020
1 parent 32814d6 commit b693798
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set( DEMO_NAME "ota_demo_http" )
set( DEMO_NAME "ota_demo_core_http" )

# Include required library's source and header path variables.
include( ${CMAKE_SOURCE_DIR}/libraries/aws/ota/otaFilePaths.cmake )
Expand All @@ -13,7 +13,7 @@ find_library(LIB_RT rt REQUIRED)
target_sources(
${DEMO_NAME}
PRIVATE
"aws_iot_ota_update_demo.c"
"ota_demo_core_http.c"
${OTA_SOURCES}
${OTA_OS_POSIX_SOURCES}
${OTA_MQTT_SOURCES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* ROOT_CA_CERT_PATH to the absolute path if this demo is executed from elsewhere.
*/
#ifndef ROOT_CA_CERT_PATH
#define ROOT_CA_CERT_PATH "/home/ubuntu/dev/aws-iot-device-sdk-embedded-C-staging/demos/certificates/AmazonRootCA1.crt"
#define ROOT_CA_CERT_PATH "certificates/AmazonRootCA1.crt"
#endif

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

/**
* @file aws_iot_ota_update_demo.c
* @file ota_demo_core_http.c
* @brief A simple OTA update example.
*/

Expand Down Expand Up @@ -788,22 +788,20 @@ void startOTADemo( MQTTContext_t * pMqttContext )
OTA_GetPacketsProcessed(),
OTA_GetPacketsDropped() ) );

sleep( OTA_DEMO_TASK_DELAY_SECONDS );
if(state == OtaAgentStateWaitingForJob )
{
mqttStatus = MQTT_ProcessLoop( pMqttContext, 1000 );

// if(state == OtaAgentStateWaitingForJob )
// {
// mqttStatus = MQTT_ProcessLoop( pMqttContext, 1000 );

// if( mqttStatus != MQTTSuccess )
// {
// LogError( ( "MQTT_ProcessLoop returned with status = %u.",
// mqttStatus ) );
// }
// }
// else
// {
// sleep( OTA_DEMO_TASK_DELAY_SECONDS );
// }
if( mqttStatus != MQTTSuccess )
{
LogError( ( "MQTT_ProcessLoop returned with status = %u.",
mqttStatus ) );
}
}
else
{
sleep( OTA_DEMO_TASK_DELAY_SECONDS );
}

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set( DEMO_NAME "ota_demo_mqtt" )
set( DEMO_NAME "ota_demo_core_mqtt" )

# Include required library's source and header path variables.
include( ${CMAKE_SOURCE_DIR}/libraries/aws/ota/otaFilePaths.cmake )
Expand All @@ -13,7 +13,7 @@ find_library(LIB_RT rt REQUIRED)
target_sources(
${DEMO_NAME}
PRIVATE
"aws_iot_ota_update_demo.c"
"ota_demo_core_mqtt.c"
${OTA_SOURCES}
${OTA_OS_POSIX_SOURCES}
${OTA_MQTT_SOURCES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* ROOT_CA_CERT_PATH to the absolute path if this demo is executed from elsewhere.
*/
#ifndef ROOT_CA_CERT_PATH
#define ROOT_CA_CERT_PATH "/home/ubuntu/dev/aws-iot-device-sdk-embedded-C-staging/demos/certificates/AmazonRootCA1.crt"
#define ROOT_CA_CERT_PATH "certificates/AmazonRootCA1.crt"
#endif

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,22 +803,20 @@ void startOTADemo( MQTTContext_t * pMqttContext )
OTA_GetPacketsProcessed(),
OTA_GetPacketsDropped() ) );

sleep( OTA_DEMO_TASK_DELAY_SECONDS );

// if(state == OtaAgentStateWaitingForJob )
// {
// mqttStatus = MQTT_ProcessLoop( pMqttContext, 1000 );

// if( mqttStatus != MQTTSuccess )
// {
// LogError( ( "MQTT_ProcessLoop returned with status = %u.",
// mqttStatus ) );
// }
// }
// else
// {
// sleep( OTA_DEMO_TASK_DELAY_SECONDS );
// }
if(state == OtaAgentStateWaitingForJob )
{
mqttStatus = MQTT_ProcessLoop( pMqttContext, 1000 );

if( mqttStatus != MQTTSuccess )
{
LogError( ( "MQTT_ProcessLoop returned with status = %u.",
mqttStatus ) );
}
}
else
{
sleep( OTA_DEMO_TASK_DELAY_SECONDS );
}

}

Expand Down

0 comments on commit b693798

Please sign in to comment.