this is fork and i will modify for STM32

Fork of AWS-test by Pierre-Marie Ancèle

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers aws_iot_shadow_records.h Source File

aws_iot_shadow_records.h

00001 /*
00002  * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License").
00005  * You may not use this file except in compliance with the License.
00006  * A copy of the License is located at
00007  *
00008  *  http://aws.amazon.com/apache2.0
00009  *
00010  * or in the "license" file accompanying this file. This file is distributed
00011  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
00012  * express or implied. See the License for the specific language governing
00013  * permissions and limitations under the License.
00014  */
00015 
00016 #ifndef SRC_SHADOW_AWS_IOT_SHADOW_RECORDS_H_
00017 #define SRC_SHADOW_AWS_IOT_SHADOW_RECORDS_H_
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 #include <stdbool.h>
00024 
00025 #include "aws_iot_shadow_interface.h"
00026 #include "aws_iot_config.h"
00027 
00028 
00029 extern uint32_t shadowJsonVersionNum;
00030 extern bool shadowDiscardOldDeltaFlag;
00031 
00032 extern char myThingName[MAX_SIZE_OF_THING_NAME];
00033 extern uint16_t myThingNameLen;
00034 extern char mqttClientID[MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES];
00035 extern uint16_t mqttClientIDLen;
00036 
00037 void initializeRecords(AWS_IoT_Client *pClient);
00038 bool isSubscriptionPresent(const char *pThingName, ShadowActions_t action);
00039 IoT_Error_t subscribeToShadowActionAcks(const char *pThingName, ShadowActions_t action, bool isSticky);
00040 void incrementSubscriptionCnt(const char *pThingName, ShadowActions_t action, bool isSticky);
00041 
00042 IoT_Error_t publishToShadowAction(const char *pThingName, ShadowActions_t action, const char *pJsonDocumentToBeSent);
00043 void addToAckWaitList(uint8_t indexAckWaitList, const char *pThingName, ShadowActions_t action,
00044                       const char *pExtractedClientToken, fpActionCallback_t callback, void *pCallbackContext,
00045                       uint32_t timeout_seconds);
00046 bool getNextFreeIndexOfAckWaitList(uint8_t *pIndex);
00047 void HandleExpiredResponseCallbacks(void);
00048 void initDeltaTokens(void);
00049 IoT_Error_t registerJsonTokenOnDelta(jsonStruct_t *pStruct);
00050 
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054 
00055 #endif /* SRC_SHADOW_AWS_IOT_SHADOW_RECORDS_H_ */