Microchip® Advanced Software Framework

aws_iot_shadow_records.c File Reference

Data Structures

struct  JsonTokenTable_t
 
struct  SubscriptionRecord_t
 
struct  ToBeReceivedAckRecord_t
 

Macros

#define MAX_TOPICS_AT_ANY_GIVEN_TIME   2*MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME
 
#define SUBSCRIBE_SETTLING_TIME   2
 

Enumerations

enum  ShadowAckTopicTypes_t {
  SHADOW_ACCEPTED,
  SHADOW_REJECTED,
  SHADOW_ACTION
}
 

Functions

static int AckStatusCallback (MQTTCallbackParams params)
 
void addToAckWaitList (uint8_t indexAckWaitList, const char *pThingName, ShadowActions_t action, const char *pExtractedClientToken, fpActionCallback_t callback, void *pCallbackContext, uint32_t timeout_seconds)
 
static int16_t findIndexOfSubscriptionList (const char *pTopic)
 
bool getNextFreeIndexOfAckWaitList (uint8_t *pIndex)
 
static int16_t getNextFreeIndexOfSubscriptionList (void)
 
void HandleExpiredResponseCallbacks (void)
 
void incrementSubscriptionCnt (const char *pThingName, ShadowActions_t action, bool isSticky)
 
void initDeltaTokens (void)
 
void initializeRecords (MQTTClient_t *pClient)
 
static bool isAckForMyThingName (const char *pTopicName)
 
bool isSubscriptionPresent (const char *pThingName, ShadowActions_t action)
 
IoT_Error_t publishToShadowAction (const char *pThingName, ShadowActions_t action, const char *pJsonDocumentToBeSent)
 
IoT_Error_t registerJsonTokenOnDelta (jsonStruct_t *pStruct)
 
static int shadow_delta_callback (MQTTCallbackParams params)
 
IoT_Error_t subscribeToShadowActionAcks (const char *pThingName, ShadowActions_t action, bool isSticky)
 
static void topicNameFromThingAndAction (char *pTopic, const char *pThingName, ShadowActions_t action, ShadowAckTopicTypes_t ackType)
 
static void unsubscribeFromAcceptedAndRejected (uint8_t index)
 

Variables

ToBeReceivedAckRecord_t AckWaitList [MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME]
 
static bool deltaTopicSubscribedFlag = false
 
char mqttClientID [MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES]
 
char myThingName [MAX_SIZE_OF_THING_NAME]
 
MQTTClient_tpMqttClient
 
char shadowDeltaTopic [MAX_SHADOW_TOPIC_LENGTH_BYTES]
 
bool shadowDiscardOldDeltaFlag = true
 
uint32_t shadowJsonVersionNum = 0
 
char shadowRxBuf [SHADOW_MAX_SIZE_OF_RX_BUFFER]
 
SubscriptionRecord_t SubscriptionList [MAX_TOPICS_AT_ANY_GIVEN_TIME]
 
static JsonTokenTable_t tokenTable [MAX_JSON_TOKEN_EXPECTED]
 
static uint32_t tokenTableIndex = 0
 

#define MAX_TOPICS_AT_ANY_GIVEN_TIME   2*MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME
#define SUBSCRIBE_SETTLING_TIME   2

Enumerator
SHADOW_ACCEPTED 
SHADOW_REJECTED 
SHADOW_ACTION 

void addToAckWaitList ( uint8_t  indexAckWaitList,
const char *  pThingName,
ShadowActions_t  action,
const char *  pExtractedClientToken,
fpActionCallback_t  callback,
void *  pCallbackContext,
uint32_t  timeout_seconds 
)
static int16_t findIndexOfSubscriptionList ( const char *  pTopic)
static
bool getNextFreeIndexOfAckWaitList ( uint8_t *  pIndex)

References i, and NULL.

Referenced by iot_shadow_action().

static int16_t getNextFreeIndexOfSubscriptionList ( void  )
static
void incrementSubscriptionCnt ( const char *  pThingName,
ShadowActions_t  action,
bool  isSticky 
)
void initDeltaTokens ( void  )
static bool isAckForMyThingName ( const char *  pTopicName)
static

References myThingName, and NULL.

Referenced by AckStatusCallback().

bool isSubscriptionPresent ( const char *  pThingName,
ShadowActions_t  action 
)
static void topicNameFromThingAndAction ( char *  pTopic,
const char *  pThingName,
ShadowActions_t  action,
ShadowAckTopicTypes_t  ackType 
)
static

ToBeReceivedAckRecord_t AckWaitList[MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME]
bool deltaTopicSubscribedFlag = false
static
char mqttClientID[MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES]
char myThingName[MAX_SIZE_OF_THING_NAME]
MQTTClient_t* pMqttClient
char shadowDeltaTopic[MAX_SHADOW_TOPIC_LENGTH_BYTES]
char shadowRxBuf[SHADOW_MAX_SIZE_OF_RX_BUFFER]
JsonTokenTable_t tokenTable[MAX_JSON_TOKEN_EXPECTED]
static
uint32_t tokenTableIndex = 0
static