AWS IoT Device SDK C: MQTT
MQTT 3.1.1 client library
Return to main page ↑
iot_test_access_mqtt.h
Go to the documentation of this file.
1 /*
2  * IoT MQTT V2.1.0
3  * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
29 #ifndef IOT_TEST_ACCESS_MQTT_H_
30 #define IOT_TEST_ACCESS_MQTT_H_
31 
32 /*--------------------------- iot_mqtt_api.c ---------------------------*/
33 
40  const IotMqttNetworkInfo_t * pNetworkInfo,
41  uint16_t keepAliveSeconds );
42 
49 
50 /*-------------------------- iot_mqtt_network.c -------------------------*/
51 
57 void IotTestMqtt_sendPuback( _mqttConnection_t * pMqttConnection,
58  uint16_t packetIdentifier );
59 
60 /*------------------------- iot_mqtt_serialize.c ------------------------*/
61 
62 /*
63  * Macros for reading the high and low byte of a 2-byte unsigned int.
64  */
65 #define UINT16_HIGH_BYTE( x ) ( ( uint8_t ) ( x >> 8 ) )
66 #define UINT16_LOW_BYTE( x ) ( ( uint8_t ) ( x & 0x00ff ) )
73 #define UINT16_DECODE( ptr ) \
74  ( uint16_t ) ( ( ( ( uint16_t ) ( *( ptr ) ) ) << 8 ) | \
75  ( ( uint16_t ) ( *( ptr + 1 ) ) ) )
76 
77 /*----------------------- iot_mqtt_subscription.c -----------------------*/
78 
79 /* Internal data structures of iot_mqtt_subscription.c, redefined for the tests. */
80 typedef struct _topicMatchParams
81 {
82  const char * pTopicName;
83  uint16_t topicNameLength;
84  bool exactMatchOnly;
86 typedef struct _packetMatchParams
87 {
88  uint16_t packetIdentifier;
89  int32_t order;
91 
97 bool IotTestMqtt_topicMatch( const IotLink_t * pSubscriptionLink,
98  void * pMatch );
99 
105 bool IotTestMqtt_packetMatch( const IotLink_t * pSubscriptionLink,
106  void * pMatch );
107 
108 #endif /* ifndef IOT_TEST_ACCESS_MQTT_H_ */
bool IotTestMqtt_packetMatch(const IotLink_t *pSubscriptionLink, void *pMatch)
Test access function for _packetMatch.
Definition: iot_test_access_mqtt_subscription.c:48
IotMqttError_t
Return codes of MQTT functions.
Definition: iot_mqtt_types.h:106
Represents an MQTT connection.
Definition: iot_mqtt_internal.h:383
_mqttConnection_t * IotTestMqtt_createMqttConnection(bool awsIotMqttMode, const IotMqttNetworkInfo_t *pNetworkInfo, uint16_t keepAliveSeconds)
Test access function for _createMqttConnection.
Definition: iot_test_access_mqtt_api.c:40
First parameter to _topicMatch.
Definition: iot_mqtt_subscription.c:46
First parameter to _packetMatch.
Definition: iot_mqtt_subscription.c:56
struct _mqttConnection * IotMqttConnection_t
Opaque handle of an MQTT connection.
Definition: iot_mqtt_types.h:67
IotMqttError_t IotTestMqtt_scheduleKeepAlive(IotMqttConnection_t pMqttConnection)
Test access function for _scheduleKeepAlive.
Definition: iot_test_access_mqtt_api.c:49
MQTT network connection details.
Definition: iot_mqtt_types.h:1013
bool IotTestMqtt_topicMatch(const IotLink_t *pSubscriptionLink, void *pMatch)
Test access function for _topicMatch.
Definition: iot_test_access_mqtt_subscription.c:40
void IotTestMqtt_sendPuback(_mqttConnection_t *pMqttConnection, uint16_t packetIdentifier)
Test access function for _sendPuback.
Definition: iot_test_access_mqtt_network.c:37