Skip to content

Commit bc5587c

Browse files
authored
Fix FreeRTOS-Plus device defender, shadow and job demo warnings (FreeRTOS#1193)
* Fix FreeRTOS-Plus device defender, shadow and job demo warnings * Cast to void * for vPortFree
1 parent c5c41ef commit bc5587c

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

FreeRTOS-Plus/Demo/AWS/Device_Defender_Windows_Simulator/Device_Defender_Demo/DemoTasks/DefenderDemoExample.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ static uint32_t ulReportId = 0UL;
219219

220220
/*-----------------------------------------------------------*/
221221

222+
extern BaseType_t xPlatformIsNetworkUp( void );
223+
224+
/*-----------------------------------------------------------*/
225+
222226
/**
223227
* @brief Callback to receive the incoming publish messages from the MQTT broker.
224228
*

FreeRTOS-Plus/Demo/AWS/Device_Shadow_Windows_Simulator/Device_Shadow_Demo/DemoTasks/ShadowDemoMainExample.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ static BaseType_t prvWaitForDeleteResponse( MQTTContext_t * pxMQTTContext );
375375

376376
/*-----------------------------------------------------------*/
377377

378+
extern BaseType_t xPlatformIsNetworkUp( void );
379+
380+
/*-----------------------------------------------------------*/
381+
378382
static BaseType_t prvWaitForDeleteResponse( MQTTContext_t * pxMQTTContext )
379383
{
380384
uint8_t ucCount = 0U;

FreeRTOS-Plus/Demo/AWS/Jobs_Windows_Simulator/Jobs_Demo/DemoTasks/JobsDemoExample.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static void prvSendUpdateForJob( char * pcJobId,
388388
static void prvProcessJobDocument( char * pcJobId,
389389
uint16_t usJobIdLength,
390390
char * pcJobDocument,
391-
uint16_t jobDocumentLength );
391+
size_t uxJobDocumentLength );
392392

393393
/**
394394
* @brief The task used to demonstrate the Jobs library API.
@@ -398,6 +398,9 @@ static void prvProcessJobDocument( char * pcJobId,
398398
*/
399399
void prvJobsDemoTask( void * pvParameters );
400400

401+
/*-----------------------------------------------------------*/
402+
403+
extern BaseType_t xPlatformIsNetworkUp( void );
401404

402405
/*-----------------------------------------------------------*/
403406

@@ -473,7 +476,7 @@ static void prvSendUpdateForJob( char * pcJobId,
473476
static void prvProcessJobDocument( char * pcJobId,
474477
uint16_t usJobIdLength,
475478
char * pcJobDocument,
476-
uint16_t jobDocumentLength )
479+
size_t uxJobDocumentLength )
477480
{
478481
char * pcAction = NULL;
479482
size_t uActionLength = 0U;
@@ -482,10 +485,10 @@ static void prvProcessJobDocument( char * pcJobId,
482485
configASSERT( pcJobId != NULL );
483486
configASSERT( usJobIdLength > 0 );
484487
configASSERT( pcJobDocument != NULL );
485-
configASSERT( jobDocumentLength > 0 );
488+
configASSERT( uxJobDocumentLength > 0 );
486489

487490
xJsonStatus = JSON_Search( pcJobDocument,
488-
jobDocumentLength,
491+
uxJobDocumentLength,
489492
jobsexampleQUERY_KEY_FOR_ACTION,
490493
jobsexampleQUERY_KEY_FOR_ACTION_LENGTH,
491494
&pcAction,
@@ -516,7 +519,7 @@ static void prvProcessJobDocument( char * pcJobId,
516519
LogInfo( ( "Received job contains \"print\" action." ) );
517520

518521
xJsonStatus = JSON_Search( pcJobDocument,
519-
jobDocumentLength,
522+
uxJobDocumentLength,
520523
jobsexampleQUERY_KEY_FOR_MESSAGE,
521524
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
522525
&pcMessage,
@@ -548,7 +551,7 @@ static void prvProcessJobDocument( char * pcJobId,
548551
size_t ulTopicLength = 0U;
549552

550553
xJsonStatus = JSON_Search( pcJobDocument,
551-
jobDocumentLength,
554+
uxJobDocumentLength,
552555
jobsexampleQUERY_KEY_FOR_TOPIC,
553556
jobsexampleQUERY_KEY_FOR_TOPIC_LENGTH,
554557
&pcTopic,
@@ -563,7 +566,7 @@ static void prvProcessJobDocument( char * pcJobId,
563566
else
564567
{
565568
xJsonStatus = JSON_Search( pcJobDocument,
566-
jobDocumentLength,
569+
uxJobDocumentLength,
567570
jobsexampleQUERY_KEY_FOR_MESSAGE,
568571
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
569572
&pcMessage,
@@ -968,8 +971,8 @@ void prvJobsDemoTask( void * pvParameters )
968971
{
969972
/* Handler function to process Jobs message payload. */
970973
prvNextJobHandler( pxJobMessagePublishInfo );
971-
vPortFree( pxJobMessagePublishInfo->pTopicName );
972-
vPortFree( pxJobMessagePublishInfo->pPayload );
974+
vPortFree( ( void * ) ( pxJobMessagePublishInfo->pTopicName ) );
975+
vPortFree( ( void * ) ( pxJobMessagePublishInfo->pPayload ) );
973976
vPortFree( pxJobMessagePublishInfo );
974977
}
975978

FreeRTOS-Plus/Demo/AWS/Jobs_Windows_Simulator/Jobs_Demo/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
extern void prvJobsDemoTask( void * pvParameters );
5656
extern void vPlatformInitLogging( void );
57+
extern void vPlatformInitIpStack( void );
5758

5859
/*-----------------------------------------------------------*/
5960

FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ static MQTTStatus_t prvProcessLoopWithTimeout( MQTTContext_t * pMqttContext,
363363

364364
/*-----------------------------------------------------------*/
365365

366+
extern UBaseType_t uxRand( void );
367+
368+
/*-----------------------------------------------------------*/
369+
366370
static int32_t prvGenerateRandomNumber()
367371
{
368372
return( uxRand() & INT32_MAX );

FreeRTOS-Plus/Demo/Common/Logging/windows/Logging_WinSim.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <stdio.h>
3939
#include <stdint.h>
4040
#include <stdarg.h>
41+
#include <stdlib.h>
4142
#include <io.h>
4243
#include <ctype.h>
4344

@@ -209,7 +210,7 @@ void vLoggingInit( BaseType_t xLogToStdout,
209210
xLogStreamBuffer->LENGTH = dlLOGGING_STREAM_BUFFER_SIZE + 1;
210211

211212
/* Create the Windows event. */
212-
pvLoggingThreadEvent = CreateEvent( NULL, FALSE, TRUE, "StdoutLoggingEvent" );
213+
pvLoggingThreadEvent = CreateEvent( NULL, FALSE, TRUE, L"StdoutLoggingEvent" );
213214

214215
/* Create the thread itself. */
215216
Win32Thread = CreateThread(

0 commit comments

Comments
 (0)