Skip to content

Commit

Permalink
fixing merge conflicts with staging/ota
Browse files Browse the repository at this point in the history
  • Loading branch information
divekarshubham committed Oct 19, 2020
2 parents 040a10b + 0ae5af1 commit 32814d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
url = https://github.com/aws/device-shadow-for-aws-iot-embedded-sdk.git
[submodule "libraries/aws/ota"]
path = libraries/aws/ota
url = git@github.com:aws/ota-for-aws-iot-embedded-sdk.git
url = https://github.com/aws/ota-for-aws-iot-embedded-sdk.git
31 changes: 8 additions & 23 deletions demos/ota/ota_demo_http/aws_iot_ota_update_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,13 @@ static void App_OTACompleteCallback( OtaJobEvent_t event )

static void jobCallback( MQTTContext_t * pContext, MQTTPublishInfo_t * pPublishInfo )
{
// static char buff[1024];
assert( pPublishInfo != NULL );
assert( pContext != NULL );

OtaEventData_t * pData;
OtaEventMsg_t eventMsg = { 0 };

/* Suppress unused parameter warning when asserts are disabled in build. */
( void ) pContext;


// TODO, notify OTA agent about the incoming message.

LogInfo( ( "Received ota message callback.\n\n" ) );
LogInfo( ( "Received job message callback, size %d.\n\n", pPublishInfo->payloadLength ) );

pData = otaEventBufferGet();

Expand All @@ -303,25 +296,16 @@ static void jobCallback( MQTTContext_t * pContext, MQTTPublishInfo_t * pPublishI

static void dataCallback( MQTTContext_t * pContext, MQTTPublishInfo_t * pPublishInfo )
{
// static char buff[1024];
assert( pPublishInfo != NULL );
assert( pContext != NULL );

OtaEventData_t * pData;
OtaEventMsg_t eventMsg = { 0 };

/* Suppress unused parameter warning when asserts are disabled in build. */
( void ) pContext;

// memcpy( buff, pPublishInfo->pPayload, pPublishInfo->payloadLength );

// TODO, notify OTA agent about the incoming message.

LogInfo( ( "Received ota message callback.\n\n" ) );
LogInfo( ( "Received data message callback, size %d.\n\n", pPublishInfo->payloadLength ) );

pData = otaEventBufferGet();


if( pData != NULL )
{
memcpy( pData->data, pPublishInfo->pPayload, pPublishInfo->payloadLength );
Expand Down Expand Up @@ -744,9 +728,7 @@ static OtaErr_t unsubscribe( const char * pTopicFilter,
void startOTADemo( MQTTContext_t * pMqttContext )
{
int ret = 0;

MQTTStatus_t mqttStatus;

OtaEventMsg_t eventMsg = { 0 };

/* MQTT susbsrciption manager parameters.*/
Expand All @@ -758,6 +740,9 @@ void startOTADemo( MQTTContext_t * pMqttContext )
/* OTA Agent state.*/
OtaState_t state = OtaAgentStateStopped;

/* OTA Agent thread handle. */
pthread_t threadHandle;

/* Initialize OTA library OS Interface. */
static OtaOSInterface_t otaOSInterface;
otaOSInterface.event.init = ota_InitEvent;
Expand All @@ -773,9 +758,6 @@ void startOTADemo( MQTTContext_t * pMqttContext )
otaMqttInterface.jobCallback = jobCallback;
otaMqttInterface.dataCallback= dataCallback;

/* OTA Agent thread handle. */
pthread_t threadHandle;

/* Initialize the OTA Agent , if it is resuming the OTA statistics will be cleared for new
* connection.*/
OTA_AgentInit( ( void * ) ( pMqttContext ),
Expand All @@ -797,6 +779,9 @@ void startOTADemo( MQTTContext_t * pMqttContext )
* per second. */
while( ( ( state = OTA_GetAgentState() ) != OtaAgentStateStopped ) )
{

sleep( OTA_DEMO_TASK_DELAY_SECONDS );

LogInfo( ( " Received: %u Queued: %u Processed: %u Dropped: %u",
OTA_GetPacketsReceived(),
OTA_GetPacketsQueued(),
Expand Down
132 changes: 0 additions & 132 deletions platform/ota/src/os/ota_os_posix.c

This file was deleted.

0 comments on commit 32814d6

Please sign in to comment.