embedded-software
reusable software modules for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
aws_subscribe_publish_sensor_values.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "aws_iot_log.h"
#include "aws_iot_version.h"
#include "aws_iot_mqtt_client_interface.h"
#include "iot_flash_config.h"
#include "sensors_data.h"
#include "msg.h"
#include "timing.h"
#include "mqtt.h"
#include "task.h"
Include dependency graph for aws_subscribe_publish_sensor_values.c:

Macros

#define AWS_SUCCESS   0
 
#define MQTT_CONNECT_MAX_ATTEMPT_COUNT   3
 
#define TIMER_COUNT_FOR_SENSOR_PUBLISH   10
 
#define aws_json_pre   "{\"state\":{\"reported\":"
 
#define aws_json_desired   "{\"state\":{\"desired\":"
 
#define aws_json_post   "}}"
 

Functions

void init_sensor_subscribe (void)
 
void service_sensor_logic (void)
 
void MQTTcallbackHandler (AWS_IoT_Client *pClient, char *topicName, uint16_t topicNameLen, IoT_Publish_Message_Params *params, void *pData)
 MQTT subscriber callback hander. More...
 
int subscribe_publish_sensor_values (void)
 
int cloud_device_enter_credentials (void)
 
bool app_needs_device_keypair ()
 

Macro Definition Documentation

#define aws_json_desired   "{\"state\":{\"desired\":"
#define aws_json_post   "}}"
#define aws_json_pre   "{\"state\":{\"reported\":"
#define AWS_SUCCESS   0
#define MQTT_CONNECT_MAX_ATTEMPT_COUNT   3
#define TIMER_COUNT_FOR_SENSOR_PUBLISH   10

Function Documentation

bool app_needs_device_keypair ( )

Here is the caller graph for this function:

int cloud_device_enter_credentials ( void  )

Here is the caller graph for this function:

void init_sensor_subscribe ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void MQTTcallbackHandler ( AWS_IoT_Client *  pClient,
char *  topicName,
uint16_t  topicNameLen,
IoT_Publish_Message_Params *  params,
void *  pData 
)

MQTT subscriber callback hander.

called when data is received from AWS IoT Thing (message broker)

Parameters
MQTTCallbackParamstype parameter
Returns
no return

Here is the call graph for this function:

Here is the caller graph for this function:

void service_sensor_logic ( void  )
Todo:
split this into a state machine to avoid the loop

Here is the call graph for this function:

Here is the caller graph for this function:

int subscribe_publish_sensor_values ( void  )

Here is the call graph for this function: