Skip to content

Commit

Permalink
Fix PUBLICH typo, use PUBLISH
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak committed Jan 5, 2024
1 parent a28c4d9 commit 48bd8e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Common/app/env_sensor_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#define MQTT_PUBLISH_MAX_LEN ( 512 )
#define MQTT_PUBLISH_TIME_BETWEEN_MS ( 1000 )
#define MQTT_PUBLISH_TOPIC "env_sensor_data"
#define MQTT_PUBLICH_TOPIC_STR_LEN ( 256 )
#define MQTT_PUBLISH_TOPIC_STR_LEN ( 256 )
#define MQTT_PUBLISH_BLOCK_TIME_MS ( 1000 )
#define MQTT_PUBLISH_NOTIFICATION_WAIT_MS ( 1000 )

Expand Down Expand Up @@ -246,7 +246,7 @@ void vEnvironmentSensorPublishTask( void * pvParameters )
BaseType_t xExitFlag = pdFALSE;
char payloadBuf[ MQTT_PUBLISH_MAX_LEN ];
MQTTAgentHandle_t xAgentHandle = NULL;
char pcTopicString[ MQTT_PUBLICH_TOPIC_STR_LEN ] = { 0 };
char pcTopicString[ MQTT_PUBLISH_TOPIC_STR_LEN ] = { 0 };
size_t uxTopicLen = 0;

( void ) pvParameters;
Expand All @@ -259,14 +259,14 @@ void vEnvironmentSensorPublishTask( void * pvParameters )
vTaskDelete( NULL );
}

uxTopicLen = KVStore_getString( CS_CORE_THING_NAME, pcTopicString, MQTT_PUBLICH_TOPIC_STR_LEN );
uxTopicLen = KVStore_getString( CS_CORE_THING_NAME, pcTopicString, MQTT_PUBLISH_TOPIC_STR_LEN );

if( uxTopicLen > 0 )
{
uxTopicLen = strlcat( pcTopicString, "/" MQTT_PUBLISH_TOPIC, MQTT_PUBLICH_TOPIC_STR_LEN );
uxTopicLen = strlcat( pcTopicString, "/" MQTT_PUBLISH_TOPIC, MQTT_PUBLISH_TOPIC_STR_LEN );
}

if( ( uxTopicLen == 0 ) || ( uxTopicLen >= MQTT_PUBLICH_TOPIC_STR_LEN ) )
if( ( uxTopicLen == 0 ) || ( uxTopicLen >= MQTT_PUBLISH_TOPIC_STR_LEN ) )
{
LogError( "Failed to construct topic string." );
xExitFlag = pdTRUE;
Expand Down
8 changes: 4 additions & 4 deletions Common/app/motion_sensors_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
*/
#define MQTT_PUBLISH_MAX_LEN ( 200 )
#define MQTT_PUBLISH_PERIOD_MS ( 500 )
#define MQTT_PUBLICH_TOPIC_STR_LEN ( 256 )
#define MQTT_PUBLISH_TOPIC_STR_LEN ( 256 )
#define MQTT_PUBLISH_BLOCK_TIME_MS ( 200 )
#define MQTT_PUBLISH_NOTIFICATION_WAIT_MS ( 1000 )
#define MQTT_NOTIFY_IDX ( 1 )
Expand Down Expand Up @@ -222,7 +222,7 @@ void vMotionSensorsPublish( void * pvParameters )

MQTTAgentHandle_t xAgentHandle = NULL;
char pcPayloadBuf[ MQTT_PUBLISH_MAX_LEN ];
char pcTopicString[ MQTT_PUBLICH_TOPIC_STR_LEN ] = { 0 };
char pcTopicString[ MQTT_PUBLISH_TOPIC_STR_LEN ] = { 0 };
char * pcDeviceId = NULL;
int lTopicLen = 0;

Expand All @@ -242,10 +242,10 @@ void vMotionSensorsPublish( void * pvParameters )
}
else
{
lTopicLen = snprintf( pcTopicString, ( size_t ) MQTT_PUBLICH_TOPIC_STR_LEN, "%s/motion_sensor_data", pcDeviceId );
lTopicLen = snprintf( pcTopicString, ( size_t ) MQTT_PUBLISH_TOPIC_STR_LEN, "%s/motion_sensor_data", pcDeviceId );
}

if( ( lTopicLen <= 0 ) || ( lTopicLen > MQTT_PUBLICH_TOPIC_STR_LEN ) )
if( ( lTopicLen <= 0 ) || ( lTopicLen > MQTT_PUBLISH_TOPIC_STR_LEN ) )
{
LogError( "Error while constructing topic string." );
xExitFlag = pdTRUE;
Expand Down

0 comments on commit 48bd8e2

Please sign in to comment.