mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-10 05:35:17 -05:00
Fix FreeRTOS-Plus device defender, shadow and job demo warnings (#1193)
* Fix FreeRTOS-Plus device defender, shadow and job demo warnings * Cast to void * for vPortFree
This commit is contained in:
parent
c5c41ef3af
commit
bc5587ce5f
6 changed files with 27 additions and 10 deletions
|
|
@ -219,6 +219,10 @@ static uint32_t ulReportId = 0UL;
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern BaseType_t xPlatformIsNetworkUp( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief Callback to receive the incoming publish messages from the MQTT broker.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -375,6 +375,10 @@ static BaseType_t prvWaitForDeleteResponse( MQTTContext_t * pxMQTTContext );
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern BaseType_t xPlatformIsNetworkUp( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvWaitForDeleteResponse( MQTTContext_t * pxMQTTContext )
|
||||
{
|
||||
uint8_t ucCount = 0U;
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ static void prvSendUpdateForJob( char * pcJobId,
|
|||
static void prvProcessJobDocument( char * pcJobId,
|
||||
uint16_t usJobIdLength,
|
||||
char * pcJobDocument,
|
||||
uint16_t jobDocumentLength );
|
||||
size_t uxJobDocumentLength );
|
||||
|
||||
/**
|
||||
* @brief The task used to demonstrate the Jobs library API.
|
||||
|
|
@ -398,6 +398,9 @@ static void prvProcessJobDocument( char * pcJobId,
|
|||
*/
|
||||
void prvJobsDemoTask( void * pvParameters );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern BaseType_t xPlatformIsNetworkUp( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -473,7 +476,7 @@ static void prvSendUpdateForJob( char * pcJobId,
|
|||
static void prvProcessJobDocument( char * pcJobId,
|
||||
uint16_t usJobIdLength,
|
||||
char * pcJobDocument,
|
||||
uint16_t jobDocumentLength )
|
||||
size_t uxJobDocumentLength )
|
||||
{
|
||||
char * pcAction = NULL;
|
||||
size_t uActionLength = 0U;
|
||||
|
|
@ -482,10 +485,10 @@ static void prvProcessJobDocument( char * pcJobId,
|
|||
configASSERT( pcJobId != NULL );
|
||||
configASSERT( usJobIdLength > 0 );
|
||||
configASSERT( pcJobDocument != NULL );
|
||||
configASSERT( jobDocumentLength > 0 );
|
||||
configASSERT( uxJobDocumentLength > 0 );
|
||||
|
||||
xJsonStatus = JSON_Search( pcJobDocument,
|
||||
jobDocumentLength,
|
||||
uxJobDocumentLength,
|
||||
jobsexampleQUERY_KEY_FOR_ACTION,
|
||||
jobsexampleQUERY_KEY_FOR_ACTION_LENGTH,
|
||||
&pcAction,
|
||||
|
|
@ -516,7 +519,7 @@ static void prvProcessJobDocument( char * pcJobId,
|
|||
LogInfo( ( "Received job contains \"print\" action." ) );
|
||||
|
||||
xJsonStatus = JSON_Search( pcJobDocument,
|
||||
jobDocumentLength,
|
||||
uxJobDocumentLength,
|
||||
jobsexampleQUERY_KEY_FOR_MESSAGE,
|
||||
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
|
||||
&pcMessage,
|
||||
|
|
@ -548,7 +551,7 @@ static void prvProcessJobDocument( char * pcJobId,
|
|||
size_t ulTopicLength = 0U;
|
||||
|
||||
xJsonStatus = JSON_Search( pcJobDocument,
|
||||
jobDocumentLength,
|
||||
uxJobDocumentLength,
|
||||
jobsexampleQUERY_KEY_FOR_TOPIC,
|
||||
jobsexampleQUERY_KEY_FOR_TOPIC_LENGTH,
|
||||
&pcTopic,
|
||||
|
|
@ -563,7 +566,7 @@ static void prvProcessJobDocument( char * pcJobId,
|
|||
else
|
||||
{
|
||||
xJsonStatus = JSON_Search( pcJobDocument,
|
||||
jobDocumentLength,
|
||||
uxJobDocumentLength,
|
||||
jobsexampleQUERY_KEY_FOR_MESSAGE,
|
||||
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
|
||||
&pcMessage,
|
||||
|
|
@ -968,8 +971,8 @@ void prvJobsDemoTask( void * pvParameters )
|
|||
{
|
||||
/* Handler function to process Jobs message payload. */
|
||||
prvNextJobHandler( pxJobMessagePublishInfo );
|
||||
vPortFree( pxJobMessagePublishInfo->pTopicName );
|
||||
vPortFree( pxJobMessagePublishInfo->pPayload );
|
||||
vPortFree( ( void * ) ( pxJobMessagePublishInfo->pTopicName ) );
|
||||
vPortFree( ( void * ) ( pxJobMessagePublishInfo->pPayload ) );
|
||||
vPortFree( pxJobMessagePublishInfo );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
|
||||
extern void prvJobsDemoTask( void * pvParameters );
|
||||
extern void vPlatformInitLogging( void );
|
||||
extern void vPlatformInitIpStack( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
|||
|
|
@ -363,6 +363,10 @@ static MQTTStatus_t prvProcessLoopWithTimeout( MQTTContext_t * pMqttContext,
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern UBaseType_t uxRand( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static int32_t prvGenerateRandomNumber()
|
||||
{
|
||||
return( uxRand() & INT32_MAX );
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
|
@ -209,7 +210,7 @@ void vLoggingInit( BaseType_t xLogToStdout,
|
|||
xLogStreamBuffer->LENGTH = dlLOGGING_STREAM_BUFFER_SIZE + 1;
|
||||
|
||||
/* Create the Windows event. */
|
||||
pvLoggingThreadEvent = CreateEvent( NULL, FALSE, TRUE, "StdoutLoggingEvent" );
|
||||
pvLoggingThreadEvent = CreateEvent( NULL, FALSE, TRUE, L"StdoutLoggingEvent" );
|
||||
|
||||
/* Create the thread itself. */
|
||||
Win32Thread = CreateThread(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue