diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000..c41e13f Binary files /dev/null and b/docs/.DS_Store differ diff --git a/docs/_action_8cpp.html b/docs/_action_8cpp.html new file mode 100644 index 0000000..b66b0bb --- /dev/null +++ b/docs/_action_8cpp.html @@ -0,0 +1,91 @@ + + +
+ + + + +
+ AWS IoT C++ SDK
+
+ |
+
Action Base class and related definitions for IoT Client. +More...
+#include "Action.hpp"
Defines a base class to be used by all Actions that can be run by the IoT Client. Also contains definitions for related Action types like ActionType, ActionState and ActionData
+
+ AWS IoT C++ SDK
+
+ |
+
Action Base class and related definitions for IoT Client. +More...
+#include <string>
#include <iostream>
#include <memory>
#include <atomic>
#include "util/Utf8String.hpp"
#include "util/threading/ThreadTask.hpp"
#include "ResponseCode.hpp"
#include "NetworkConnection.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::ActionState |
Action State Class. More... | |
class | awsiotsdk::ActionData |
Action Data Class. More... | |
class | awsiotsdk::Action |
Action Class. More... | |
+Macros | |
+#define | DEFAULT_NETWORK_ACTION_THREAD_SLEEP_DURATION_MS 100 |
+Enumerations | |
enum class | awsiotsdk::ActionType { + RESERVED_ACTION = 0 +, CORE_PROCESS_INBOUND = 1 +, CORE_PROCESS_OUTBOUND = 2 +, CONNECT = 3 +, + DISCONNECT = 4 +, PUBLISH = 5 +, PUBACK = 6 +, PUBREC = 7 +, + PUBREL = 8 +, PUBCOMP = 9 +, SUBSCRIBE = 10 +, READ_INCOMING = 11 +, + KEEP_ALIVE = 12 +, PUBLISH_INBOUND = 13 +, UNSUBSCRIBE = 14 +, RECONNECT = 15 +, + GREENGRASS_DISCOVER = 16 + + } |
ActionType Enum Class. More... | |
Defines a base class to be used by all Actions that can be run by the IoT Client. Also contains definitions for related Action types like ActionType, ActionState and ActionData
+
+
|
+ +strong | +
Defines a strongly typed enum which specifies different Action Types. Actions can be registered in the core client for each of these Types.
+ +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/logging/LogMacros.hpp"
#include "ResponseCode.hpp"
#include "mqtt/Client.hpp"
#include "mqtt/NetworkRead.hpp"
+Macros | |
+#define | MQTT_ACTION_TIMEOUT_MS 2000 |
+#define | MQTT_CLIENT_LOG_TAG "[MQTT Client]" |
+ AWS IoT C++ SDK
+
+ |
+
Contains the MQTT Client class. +More...
+#include "util/Utf8String.hpp"
#include "ClientCore.hpp"
#include "mqtt/Connect.hpp"
#include "mqtt/Publish.hpp"
#include "mqtt/Subscribe.hpp"
#include "mqtt/ClientState.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::MqttClient |
MQTT Client Class. More... | |
Defines MQTT client wrapper using a Client Core instance. This is provided for ease of use. Instead of separately having to define Core Client and adding Actions to the client, applications can use this class directly.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Contains the Client Core class. +More...
+ +Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::ClientCore |
Client Core Class. More... | |
Defines the Client Core class which is a generic Action executor class Client Core instances are responsible for maintaining the Action Registry and running Actions on request. They are also responsible for spawning threads for Actions.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Macros | |
+#define | MAX_CORE_ACTION_PROCESSING_RATE_HZ 5 |
+#define | LOG_TAG_CLIENT_CORE_STATE "[Client Core State]" |
+ AWS IoT C++ SDK
+
+ |
+
#include <condition_variable>
#include <chrono>
#include "util/Core_EXPORTS.hpp"
#include "util/Utf8String.hpp"
#include "util/memory/stl/Map.hpp"
#include "util/memory/stl/Queue.hpp"
#include "Action.hpp"
#include "ResponseCode.hpp"
#include "NetworkConnection.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::DisconnectCallbackContextData |
MQTT Disconnect Callback Context Data. More... | |
class | awsiotsdk::ReconnectCallbackContextData |
MQTT Reconnect Callback Context Data. More... | |
class | awsiotsdk::ResubscribeCallbackContextData |
MQTT Resubscribe Callback Context Data. More... | |
class | awsiotsdk::ClientCoreState |
Client Core State Class. More... | |
class | awsiotsdk::ClientCoreState::PendingAckData |
Pending Ack Data Class. More... | |
+Macros | |
#define | DEFAULT_CORE_THREAD_SLEEP_DURATION_MS 100 |
#define | DEFAULT_MAX_QUEUE_SIZE 16 |
#define DEFAULT_CORE_THREAD_SLEEP_DURATION_MS 100 | +
Default sleep duration between each execution of Client Core thread operations
+ +#define DEFAULT_MAX_QUEUE_SIZE 16 | +
Max size of the queue
+ +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Macros | |
+#define | MIN_RECONNECT_BACKOFF_DEFAULT_SEC 1 |
+#define | MAX_RECONNECT_BACKOFF_DEFAULT_SEC 128 |
+ AWS IoT C++ SDK
+
+ |
+
#include <atomic>
#include "util/Utf8String.hpp"
#include "util/memory/stl/Map.hpp"
#include "Action.hpp"
#include "ClientCore.hpp"
#include "mqtt/Common.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::ClientState |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Common class definitions for the MQTT Client. +More...
+ +Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::WillOptions |
Last Will and Testament Definition. More... | |
class | awsiotsdk::mqtt::SubscriptionHandlerContextData |
MQTT Subscription Handler Context Data. More... | |
class | awsiotsdk::mqtt::Subscription |
MQTT Subscription Definition. More... | |
+Macros | |
+#define | MAX_TOPICS_IN_ONE_SUBSCRIBE_PACKET 8 |
+Enumerations | |
enum class | awsiotsdk::mqtt::Version { MQTT_3_1_1 = 4 + } |
MQTT Version Type. More... | |
enum class | awsiotsdk::mqtt::QoS { QOS0 = 0 +, QOS1 = 1 + } |
Quality of Service (QoS) Type. More... | |
enum class | awsiotsdk::mqtt::MessageTypes { + INVALID = 0 +, CONNECT = 1 +, CONNACK = 2 +, PUBLISH = 3 +, + PUBACK = 4 +, PUBREC = 5 +, PUBREL = 6 +, PUBCOMP = 7 +, + SUBSCRIBE = 8 +, SUBACK = 9 +, UNSUBSCRIBE = 10 +, UNSUBACK = 11 +, + PINGREQ = 12 +, PINGRESP = 13 +, DISCONNECT = 14 +, RESERVED = 15 + + } |
MQTT Message Types Definition. More... | |
+
|
+ +strong | +
Defining a type for MQTT Messages
+
+
|
+ +strong | +
+
|
+ +strong | +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <limits.h>
#include <unistd.h>
#include "util/logging/LogMacros.hpp"
#include "ConfigCommon.hpp"
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/logging/LogMacros.hpp"
#include "mqtt/ClientState.hpp"
#include "mqtt/NetworkRead.hpp"
#include "mqtt/Connect.hpp"
+ AWS IoT C++ SDK
+
+ |
+
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::ConnectPacket |
Connect Packet Type. More... | |
class | awsiotsdk::mqtt::DisconnectPacket |
Disconnect Packet Type. More... | |
class | awsiotsdk::mqtt::PingreqPacket |
class | awsiotsdk::mqtt::ConnectActionAsync |
Define a class for ConnectActionAsync. More... | |
class | awsiotsdk::mqtt::DisconnectActionAsync |
Define a class for DisconnectActionAsync. More... | |
class | awsiotsdk::mqtt::KeepaliveActionRunner |
Define a class for KeepaliveActionRunner. More... | |
+Enumerations | |
enum class | awsiotsdk::mqtt::ConnackReturnCode { + CONNECTION_ACCEPTED = 0 +, UNACCEPTABLE_PROTOCOL_VERSION_ERROR = 1 +, IDENTIFIER_REJECTED_ERROR = 2 +, SERVER_UNAVAILABLE_ERROR = 3 +, + BAD_USERDATA_ERROR = 4 +, NOT_AUTHORIZED_ERROR = 5 + + } |
Define strongly typed enum for Connack Return Codes. | |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::util::Logging::ConsoleLogSystem |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <chrono>
#include "util/JsonParser.hpp"
#include "mqtt/Packet.hpp"
#include "mqtt/ClientState.hpp"
#include "discovery/DiscoveryResponse.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::discovery::DiscoverRequestData |
Discover Request Packet Type. More... | |
class | awsiotsdk::discovery::DiscoverAction |
Define a class for DiscoverAction. More... | |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/logging/Logging.hpp"
#include "util/logging/LogMacros.hpp"
#include "util/logging/ConsoleLogSystem.hpp"
#include "discovery/DiscoveryResponse.hpp"
+Macros | |
+#define | LOG_TAG_DISCOVERY_RESPONSE "[Discovery Response]" |
+ AWS IoT C++ SDK
+
+ |
+
Contains constant strings used as keys in the discovery response JSON. +More...
+#include <rapidjson/document.h>
#include "util/memory/stl/String.hpp"
#include "util/memory/stl/Vector.hpp"
#include "util/memory/stl/Map.hpp"
#include "util/JsonParser.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::ConnectivityInfo |
class | awsiotsdk::DiscoveryResponse |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/logging/FormattedLogSystem.hpp"
#include <chrono>
#include <fstream>
#include <cstdarg>
#include <ctime>
#include <stdio.h>
#include <thread>
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include "util/logging/LogSystemInterface.hpp"
#include "util/logging/LogLevel.hpp"
#include <atomic>
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::util::Logging::FormattedLogSystem |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Contains the MQTT Client class for AWS Greengrass devices. +More...
+#include "util/Utf8String.hpp"
#include "util/JsonParser.hpp"
#include "ClientCore.hpp"
#include "mqtt/Connect.hpp"
#include "mqtt/Publish.hpp"
#include "mqtt/Subscribe.hpp"
#include "mqtt/ClientState.hpp"
#include "discovery/DiscoveryResponse.hpp"
#include "mqtt/Client.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::GreengrassMqttClient |
MQTT Client Class. More... | |
Defines MQTT client wrapper using a Client Core instance. This is provided for ease of use. Instead of separately having to define Core Client and adding Actions to the client, applications can use this class directly. Similar to the Client class but also contains functions for Discovery.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "mqtt/Client.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::Jobs |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <rapidjson/filereadstream.h>
#include <rapidjson/filewritestream.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <fstream>
#include <iostream>
#include <memory>
#include "util/JsonParser.hpp"
+ AWS IoT C++ SDK
+
+ |
+
#include <cstdint>
#include <rapidjson/document.h>
#include "util/memory/stl/String.hpp"
#include "ResponseCode.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::util::JsonParser |
+Macros | |
+#define | MAX_CONFIG_FILE_SIZE_BYTES 4096 |
+Typedefs | |
+using | awsiotsdk::util::JsonDocument = rapidjson::Document |
+using | awsiotsdk::util::JsonValue = rapidjson::Value |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Functions | |
+AWS_API_EXPORT util::String | awsiotsdk::util::Logging::GetLogLevelName (LogLevel logLevel) |
+ AWS IoT C++ SDK
+
+ |
+
Go to the source code of this file.
++Enumerations | |
enum class | awsiotsdk::util::Logging::LogLevel : int { + Off = 0 +, Fatal = 1 +, Error = 2 +, Warn = 3 +, + Info = 4 +, Debug = 5 +, Trace = 6 + + } |
+Functions | |
+AWS_API_EXPORT util::String | awsiotsdk::util::Logging::GetLogLevelName (LogLevel logLevel) |
+
|
+ +strong | +
LogLevel used to control verbosity of logging system.
+ +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include "util/logging/LogLevel.hpp"
#include "util/logging/Logging.hpp"
#include "util/logging/LogSystemInterface.hpp"
#include "util/memory/stl/StringStream.hpp"
Go to the source code of this file.
++Macros | |
#define | AWS_LOG(level, tag, ...) |
#define | AWS_LOG_FATAL(tag, ...) |
#define | AWS_LOG_ERROR(tag, ...) |
#define | AWS_LOG_WARN(tag, ...) |
#define | AWS_LOG_INFO(tag, ...) |
#define | AWS_LOG_DEBUG(tag, ...) |
#define | AWS_LOG_TRACE(tag, ...) |
#define | AWS_LOGSTREAM(level, tag, streamExpression) |
#define | AWS_LOGSTREAM_FATAL(tag, streamExpression) |
#define | AWS_LOGSTREAM_ERROR(tag, streamExpression) |
#define | AWS_LOGSTREAM_WARN(tag, streamExpression) |
#define | AWS_LOGSTREAM_INFO(tag, streamExpression) |
#define | AWS_LOGSTREAM_DEBUG(tag, streamExpression) |
#define | AWS_LOGSTREAM_TRACE(tag, streamExpression) |
#define AWS_LOG | +( | ++ | level, | +
+ | + | + | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_DEBUG | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_ERROR | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_FATAL | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_INFO | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_TRACE | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOG_WARN | +( | ++ | tag, | +
+ | + | + | ... | +
+ | ) | ++ |
#define AWS_LOGSTREAM | +( | ++ | level, | +
+ | + | + | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_DEBUG | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_ERROR | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_FATAL | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_INFO | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_TRACE | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
#define AWS_LOGSTREAM_WARN | +( | ++ | tag, | +
+ | + | + | streamExpression | +
+ | ) | ++ |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include "util/memory/stl/String.hpp"
#include "util/memory/stl/StringStream.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::util::Logging::LogSystemInterface |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/logging/Logging.hpp"
#include "util/logging/LogSystemInterface.hpp"
#include <memory>
+Functions | |
AWS_API_EXPORT void | awsiotsdk::util::Logging::InitializeAWSLogging (const std::shared_ptr< LogSystemInterface > &logSystem) |
AWS_API_EXPORT void | awsiotsdk::util::Logging::ShutdownAWSLogging (void) |
AWS_API_EXPORT LogSystemInterface * | awsiotsdk::util::Logging::GetLogSystem () |
AWS_API_EXPORT void | awsiotsdk::util::Logging::PushLogger (const std::shared_ptr< LogSystemInterface > &logSystem) |
AWS_API_EXPORT void | awsiotsdk::util::Logging::PopLogger () |
LogSystemInterface * awsiotsdk::util::Logging::GetLogSystem | +( | +) | ++ |
Get currently configured log system instance.
+ +void awsiotsdk::util::Logging::InitializeAWSLogging | +( | +const std::shared_ptr< LogSystemInterface > & | +logSystem | ) | ++ |
Call this at the beginning of your program, prior to any AWS calls.
+ +void awsiotsdk::util::Logging::PopLogger | +( | +) | ++ |
Pops the logger off the logger stack and replaces the current logger with it. Disables logging if the top logger is actually a nullptr
+ +void awsiotsdk::util::Logging::PushLogger | +( | +const std::shared_ptr< LogSystemInterface > & | +logSystem | ) | ++ |
Replaces the current logger with a new one, while pushing the old one onto a 1-deep stack; primarily for testing
+ +void awsiotsdk::util::Logging::ShutdownAWSLogging | +( | +void | +) | ++ |
Call this at the exit point of your program, after all calls have finished.
+ +
+ AWS IoT C++ SDK
+
+ |
+
#include <memory>
#include "util/Core_EXPORTS.hpp"
Go to the source code of this file.
++Functions | |
AWS_API_EXPORT void | awsiotsdk::util::Logging::InitializeAWSLogging (const std::shared_ptr< LogSystemInterface > &logSystem) |
AWS_API_EXPORT void | awsiotsdk::util::Logging::ShutdownAWSLogging (void) |
AWS_API_EXPORT LogSystemInterface * | awsiotsdk::util::Logging::GetLogSystem () |
AWS_API_EXPORT void | awsiotsdk::util::Logging::PushLogger (const std::shared_ptr< LogSystemInterface > &logSystem) |
AWS_API_EXPORT void | awsiotsdk::util::Logging::PopLogger () |
LogSystemInterface * awsiotsdk::util::Logging::GetLogSystem | +( | +) | ++ |
Get currently configured log system instance.
+ +void awsiotsdk::util::Logging::InitializeAWSLogging | +( | +const std::shared_ptr< LogSystemInterface > & | +logSystem | ) | ++ |
Call this at the beginning of your program, prior to any AWS calls.
+ +void awsiotsdk::util::Logging::PopLogger | +( | +) | ++ |
Pops the logger off the logger stack and replaces the current logger with it. Disables logging if the top logger is actually a nullptr
+ +void awsiotsdk::util::Logging::PushLogger | +( | +const std::shared_ptr< LogSystemInterface > & | +logSystem | ) | ++ |
Replaces the current logger with a new one, while pushing the old one onto a 1-deep stack; primarily for testing
+ +void awsiotsdk::util::Logging::ShutdownAWSLogging | +( | +void | +) | ++ |
Call this at the exit point of your program, after all calls have finished.
+ +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <map>
Go to the source code of this file.
++Typedefs | |
+template<typename K , typename V > | |
using | awsiotsdk::util::Map = std::map< K, V > |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Network interface base class for IoT Client. +More...
+Defines an interface to the Network layer to be used by the MQTT client. These functions should not be implemented/modified by the derived classes
+
+ AWS IoT C++ SDK
+
+ |
+
Network interface base class for IoT Client. +More...
+#include <cstdint>
#include <string>
#include <mutex>
#include <memory>
#include "util/Core_EXPORTS.hpp"
#include "util/memory/stl/String.hpp"
#include "util/memory/stl/Vector.hpp"
#include "ResponseCode.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::NetworkConnection |
Network Connection Class. More... | |
Defines an interface to the Network layer to be used by the MQTT client. Starting point for porting the SDK to the networking layer of a new platform.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <iostream>
#include <chrono>
#include <thread>
#include "util/logging/LogMacros.hpp"
#include "mqtt/ClientState.hpp"
#include "mqtt/NetworkRead.hpp"
+Macros | |
+#define | MAX_NO_OF_REMAINING_LENGTH_BYTES 4 |
+#define | NETWORK_READ_LOG_TAG "[Network Read]" |
+#define | CONNACK_RESERVED_PACKET_ID 0 |
+ AWS IoT C++ SDK
+
+ |
+
#include "util/memory/stl/Map.hpp"
#include "ResponseCode.hpp"
#include "Action.hpp"
#include "Connect.hpp"
#include "Publish.hpp"
#include "Subscribe.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::NetworkReadActionRunner |
Define a class for NetworkReadActionRunner. More... | |
+Macros | |
+#define | MAX_NO_OF_REMAINING_LENGTH_BYTES 4 |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <string>
#include <iostream>
#include <memory>
#include "util/Utf8String.hpp"
#include "Action.hpp"
#include "ResponseCode.hpp"
#include "NetworkConnection.hpp"
#include "mqtt/Common.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::PacketFixedHeader |
Define a class for the MQTT Fixed header. More... | |
class | awsiotsdk::mqtt::Packet |
Define a base class for all MQTT Packet types. More... | |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
MQTT Publish and Puback Actions and Action data definitions for IoT Client. +More...
+#include "util/logging/LogMacros.hpp"
#include "mqtt/ClientState.hpp"
#include "mqtt/Publish.hpp"
Defines classes for perform MQTT Publish and Puback Actions in Async mode for the IoT Client. Also defines the packet types used by these actions.
+
+ AWS IoT C++ SDK
+
+ |
+
MQTT Publish and Puback Actions and Action data definitions for IoT Client. +More...
+ +Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::PublishPacket |
Publish Message Packet Type. More... | |
class | awsiotsdk::mqtt::PubackPacket |
Define a class for Puback Packet type. More... | |
class | awsiotsdk::mqtt::PublishActionAsync |
Define a class for PublishActionAsync. More... | |
class | awsiotsdk::mqtt::PubackActionAsync |
Define a class for PubackActionAsync. More... | |
Defines classes for perform MQTT Publish and Puback Actions in Async mode for the IoT Client. Also defines the packet types used by these actions.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include <deque>
#include <queue>
Go to the source code of this file.
++Typedefs | |
+template<typename T > | |
using | awsiotsdk::util::Queue = std::queue< T > |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
Response Code class with helper functions. +More...
++Functions | |
std::ostream & | awsiotsdk::operator<< (std::ostream &os, ResponseCode rc) |
Defines a helper functions to convert Response Codes to strings
+std::ostream & awsiotsdk::operator<< | +( | +std::ostream & | +os, | +
+ | + | ResponseCode | +rc | +
+ | ) | ++ |
Overloading the << stream operator for ResponseCode
+os | ostream being filled |
rc | ResponseCode |
+ AWS IoT C++ SDK
+
+ |
+
Strongly typed enumeration of return values from functions within the SDK. +More...
+#include "util/memory/stl/String.hpp"
Go to the source code of this file.
++Namespaces | |
namespace | awsiotsdk::ResponseHelper |
Response Helper for converting ResponseCode into Strings. | |
+Macros | |
+#define | IOT_UNUSED(x) (void)(x) |
+Functions | |
std::ostream & | awsiotsdk::operator<< (std::ostream &os, ResponseCode rc) |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_NO_INFORMATION_PRESENT_STRING ("No information found for device") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_SUCCESS_STRING ("Discover action successful") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_RECEIVED_DELTA_STRING ("Received the shadow delta") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_REQUEST_ACCEPTED_STRING ("Shadow request accepted") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_PHYSICAL_LAYER_CONNECTED_STRING ("Physical network layer connected") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_MANUALLY_DISCONNECTED_STRING ("Network manually disconnected") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_ATTEMPTING_RECONNECT_STRING ("Attempting to reconnect to the network") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_RECONNECTED_STRING ("Network reconnected") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_NOTHING_TO_READ_STRING ("No MQTT packets received") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_CONNECTION_ACCEPTED_STRING ("Successfully connected to MQTT server") |
+const util::String | awsiotsdk::ResponseHelper::SUCCESS_STRING ("Success") |
+const util::String | awsiotsdk::ResponseHelper::FAILURE_STRING ("Failure") |
+const util::String | awsiotsdk::ResponseHelper::NULL_VALUE_ERROR_STRING ("One or more parameters were null") |
+const util::String | awsiotsdk::ResponseHelper::FILE_OPEN_ERROR_STRING ("Error occurred while trying to open the file") |
+const util::String | awsiotsdk::ResponseHelper::FILE_NAME_INVALID_STRING ("File name provided is invalid or of zero length") |
+const util::String | awsiotsdk::ResponseHelper::MUTEX_INIT_ERROR_STRING ("Error occurred while initializing the mutex") |
+const util::String | awsiotsdk::ResponseHelper::MUTEX_LOCK_ERROR_STRING ("Error occurred while locking the mutex") |
+const util::String | awsiotsdk::ResponseHelper::MUTEX_UNLOCK_ERROR_STRING ("Error occurred while unlocking the mutex") |
+const util::String | awsiotsdk::ResponseHelper::MUTEX_DESTROY_ERROR_STRING ("Error occurred while destroying the mutex") |
+const util::String | awsiotsdk::ResponseHelper::THREAD_EXITING_STRING ("Thread is exiting") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_TCP_CONNECT_ERROR_STRING ("TCP Error occurred while opening a socket") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_TCP_SETUP_ERROR_STRING ("Error occurred while setting up the TCP socket") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_TCP_UNKNOWN_HOST_STRING ("Unable to find host specified") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_TCP_NO_ENDPOINT_SPECIFIED_STRING ("No endpoint specified") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_INIT_ERROR_STRING ("Error occurred while initializing SSL") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_ROOT_CRT_PARSE_ERROR_STRING ("Error occurred while parsing the root CRT") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_DEVICE_CRT_PARSE_ERROR_STRING ("Error occurred while parsing the device CRT") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_KEY_PARSE_ERROR_STRING ("Error occurred while parsing the private key") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_TLS_HANDSHAKE_ERROR_STRING ("Error occurred while performing the TLS handshake") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_CONNECT_ERROR_STRING ("Error occurred during the connect attempt") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_CONNECT_TIMEOUT_ERROR_STRING ("The connect attempt timed out") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_CONNECTION_CLOSED_ERROR_STRING ("The SSL connection was closed") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_WRITE_ERROR_STRING ("Error occurred during the SSL write operation") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_WRITE_TIMEOUT_ERROR_STRING ("The SSL write operation timed out") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_READ_ERROR_STRING ("Error occurred during the SSL read operation") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_READ_TIMEOUT_ERROR_STRING ("The SSL read operation timed out") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_NOTHING_TO_READ_STRING ("No SSL packets received") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_UNKNOWN_ERROR_STRING ("Unknown error occurred during an SSL operation") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_SSL_SERVER_VERIFICATION_ERROR_STRING ("Unable to verify server name") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_DISCONNECTED_ERROR_STRING ("Network is disconnected") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_RECONNECT_TIMED_OUT_ERROR_STRING ("Reconnect operation time out") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_ALREADY_CONNECTED_ERROR_STRING ("Network is already connected") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_PHYSICAL_LAYER_DISCONNECTED_STRING ("Physical network layer is disconnected") |
+const util::String | awsiotsdk::ResponseHelper::NETWORK_NOTHING_TO_WRITE_ERROR_STRING ("No packets to write to the network") |
+const util::String | awsiotsdk::ResponseHelper::ACTION_NOT_REGISTERED_ERROR_STRING ("The action attempted is not registered with the client") |
+const util::String | awsiotsdk::ResponseHelper::ACTION_QUEUE_FULL_STRING ("The client action queue is full") |
+const util::String | awsiotsdk::ResponseHelper::ACTION_CREATE_FAILED_STRING ("The client was unable to create the action") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNECTION_ERROR_STRING ("Unable to establish the MQTT connection") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNECT_TIMEOUT_ERROR_STRING ("The MQTT connect operation timed out") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_REQUEST_TIMEOUT_ERROR_STRING ("The MQTT request timed out") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_UNEXPECTED_CLIENT_STATE_ERROR_STRING ("The MQTT client is in an unexpected state") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CLIENT_NOT_IDLE_ERROR_STRING ("The MQTT client is not idle") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR_STRING ("The MQTT message is of an invalid type") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_MAX_SUBSCRIPTIONS_REACHED_ERROR_STRING ("Reached maximum MQTT subscriptions") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_DECODE_REMAINING_LENGTH_ERROR_STRING ("Error occurred while decoding the remaining length of the MQTT message") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_UNKNOWN_ERROR_STRING ("MQTT connect request failed with server returning an unknown error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR_STRING ("MQTT connect request failed with server returning an unacceptable protocol error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_IDENTIFIER_REJECTED_ERROR_STRING ("MQTT connect request failed with server returning an identifier rejected error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_SERVER_UNAVAILABLE_ERROR_STRING ("MQTT connect request failed with server returning an unavailable error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_BAD_USERDATA_ERROR_STRING ("MQTT connect request failed with server returning a bad userdata error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_CONNACK_NOT_AUTHORIZED_ERROR_STRING ("MQTT connect request failed with server returning a not authorized error") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_NO_SUBSCRIPTION_FOUND_STRING ("No MQTT subscriptions were found for the requested topic") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_SUBSCRIPTION_NOT_ACTIVE_STRING ("The MQTT subscription specified is not active") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_UNEXPECTED_PACKET_FORMAT_ERROR_STRING ("Unable to serialize the MQTT packet as the format is unexpected") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_TOO_MANY_SUBSCRIPTIONS_IN_REQUEST_STRING ("Too many subscriptions were provided in the MQTT subscribe/unsubscribe request") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_INVALID_DATA_ERROR_STRING ("Invalid/Insufficient data was provided in the MQTT request") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_SUBSCRIBE_PARTIALLY_FAILED_STRING ("Failed to subscribe to atleast one of the topics in the subscribe request") |
+const util::String | awsiotsdk::ResponseHelper::MQTT_SUBSCRIBE_FAILED_STRING ("Failed to subscribe to any of the topics in the subscribe request") |
+const util::String | awsiotsdk::ResponseHelper::JSON_PARSE_KEY_NOT_FOUND_ERROR_STRING ("Unable to find the requested key in the JSON") |
+const util::String | awsiotsdk::ResponseHelper::JSON_PARSE_KEY_UNEXPECTED_TYPE_ERROR_STRING ("The value for the JSON key was of an unexpected type") |
+const util::String | awsiotsdk::ResponseHelper::JSON_PARSING_ERROR_STRING ("Error occurred while parsing the JSON") |
+const util::String | awsiotsdk::ResponseHelper::JSON_MERGE_FAILED_STRING ("Failed to merge the JSON") |
+const util::String | awsiotsdk::ResponseHelper::JSON_DIFF_FAILED_STRING ("Failed to diff the JSON") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_WAIT_FOR_PUBLISH_STRING ("Waiting for previously published shadow updates") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_JSON_BUFFER_TRUNCATED_STRING ("Shadow JSON is truncated as size specified is less than the size of the JSON") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_JSON_ERROR_STRING ("Encoding error occurred while printing the shadow JSON") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_JSON_EMPTY_ERROR_STRING ("The shadow JSON is empty") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_REQUEST_MAP_EMPTY_STRING ("The shadow request map is empty ") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_MQTT_DISCONNECTED_ERROR_STRING ("The shadow's MQTT connection is inactive") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_UNEXPECTED_RESPONSE_TYPE_STRING ("The shadow response received is of an unexpected type") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_UNEXPECTED_RESPONSE_TOPIC_STRING ("The shadow response was received on an unexpected topic") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_REQUEST_REJECTED_STRING ("The shadow request was rejected by the server") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_MQTT_CLIENT_NOT_SET_ERROR_STRING ("There is no client set for this shadow") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_NOTHING_TO_UPDATE_STRING ("There are no shadow updates to be performed") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_UNEXPECTED_RESPONSE_PAYLOAD_STRING ("The shadow response is in an unexpected format") |
+const util::String | awsiotsdk::ResponseHelper::SHADOW_RECEIVED_OLD_VERSION_UPDATE_STRING ("The received shadow version is older than the current one on the device") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_SIGN_URL_NO_MEM_STRING ("Internal buffer overflowed while signing WebSocket URL") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_GEN_CLIENT_KEY_ERROR_STRING ("Error occurred while generating WebSocket handshake client key") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_HANDSHAKE_ERROR_STRING ("Unable to complete WebSocket handshake") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_HANDSHAKE_WRITE_STRING ("Unable to transmit WebSocket handshake request") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_HANDSHAKE_READ_STRING ("Unable to receive WebSocket handshake request") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_HANDSHAKE_VERIFY_ERROR_STRING ("Unable to verify handshake response from the server") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_WSLAY_CONTEXT_INIT_ERROR_STRING ("Erro occurred while initializing the WebSocket WSLay context") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_FRAME_RECEIVE_ERROR_STRING ("Error occurred while receiving WebSocket frame") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_FRAME_TRANSMIT_ERROR_STRING ("Error occurred while transmitting WebSocket frame") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_PROTOCOL_VIOLATION_STRING ("Protocol violation was detected in the received WebSocket frames") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_MAX_LIFETIME_REACHED_STRING ("Max lifetime of the WebSocket connection was reached") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_DISCONNECT_ERROR_STRING ("Error occurred while disconnecting the WebSocket") |
+const util::String | awsiotsdk::ResponseHelper::WEBSOCKET_GET_UTC_TIME_FAILED_STRING ("WebSocket wrapper is unable to get the UTC ") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_REQUEST_FAILED_ERROR_STRING ("Unable to perform the discover action") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_REQUEST_TIMED_OUT_ERROR_STRING ("The discover action request timed out") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_UNAUTHORIZED_STRING ("The device was unauthorized to perform the discovery action") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_SERVER_ERROR_STRING ("Server returned unknown error while performing the discovery action") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_ACTION_REQUEST_OVERLOAD_STRING ("The discovery action is overloading the server, try again after some time") |
+const util::String | awsiotsdk::ResponseHelper::DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR_STRING ("The discover response JSON is incomplete ") |
+const util::String | awsiotsdk::ResponseHelper::JOBS_INVALID_TOPIC_ERROR_STRING ("Invalid jobs topic") |
util::String | awsiotsdk::ResponseHelper::ToString (ResponseCode rc) |
Contains the return codes used by the SDK and helper functions to convert the ResponseCode into human readable strings
+
+
|
+ +strong | +
Strongly typed enumeration of return values from functions within the SDK. Values less than -1 are specific error codes Value of -1 is a generic failure response Value of 0 is a generic success response Values greater than 0 are specific non-error return codes Values have been grouped based on source or type of code
+Enumerator | |
---|---|
DISCOVER_ACTION_NO_INFORMATION_PRESENT | Discover Action response showed no discovery information is present for this thing name. + |
DISCOVER_ACTION_SUCCESS | Discover Action found connectivity information for this thing name. + |
SHADOW_RECEIVED_DELTA | Returned when a delta update is received. + |
SHADOW_REQUEST_ACCEPTED | Returned when the request has been accepted. + |
NETWORK_PHYSICAL_LAYER_CONNECTED | Returned when the Network physical layer is connected. + |
NETWORK_MANUALLY_DISCONNECTED | Returned when the Network is manually disconnected. + |
NETWORK_ATTEMPTING_RECONNECT | Returned when the Network is disconnected and the reconnect attempt is in progress. + |
NETWORK_RECONNECTED | Return value of yield function to indicate auto-reconnect was successful. + |
MQTT_NOTHING_TO_READ | Returned when a read attempt is made on the TLS buffer and it is empty. + |
MQTT_CONNACK_CONNECTION_ACCEPTED | Returned when a connection request is successful and packet response is connection accepted. + |
SUCCESS | Success return value - no error occurred. + |
FAILURE | A generic error. Not enough information for a specific error code. + |
NULL_VALUE_ERROR | A required parameter was passed as null. + |
FILE_OPEN_ERROR | Unable to open the requested file. + |
FILE_NAME_INVALID | File name is invalid or of zero length. + |
MUTEX_INIT_ERROR | Mutex initialization failed. + |
MUTEX_LOCK_ERROR | Mutex lock request failed. + |
MUTEX_UNLOCK_ERROR | Mutex unlock request failed. + |
MUTEX_DESTROY_ERROR | Mutex destroy failed. + |
THREAD_EXITING | Thread is exiting, returned when thread exits in the middle of an operation. + |
NETWORK_TCP_CONNECT_ERROR | The TCP socket could not be established. + |
NETWORK_TCP_SETUP_ERROR | Error associated with setting up the parameters of a Socket. + |
NETWORK_TCP_UNKNOWN_HOST | Returned when the server is unknown. + |
NETWORK_TCP_NO_ENDPOINT_SPECIFIED | Returned when the Network connection was not provided an endpoint. + |
NETWORK_SSL_INIT_ERROR | SSL initialization error at the TLS layer. + |
NETWORK_SSL_ROOT_CRT_PARSE_ERROR | Returned when the root certificate is invalid. + |
NETWORK_SSL_DEVICE_CRT_PARSE_ERROR | Returned when the device certificate is invalid. + |
NETWORK_SSL_KEY_PARSE_ERROR | An error occurred when loading the certificates. The certificates could not be located or are incorrectly formatted. + |
NETWORK_SSL_TLS_HANDSHAKE_ERROR | The TLS handshake failed due to unknown error. + |
NETWORK_SSL_CONNECT_ERROR | An unknown occurred while waiting for the TLS handshake to complete. + |
NETWORK_SSL_CONNECT_TIMEOUT_ERROR | A timeout occurred while waiting for the TLS handshake to complete. + |
NETWORK_SSL_CONNECTION_CLOSED_ERROR | The SSL Connection was closed. + |
NETWORK_SSL_WRITE_ERROR | A Generic write error based on the platform used. + |
NETWORK_SSL_WRITE_TIMEOUT_ERROR | SSL Write times out. + |
NETWORK_SSL_READ_ERROR | A Generic error based on the platform used.nerator seeding failed. + |
NETWORK_SSL_READ_TIMEOUT_ERROR | SSL Read times out. + |
NETWORK_SSL_NOTHING_TO_READ | Returned when there is nothing to read in the TLS read buffer. + |
NETWORK_SSL_UNKNOWN_ERROR | A generic error code for Network SSL layer errors. + |
NETWORK_SSL_SERVER_VERIFICATION_ERROR | Server name verification failure. + |
NETWORK_DISCONNECTED_ERROR | Returned when the Network is disconnected and reconnect is either disabled or physical layer is disconnected. + |
NETWORK_RECONNECT_TIMED_OUT_ERROR | Returned when the Network is disconnected and the reconnect attempt has timed out. + |
NETWORK_ALREADY_CONNECTED_ERROR | Returned when the Network is already connected and a connection attempt is made. + |
NETWORK_PHYSICAL_LAYER_DISCONNECTED | Returned when the physical layer is disconnected. + |
NETWORK_NOTHING_TO_WRITE_ERROR | Returned when the Network write function is passed an empty buffer as argument. + |
ACTION_NOT_REGISTERED_ERROR | Requested action is not registered with the core client. + |
ACTION_QUEUE_FULL | Core Client Action queue is full. + |
ACTION_CREATE_FAILED | Core Client was not able to create the requested action. + |
MQTT_CONNECTION_ERROR | A connection could not be established. + |
MQTT_CONNECT_TIMEOUT_ERROR | A timeout occurred while waiting for the MQTT connect to complete. + |
MQTT_REQUEST_TIMEOUT_ERROR | A timeout occurred while waiting for the TLS request to complete. + |
MQTT_UNEXPECTED_CLIENT_STATE_ERROR | The current client state does not match the expected value. + |
MQTT_CLIENT_NOT_IDLE_ERROR | The client state is not idle when request is being made. + |
MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR | The MQTT RX buffer received corrupt or unexpected message. + |
MQTT_MAX_SUBSCRIPTIONS_REACHED_ERROR | The client is subscribed to the maximum possible number of subscriptions. + |
MQTT_DECODE_REMAINING_LENGTH_ERROR | Failed to decode the remaining packet length on incoming packet. + |
MQTT_CONNACK_UNKNOWN_ERROR | Connect request failed with the server returning an unknown error. + |
MQTT_CONNACK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR | Connect request failed with the server returning an unacceptable protocol version error. + |
MQTT_CONNACK_IDENTIFIER_REJECTED_ERROR | Connect request failed with the server returning an identifier rejected error. + |
MQTT_CONNACK_SERVER_UNAVAILABLE_ERROR | Connect request failed with the server returning an unavailable error. + |
MQTT_CONNACK_BAD_USERDATA_ERROR | Connect request failed with the server returning a bad userdata error. + |
MQTT_CONNACK_NOT_AUTHORIZED_ERROR | Connect request failed with the server failing to authenticate the request. + |
MQTT_NO_SUBSCRIPTION_FOUND | No subscription exists for requested topic. + |
MQTT_SUBSCRIPTION_NOT_ACTIVE | Subscription exists but is not active, waiting for Suback or Ack not received. + |
MQTT_UNEXPECTED_PACKET_FORMAT_ERROR | Deserialization failed because packet data was in an unexpected format. + |
MQTT_TOO_MANY_SUBSCRIPTIONS_IN_REQUEST | Too many subscriptions were provided in the Subscribe/Unsubscribe request. + |
MQTT_INVALID_DATA_ERROR | Provided data is invalid/not sufficient for the request. + |
MQTT_SUBSCRIBE_PARTIALLY_FAILED | Failed to subscribe to atleast one of the topics in the subscribe request. + |
MQTT_SUBSCRIBE_FAILED | Unable to subscribe to any of the topics in the subscribe request. + |
JSON_PARSE_KEY_NOT_FOUND_ERROR | JSON Parser was not able to find the requested key in the specified JSON. + |
JSON_PARSE_KEY_UNEXPECTED_TYPE_ERROR | The value type was different from the expected type. + |
JSON_PARSING_ERROR | An error occurred while parsing the JSON string. Usually malformed JSON. + |
JSON_MERGE_FAILED | Returned when the JSON merge request fails unexpectedly. + |
JSON_DIFF_FAILED | Returned when the JSON diff request fails unexpectedly. + |
SHADOW_WAIT_FOR_PUBLISH | Shadow: The response Ack table is currently full waiting for previously published updates. + |
SHADOW_JSON_BUFFER_TRUNCATED | Any time an snprintf writes more than size value, this error will be returned. + |
SHADOW_JSON_ERROR | Any time an snprintf encounters an encoding error or not enough space in the given buffer. + |
SHADOW_JSON_EMPTY_ERROR | Returned when the provided json document is empty. + |
SHADOW_REQUEST_MAP_EMPTY | Returned when the provided request map is empty. + |
SHADOW_MQTT_DISCONNECTED_ERROR | Returned when the MQTT connection is not active. + |
SHADOW_UNEXPECTED_RESPONSE_TYPE | Returned when the Response type in the recevied payload is unexpected. + |
SHADOW_UNEXPECTED_RESPONSE_TOPIC | Returned when Response is received on an unexpected topic. + |
SHADOW_REQUEST_REJECTED | Returned when the request has been rejected by the server. + |
SHADOW_MQTT_CLIENT_NOT_SET_ERROR | Returned when there is no client set for this shadow. + |
SHADOW_NOTHING_TO_UPDATE | Returned when there is nothing to update for a Shadow Update request. + |
SHADOW_UNEXPECTED_RESPONSE_PAYLOAD | Returned when the response payload is in an unexpected format. + |
SHADOW_RECEIVED_OLD_VERSION_UPDATE | Returned when a version update is received with an older version than the current one on the device. + |
WEBSOCKET_SIGN_URL_NO_MEM | Internal buffer overflow when signing secured WebSocket url. + |
WEBSOCKET_GEN_CLIENT_KEY_ERROR | Error in generating WebSocket handhshake client key. + |
WEBSOCKET_HANDSHAKE_ERROR | WebSocket handshake generic error. + |
WEBSOCKET_HANDSHAKE_WRITE | WebSocket handshake error in sending request. + |
WEBSOCKET_HANDSHAKE_READ | WebSocket handhshake error in receiving request. + |
WEBSOCKET_HANDSHAKE_VERIFY_ERROR | WebSocket handshake error in verifying server response. + |
WEBSOCKET_WSLAY_CONTEXT_INIT_ERROR | WebSocket wslay context init error. + |
WEBSOCKET_FRAME_RECEIVE_ERROR | WebSocket error in receiving frames. + |
WEBSOCKET_FRAME_TRANSMIT_ERROR | WebSocket error in sending frames. + |
WEBSOCKET_PROTOCOL_VIOLATION | WebSocket protocol violation detected in receiving frames. + |
WEBSOCKET_MAX_LIFETIME_REACHED | WebSocket connection max life time window reached. + |
WEBSOCKET_DISCONNECT_ERROR | WebSocket disconnect error. + |
WEBSOCKET_GET_UTC_TIME_FAILED | Returned when the WebSocket wrapper cannot get UTC time. + |
DISCOVER_ACTION_REQUEST_FAILED_ERROR | Discover Action request failed. + |
DISCOVER_ACTION_REQUEST_TIMED_OUT_ERROR | Discover Action request timed out. + |
DISCOVER_ACTION_UNAUTHORIZED | Discover Action repsonse showed that this device does not have authorization to query the server. + |
DISCOVER_ACTION_SERVER_ERROR | Discover Action failed due to some server side error. + |
DISCOVER_ACTION_REQUEST_OVERLOAD | Discover Action failed due to too many requests, try again after some time. + |
DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR | Discover Response Json is missing expected keys. + |
JOBS_INVALID_TOPIC_ERROR | Jobs invalid topic. + |
std::ostream & awsiotsdk::operator<< | +( | +std::ostream & | +os, | +
+ | + | ResponseCode | +rc | +
+ | ) | ++ |
Overloading the << stream operator for ResponseCode
+os | ostream being filled |
rc | ResponseCode |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Macros | |
+#define | SUBSCRIPTION_SETTING_TIME_SECS 2 |
+#define | SHADOW_REQUEST_TYPE_GET_STRING "get" |
+#define | SHADOW_REQUEST_TYPE_UPDATE_STRING "update" |
+#define | SHADOW_REQUEST_TYPE_DELETE_STRING "delete" |
+#define | SHADOW_REQUEST_TYPE_DELTA_STRING "delta" |
+#define | SHADOW_RESPONSE_TYPE_ACCEPTED_STRING "accepted" |
+#define | SHADOW_RESPONSE_TYPE_REJECTED_STRING "rejected" |
+#define | SHADOW_RESPONSE_TYPE_DELTA_STRING "delta" |
+#define | SHADOW_TOPIC_PREFIX "$aws/things/" |
+#define | SHADOW_TOPIC_MIDDLE "/shadow/" |
#define | SHADOW_DOCUMENT_EMPTY_STRING |
+#define | SHADOW_DOCUMENT_STATE_KEY "state" |
+#define | SHADOW_DOCUMENT_REPORTED_KEY "reported" |
+#define | SHADOW_DOCUMENT_DESIRED_KEY "desired" |
+#define | SHADOW_DOCUMENT_CLIENT_TOKEN_KEY "clientToken" |
+#define | SHADOW_DOCUMENT_VERSION_KEY "version" |
+#define | SHADOW_DOCUMENT_TIMESTAMP_KEY "timestamp" |
+#define | SHADOW_LOG_TAG "[Shadow]" |
#define SHADOW_DOCUMENT_EMPTY_STRING | +
+ AWS IoT C++ SDK
+
+ |
+
This file defines a shadow type for AWS IoT Shadow operations. +More...
+#include <memory>
#include <chrono>
#include <mutex>
#include <atomic>
#include "util/memory/stl/String.hpp"
#include "util/memory/stl/Vector.hpp"
#include "util/JsonParser.hpp"
#include "mqtt/Client.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::Shadow |
Define a type for Shadow. More... | |
+Enumerations | |
enum class | awsiotsdk::ShadowRequestType { Get = 0x01 +, Update = 0x02 +, Delete = 0x04 +, Delta = 0x08 + } |
Define a type for Shadow Requests. More... | |
enum class | awsiotsdk::ShadowResponseType { Rejected = 0 +, Accepted = 1 +, Delta = 2 + } |
Define a type for Shadow Responses. | |
This file defines a shadow type for AWS IoT Shadow operations. It also defines related types ShadowRequestType, ShadowResponseType and a shadow response handler
+
+
|
+ +strong | +
Documents type is not currently supported
+ +
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include <functional>
#include <string>
Go to the source code of this file.
++Typedefs | |
+using | awsiotsdk::util::String = std::basic_string< char, std::char_traits< char > > |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include <sstream>
Go to the source code of this file.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client. +More...
+#include "util/logging/LogMacros.hpp"
#include "util/memory/stl/Vector.hpp"
#include "mqtt/ClientState.hpp"
#include "mqtt/Subscribe.hpp"
Defines classes for perform MQTT Subscribe and Unsubscribe Actions in Async mode for the IoT Client. Also defines the packet types used by these actions as well as the related Ack packet types.
+
+ AWS IoT C++ SDK
+
+ |
+
MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client. +More...
+#include "util/Utf8String.hpp"
#include "util/memory/stl/Map.hpp"
#include "util/memory/stl/Vector.hpp"
#include "mqtt/Packet.hpp"
#include "mqtt/Publish.hpp"
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::mqtt::SubscribePacket |
Define a class for Subscribe Packet type. More... | |
class | awsiotsdk::mqtt::SubackPacket |
Define a class for Suback Packet type. More... | |
class | awsiotsdk::mqtt::UnsubscribePacket |
Define a class for Unsubscribe Packet type. More... | |
class | awsiotsdk::mqtt::UnsubackPacket |
Define a class for Unsuback Packet type. More... | |
class | awsiotsdk::mqtt::SubscribeActionAsync |
Define a class for SubscribeActionAsync. More... | |
class | awsiotsdk::mqtt::UnsubscribeActionAsync |
Define a class for UnsubscribeActionAsync. More... | |
Defines classes for perform MQTT Subscribe and Unsubscribe Actions in Async mode for the IoT Client. Also defines the packet types used by these actions as well as the related Ack packet types.
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include <rapidjson/encodings.h>
#include <rapidjson/stream.h>
#include <rapidjson/stringbuffer.h>
#include "util/Utf8String.hpp"
+Macros | |
+#define | UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;} |
+Typedefs | |
+typedef unsigned char | awsiotsdk::utf8::uint8_t |
+typedef unsigned short | awsiotsdk::utf8::uint16_t |
+typedef unsigned int | awsiotsdk::utf8::uint32_t |
+Enumerations | |
enum | utf_error { + UTF8_OK +, NOT_ENOUGH_ROOM +, INVALID_LEAD +, INCOMPLETE_SEQUENCE +, + OVERLONG_SEQUENCE +, INVALID_CODE_POINT + + } |
+ AWS IoT C++ SDK
+
+ |
+
Go to the source code of this file.
++Data Structures | |
class | awsiotsdk::Utf8String |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
#include "util/Core_EXPORTS.hpp"
#include <vector>
Go to the source code of this file.
++Typedefs | |
+template<typename T > | |
using | awsiotsdk::util::Vector = std::vector< T > |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
▼Nawsiotsdk | |
▼Ndiscovery | |
CDiscoverAction | Define a class for DiscoverAction |
CDiscoverRequestData | Discover Request Packet Type |
▼Nmqtt | |
CClientState | |
CConnectActionAsync | Define a class for ConnectActionAsync |
CConnectPacket | Connect Packet Type |
CDisconnectActionAsync | Define a class for DisconnectActionAsync |
CDisconnectPacket | Disconnect Packet Type |
CKeepaliveActionRunner | Define a class for KeepaliveActionRunner |
CNetworkReadActionRunner | Define a class for NetworkReadActionRunner |
CPacket | Define a base class for all MQTT Packet types |
CPacketFixedHeader | Define a class for the MQTT Fixed header |
CPingreqPacket | |
CPubackActionAsync | Define a class for PubackActionAsync |
CPubackPacket | Define a class for Puback Packet type |
CPublishActionAsync | Define a class for PublishActionAsync |
CPublishPacket | Publish Message Packet Type |
CSubackPacket | Define a class for Suback Packet type |
CSubscribeActionAsync | Define a class for SubscribeActionAsync |
CSubscribePacket | Define a class for Subscribe Packet type |
CSubscription | MQTT Subscription Definition |
CSubscriptionHandlerContextData | MQTT Subscription Handler Context Data |
CUnsubackPacket | Define a class for Unsuback Packet type |
CUnsubscribeActionAsync | Define a class for UnsubscribeActionAsync |
CUnsubscribePacket | Define a class for Unsubscribe Packet type |
CWillOptions | Last Will and Testament Definition |
▼Nutil | |
▼NLogging | |
CConsoleLogSystem | |
CFormattedLogSystem | |
CLogSystemInterface | |
▼NThreading | |
CThreadTask | |
CJsonParser | |
CAction | Action Class |
CActionData | Action Data Class |
CActionState | Action State Class |
CClientCore | Client Core Class |
▼CClientCoreState | Client Core State Class |
CPendingAckData | Pending Ack Data Class |
CConfigCommon | |
CConnectivityInfo | |
CDisconnectCallbackContextData | MQTT Disconnect Callback Context Data |
CDiscoveryResponse | |
CGreengrassMqttClient | MQTT Client Class |
CJobs | |
CMqttClient | MQTT Client Class |
CNetworkConnection | Network Connection Class |
CReconnectCallbackContextData | MQTT Reconnect Callback Context Data |
CResubscribeCallbackContextData | MQTT Resubscribe Callback Context Data |
CShadow | Define a type for Shadow |
CUtf8String |
+ AWS IoT C++ SDK
+
+ |
+
#include <Action.hpp>
+Public Types | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
+Public Member Functions | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Protected Member Functions | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
+Protected Attributes | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
Defines a base class for SDK Actions. Provides basic template for concrete implementations. Also includes code for Thread sync with client core. All Actions that can be performed by the Client Core must inherit from this class. This is a pure virtual class and cannot be instantiated
+typedef std::function<std::unique_ptr<Action>(std::shared_ptr<ActionState> p_action_state)> awsiotsdk::Action::CreateHandlerPtr | +
Define a type for Create Factory method. Takes Action state as argument and returns a unique_ptr to a new action instance
+ +awsiotsdk::Action::Action | +( | +ActionType | +action_type, | +
+ | + | util::String | +action_info_string | +
+ | ) | ++ |
action_type | - Type fo the Action being instantiated |
action_info_string | - Info string describing the action |
+
|
+ +inline | +
Gets runtime information about the currently running Action if it was set when the action was created
+
+
|
+ +inline | +
+
|
+ +pure virtual | +
This function is called by Client Core and defines how the Action is Performed. This is a pure virtual function. Inherited classes MUST implement this.
+p_network_connection | - Network connection to be used to perform the Action |
p_action_data | - Action data to be used for this run of the action |
Implemented in awsiotsdk::discovery::DiscoverAction, awsiotsdk::mqtt::ConnectActionAsync, awsiotsdk::mqtt::DisconnectActionAsync, awsiotsdk::mqtt::KeepaliveActionRunner, awsiotsdk::mqtt::NetworkReadActionRunner, awsiotsdk::mqtt::PublishActionAsync, awsiotsdk::mqtt::PubackActionAsync, awsiotsdk::mqtt::SubscribeActionAsync, and awsiotsdk::mqtt::UnsubscribeActionAsync.
+ +
+
|
+ +protected | +
p_network_connection | - Network connection to be used to perform Read |
read_buf | - Buffer read data should be copied to. Assumed to already have enough memory reserved |
bytes_to_read | - Number of bytes to read |
+
|
+ +inline | +
p_thread_continue | - Pointer to the new sync variable to use |
+
|
+ +protected | +
p_network_connection | - Network connection to be used to perform Write |
read_buf | - Buffer containing data to be written to the network instance |
+ AWS IoT C++ SDK
+
+ |
+
#include <Action.hpp>
+Public Types | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
+Public Member Functions | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Data Fields | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
Defines an Action Data class which contains dynamic information to be used by the action Instance of concrete implementation of this class is passed as argument each time Perform Action is called This is a pure virtual class, cannot be instantiated
+typedef std::function<void(uint16_t action_id, ResponseCode rc)> awsiotsdk::ActionData::AsyncAckNotificationHandlerPtr | +
Define a type for the Async Ack notification handler Clients can provide an instance of this to receive notification on status of Async API calls
+ +
+
|
+ +pure virtual | +
Implemented in awsiotsdk::discovery::DiscoverRequestData, and awsiotsdk::mqtt::Packet.
+ +
+
|
+ +pure virtual | +
action_id | - new Action ID |
Implemented in awsiotsdk::discovery::DiscoverRequestData, and awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
#include <Action.hpp>
+Public Member Functions | |
virtual uint16_t | GetNextActionId ()=0 |
Get Action ID of the next Action. More... | |
+ | ActionState (const ActionState &)=delete |
+ | ActionState (ActionState &&)=delete |
+ActionState & | operator= (const ActionState &) &=delete |
+ActionState & | operator= (ActionState &&) &=delete |
Defines an Action State class which is retained by each Action for its lifetime This is a pure virtual class, cannot be instantiated
+
+
|
+ +pure virtual | +
Implemented in awsiotsdk::ClientCoreState, and awsiotsdk::mqtt::ClientState.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Client Core Class. + More...
+ +#include <ClientCore.hpp>
+Public Member Functions | |
+ | ClientCore (const ClientCore &)=delete |
+ | ClientCore (ClientCore &&)=delete |
+ClientCore & | operator= (const ClientCore &) &=delete |
+ClientCore & | operator= (ClientCore &&) &=delete |
void | SetProcessQueuedActions (bool process_queued_actions) |
Enable/Disable processing of queued actions. More... | |
ResponseCode | RegisterAction (ActionType action_type, Action::CreateHandlerPtr p_action_create_handler) |
Register Action for execution by Client Core. More... | |
ResponseCode | PerformAction (ActionType action_type, std::shared_ptr< ActionData > action_data, std::chrono::milliseconds action_reponse_timeout) |
Perform Action in Blocking Mode. More... | |
ResponseCode | PerformActionAsync (ActionType action_type, std::shared_ptr< ActionData > action_data, uint16_t &action_id_out) |
Perform Action in Asynchronous Mode. More... | |
ResponseCode | CreateActionRunner (ActionType action_type, std::shared_ptr< ActionData > action_data) |
Create Thread Task to execute request Action Type. More... | |
void | GracefulShutdownAllThreadTasks () |
Waits for all threads to complete their tasks and then clears them. More... | |
+Static Public Member Functions | |
static std::unique_ptr< ClientCore > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ClientCoreState > p_state) |
Factory method for creating a Client Core instance. More... | |
+Protected Member Functions | |
ClientCore (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ClientCoreState > p_state) | |
Constructor. More... | |
+Protected Attributes | |
+util::Map< ActionType, std::shared_ptr< util::Threading::ThreadTask > > | thread_map_ |
Map for storing currently active threads. | |
+std::shared_ptr< ClientCoreState > | p_client_core_state_ |
Client Core state instance. | |
Defining a class for the Core Client. This class is responsible for performing both Sync and Async actions It contains the action queue, an action registry and a map to keep track of running threads It also keeps track of the Common Action State as well as the Network connection
+
+
|
+ +protected | +
p_network_connection | - Network Connection instance to be passed as argument to actions |
p_state | - Client Core state instance |
+
|
+ +static | +
p_network_connection | - Network Connection instance to be passed as argument to actions |
p_state | - Client Core state instance |
ResponseCode awsiotsdk::ClientCore::CreateActionRunner | +( | +ActionType | +action_type, | +
+ | + | std::shared_ptr< ActionData > | +action_data | +
+ | ) | ++ |
This API will create a new instance of the Action Type that is request in the API call and call perform action on that instance in a new Thread Task. If the Action is Thread Aware, it will be executed until it finishes or the Thread Task is terminated (Usually on exit).
+action_type | - Type of the Action to be executed. Must be registered |
action_data | - Action Data to be passed as argument to the Action instance |
void awsiotsdk::ClientCore::GracefulShutdownAllThreadTasks | +( | +) | ++ |
This API will go through all the active Thread Tasks and waits for them to complete their respective tasks. The completed Thread Task is then cleared.
+ +ResponseCode awsiotsdk::ClientCore::PerformAction | +( | +ActionType | +action_type, | +
+ | + | std::shared_ptr< ActionData > | +action_data, | +
+ | + | std::chrono::milliseconds | +action_reponse_timeout | +
+ | ) | ++ |
This API will perform the Action in Blocking mode. The timeout for the action to give a valid response is provided as an argument. This API stops processing of all outbound actions until Response is received for the requested Action Type
+action_type | - Type of the Action to be executed. Must be registered |
action_data | - Action Data to be passed as argument to the Action instance |
action_reponse_timeout | - Timeout for this API call |
ResponseCode awsiotsdk::ClientCore::PerformActionAsync | +( | +ActionType | +action_type, | +
+ | + | std::shared_ptr< ActionData > | +action_data, | +
+ | + | uint16_t & | +action_id_out | +
+ | ) | ++ |
This API will enqueue the the Action to be performed Asynchronously. If an Async Ack Handler is provided in the Action data, and the Action expects to receive an Ack, the calling Action will be notified using Action ID and Response Code. This API returns Action ID as an out parameter
+action_type | - Type of the Action to be executed. Must be registered | |
action_data | - Action Data to be passed as argument to the Action instance | |
[out] | action_id_out | - Action ID assigned to this request |
ResponseCode awsiotsdk::ClientCore::RegisterAction | +( | +ActionType | +action_type, | +
+ | + | Action::CreateHandlerPtr | +p_action_create_handler | +
+ | ) | ++ |
This function allows Actions to be registered to be executed at a later stage by Client Core. Actions must be registered before PerformAction can be called using the Action Type. This also applies to Creating Action runners which allow running Actions in dedicated Thread Tasks. Only one Action can be registered to each Action Type. If a second call is made with the same Action Type, the previous registration will be overwritten
+action_type | - Type of the Action that will be creating using the provided handler |
p_action_create_handler | - Factory method pointer which returns an Action instance |
+
|
+ +inline | +
process_queued_actions | - boolean value indicating new state |
+ AWS IoT C++ SDK
+
+ |
+
Client Core State Class. + More...
+ +#include <ClientCoreState.hpp>
+Data Structures | |
class | PendingAckData |
Pending Ack Data Class. More... | |
+Public Types | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< DisconnectCallbackContextData > p_app_handler_data)> | ApplicationDisconnectCallbackPtr |
Define Handler for Disconnect Callbacks. More... | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< ReconnectCallbackContextData > p_app_handler_data, ResponseCode reconnect_result)> | ApplicationReconnectCallbackPtr |
Define Handler for Reconnect Callbacks. More... | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< ResubscribeCallbackContextData > p_app_handler_data, ResponseCode resubscribe_result)> | ApplicationResubscribeCallbackPtr |
Define Handler for Resubscribe Callbacks. More... | |
+Public Member Functions | |
virtual uint16_t | GetNextActionId () |
Overload for Get next Action ID. More... | |
size_t | GetMaxActionQueueSize () |
Get current value of maximum action queue size. More... | |
void | SetMaxActionQueueSize (size_t max_queue_size) |
Set max size for action queue. More... | |
std::shared_ptr< std::atomic_bool > | GetCoreExecutionSyncPoint () |
Get pointer to sync point used for execution status of the Core instance. More... | |
void | SetProcessQueuedActions (bool process_queued_actions) |
Sets whether the Client is allowed to process queue actions. More... | |
bool | CanProcessQueuedActions () |
Get whether the Client can process queued actions. More... | |
void | ProcessOutboundActionQueue (std::shared_ptr< std::atomic_bool > thread_task_out_sync) |
Process the outbound action queue. More... | |
ResponseCode | PerformAction (ActionType action_type, std::shared_ptr< ActionData > action_data, std::chrono::milliseconds action_reponse_timeout) |
Perform Action in Blocking Mode. More... | |
ResponseCode | RegisterAction (ActionType action_type, Action::CreateHandlerPtr p_action_create_handler, std::shared_ptr< ActionState > p_action_state) |
Register Action for execution by Client Core. More... | |
ResponseCode | GetActionCreateHandler (ActionType action_type, Action::CreateHandlerPtr *p_action_create_handler) |
Get the Create Factory Method for the specified action type. More... | |
ResponseCode | EnqueueOutboundAction (ActionType action_type, std::shared_ptr< ActionData > action_data, uint16_t &action_id_out) |
Enqueue Action for processing in Outbound Queue. More... | |
ResponseCode | RegisterPendingAck (uint16_t action_id, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler) |
Register Ack Handler for provided action id. More... | |
void | DeletePendingAck (uint16_t action_id) |
Delete Ack Handler for specified Action ID. More... | |
void | ForwardReceivedAck (uint16_t action_id, ResponseCode rc) |
Call registered Ack handler if it exists for specified Packet id. More... | |
void | DeleteExpiredAcks () |
Delete all expired Acks. More... | |
void | ClearRegisteredActions () |
Clears all registered Actions. More... | |
void | ClearOutboundActionQueue () |
Clears all pending outbound Actions. More... | |
+ | ClientCoreState () |
Default Constructor. | |
+virtual | ~ClientCoreState () |
Destructor. | |
+ | ClientCoreState (const ClientCoreState &)=delete |
+ | ClientCoreState (ClientCoreState &&)=delete |
+ClientCoreState & | operator= (const ClientCoreState &) &=delete |
+ClientCoreState & | operator= (ClientCoreState &&) &=delete |
![]() | |
virtual uint16_t | GetNextActionId ()=0 |
Get Action ID of the next Action. More... | |
+ | ActionState (const ActionState &)=delete |
+ | ActionState (ActionState &&)=delete |
+ActionState & | operator= (const ActionState &) &=delete |
+ActionState & | operator= (ActionState &&) &=delete |
+Data Fields | |
+ApplicationDisconnectCallbackPtr | disconnect_handler_ptr_ |
Pointer to the Application Disconnect Callback. | |
+std::shared_ptr< DisconnectCallbackContextData > | p_disconnect_app_handler_data_ |
Data to be passed to the Application Handler. | |
+ApplicationReconnectCallbackPtr | reconnect_handler_ptr_ |
Pointer to the Application Reconnect Callback. | |
+std::shared_ptr< ReconnectCallbackContextData > | p_reconnect_app_handler_data_ |
Data to be passed to the Application Handler. | |
+ApplicationResubscribeCallbackPtr | resubscribe_handler_ptr_ |
Pointer to the Application Resubscribe Callback. | |
+std::shared_ptr< ResubscribeCallbackContextData > | p_resubscribe_app_handler_data_ |
Data to be passed to the Application Handler. | |
+std::shared_ptr< NetworkConnection > | p_network_connection_ |
Network connection instance to use for this instance of the Client This is shared between Actions, public to avoid multiple shared pointer operations while passing as argument by ClientCore. | |
+Protected Member Functions | |
void | SyncActionHandler (uint16_t action_id, ResponseCode rc) |
Internal Action Handler for Sync Action responses. More... | |
+Protected Attributes | |
+std::atomic< uint16_t > | next_action_id_ |
Atomic, ID of the next Action that will be enqueued. | |
+std::atomic_int | cur_core_threads_ |
Atomic, Count of currently running core threads. | |
+std::atomic_int | max_hardware_threads_ |
Atomic, Count of the maximum allowed hardware threads. | |
+std::atomic_size_t | max_queue_size_ |
Atomic, Current configured max queue size. | |
+std::chrono::seconds | ack_timeout_ |
Timeout for pending Acks, older Acks are deleted with a failed response. | |
+std::mutex | register_action_lock_ |
Mutex for Register Action Request flow. | |
+std::mutex | ack_map_lock_ |
Mutex for Ack Map operations. | |
+std::mutex | sync_action_request_lock_ |
Mutex for Sync Action Request flow. | |
+std::mutex | sync_action_response_lock_ |
Mutex for Sync Action Response flow. | |
+std::condition_variable | sync_action_response_wait_ |
Condition variable used to wake up calling thread on Sync Action response. | |
+ResponseCode | sync_action_response_ |
Variable to store received Sync Action response. | |
+std::atomic_bool | process_queued_actions_ |
Atomic, indicates whether currently queued Actions should be processed or not. | |
+std::shared_ptr< std::atomic_bool > | continue_execution_ |
Atomic, Used to synchronize running threads, false value causes running threads to stop. | |
+util::Map< ActionType, std::unique_ptr< Action > > | action_map_ |
Map containing currently initialized Action Instances. | |
+util::Map< uint16_t, std::unique_ptr< PendingAckData > > | pending_ack_map_ |
Map containing currently pending Acks. | |
+util::Map< ActionType, Action::CreateHandlerPtr > | action_create_handler_map_ |
Map containing currently registered Action Types and corrosponding Factories. | |
+util::Queue< std::pair< ActionType, std::shared_ptr< ActionData > > > | outbound_action_queue_ |
Queue of outbound actions. | |
Defining a class for the Core Client State. This class is responsible for maintaing the state information for the core client It can also be extended to provide state information to Actions. It contains the action queue, an action registry and also keeps track of the Common Action State as well as the Network connection
+typedef std::function<ResponseCode(util::String mqtt_client_id, std::shared_ptr<DisconnectCallbackContextData> p_app_handler_data)> awsiotsdk::ClientCoreState::ApplicationDisconnectCallbackPtr | +
This handler is used to provide notification to the application when a disconnect occurs NOTE: This handler should be NON-BLOCKING
+ +typedef std::function<ResponseCode(util::String mqtt_client_id, std::shared_ptr<ReconnectCallbackContextData> p_app_handler_data, ResponseCode reconnect_result)> awsiotsdk::ClientCoreState::ApplicationReconnectCallbackPtr | +
This handler is used to provide notification to the application when a reconnect occurs NOTE: This handler should be NON-BLOCKING
+ +typedef std::function<ResponseCode(util::String mqtt_client_id, std::shared_ptr<ResubscribeCallbackContextData> p_app_handler_data, ResponseCode resubscribe_result)> awsiotsdk::ClientCoreState::ApplicationResubscribeCallbackPtr | +
This handler is used to provide notification to the application when a resubscribe occurs. NOTE: This handler should be NON-BLOCKING
+ +
+
|
+ +inline | +
void awsiotsdk::ClientCoreState::ClearOutboundActionQueue | +( | +) | ++ |
Utility method to remove all pending outbound actions registered by the client. Also helps in breaking out of cyclic reference introduced when EnqueueOutboundAction is called.
+ +void awsiotsdk::ClientCoreState::ClearRegisteredActions | +( | +) | ++ |
Utility method to remove all registered actions by the client. Also helps in breaking out of cyclic reference introduced when RegisterAction is called.
+ +void awsiotsdk::ClientCoreState::DeleteExpiredAcks | +( | +) | ++ |
Deletes all Acks where the timeouts have expired. Responds with Code indicating request timeout
+ +void awsiotsdk::ClientCoreState::DeletePendingAck | +( | +uint16_t | +action_id | ) | ++ |
action_id | - Action ID |
ResponseCode awsiotsdk::ClientCoreState::EnqueueOutboundAction | +( | +ActionType | +action_type, | +
+ | + | std::shared_ptr< ActionData > | +action_data, | +
+ | + | uint16_t & | +action_id_out | +
+ | ) | ++ |
void awsiotsdk::ClientCoreState::ForwardReceivedAck | +( | +uint16_t | +action_id, | +
+ | + | ResponseCode | +rc | +
+ | ) | ++ |
action_id | - Action ID |
rc | - Response Code to pass to the Handler if found |
ResponseCode awsiotsdk::ClientCoreState::GetActionCreateHandler | +( | +ActionType | +action_type, | +
+ | + | Action::CreateHandlerPtr * | +p_action_create_handler | +
+ | ) | ++ |
+
|
+ +inline | +
This sync point is used to indicate SDK is still continuing execution. Set to false when exiting
+
+
|
+ +inline | +
+
|
+ +inlinevirtual | +
Implements awsiotsdk::ActionState.
+ +Reimplemented in awsiotsdk::mqtt::ClientState.
+ +ResponseCode awsiotsdk::ClientCoreState::PerformAction | +( | +ActionType | +action_type, | +
+ | + | std::shared_ptr< ActionData > | +action_data, | +
+ | + | std::chrono::milliseconds | +action_reponse_timeout | +
+ | ) | ++ |
This API will perform the Action in Blocking mode. The timeout for the action to give a valid response is provided as an argument. This API stops processing of all outbound actions until Response is received for the requested Action Type
+action_type | - Type of the Action to be executed. Must be registered |
action_data | - Action Data to be passed as argument to the Action instance |
action_reponse_timeout | - Timeout for this API call |
void awsiotsdk::ClientCoreState::ProcessOutboundActionQueue | +( | +std::shared_ptr< std::atomic_bool > | +thread_task_out_sync | ) | ++ |
This function processes the actions queued up in the Outbound action queue. The function accepts a Sync point that can be used to control execution in a separate thread. If the value is set to false for the sync point, the function will perform one action from the queue. This puts the running thread to sleep if there are no queued up actions. DO NOT call from main thread unless you have a separate thread to queue up actions
+thread_task_out_sync |
process_queued_actions_ ||
+ +ResponseCode awsiotsdk::ClientCoreState::RegisterAction | +( | +ActionType | +action_type, | +
+ | + | Action::CreateHandlerPtr | +p_action_create_handler, | +
+ | + | std::shared_ptr< ActionState > | +p_action_state | +
+ | ) | ++ |
This function allows Actions to be registered to be executed at a later stage by Client Core. Actions must be registered before PerformAction can be called using the Action Type. This also applies to Creating Action runners which allow running Actions in dedicated Thread Tasks. Only one Action can be registered to each Action Type. If a second call is made with the same Action Type, the previous registration will be overwritten
+action_type | - Type of the Action that will be created using the provided handler |
p_action_create_handler | - Factory method pointer which returns an Action instance |
p_action_state | - Shared_ptr to use as argument for Action create |
ResponseCode awsiotsdk::ClientCoreState::RegisterPendingAck | +( | +uint16_t | +action_id, | +
+ | + | ActionData::AsyncAckNotificationHandlerPtr | +p_async_ack_handler | +
+ | ) | ++ |
action_id | - Action ID |
p_async_ack_handler | - Handler to call on response |
+
|
+ +inline | +
size_t | max_queue_size |
+
|
+ +inline | +
process_queued_actions | value to set it to |
+
|
+ +protected | +
action_id | - ID of the Action that response was received for |
rc | - Received response |
+ AWS IoT C++ SDK
+
+ |
+
Pending Ack Data Class. + More...
+ +#include <ClientCoreState.hpp>
+Data Fields | |
+std::chrono::system_clock::time_point | time_of_request_ |
Time at which the request was sent. | |
+ActionData::AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to which response must be sent. | |
Defining an internal class for storing information about Pending Acks.
+
+ AWS IoT C++ SDK
+
+ |
+
+Static Public Member Functions | |
+static ResponseCode | InitializeCommon (const util::String &config_file_path) |
+static util::String | GetCurrentPath () |
+Static Protected Member Functions | |
+static void | LogParseError (const ResponseCode &response_code, const util::JsonDocument &config, util::String key) |
+Static Protected Attributes | |
+static util::JsonDocument | sdk_config_json_ |
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | ConnectivityInfo (const ConnectivityInfo &)=default |
+ | ConnectivityInfo (ConnectivityInfo &&)=default |
+ConnectivityInfo & | operator= (const ConnectivityInfo &) &=default |
+ConnectivityInfo & | operator= (ConnectivityInfo &&) &=default |
ConnectivityInfo (util::String group_name, util::String ggc_name, util::String id, util::String host_address, uint16_t port, util::String metadata) | |
Constructor. More... | |
+
|
+ +inline | +
group_name | - name of the group that the GGC belongs to |
ggc_name | - name of the GGC in the above thing group |
host_address | - host address of the GGC |
port | - port number of the GGC |
metadata | - user defined metadata string |
+ AWS IoT C++ SDK
+
+ |
+
MQTT Disconnect Callback Context Data. + More...
+ +#include <ClientCoreState.hpp>
This class can be used to provide customer context data to be provided with each disconnect callback. Uses a pure virtual destructor to allow for polymorphism
+
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | DiscoveryResponse (const DiscoveryResponse &)=delete |
+ | DiscoveryResponse (DiscoveryResponse &&)=delete |
+DiscoveryResponse & | operator= (const DiscoveryResponse &) &=delete |
+DiscoveryResponse & | operator= (DiscoveryResponse &&) &=delete |
DiscoveryResponse (util::JsonDocument response_document) | |
Constructor. More... | |
util::JsonDocument | GetResponseDocument () |
Return the full Discovery Response Json. More... | |
void | SetResponseDocument (util::JsonDocument response_document) |
Set the Discovery Response Json Document in the Discovery Response Object. More... | |
ResponseCode | GetParsedResponse (util::Vector< ConnectivityInfo > &connectivity_info_list, util::Map< util::String, util::Vector< util::String > > &root_ca_map) |
Get the parsed discovery response. More... | |
ResponseCode | WriteToPath (util::String output_file_absolute_path) |
Write the complete Discovery Response Json out to a file. More... | |
+Protected Attributes | |
+util::JsonDocument | response_document_ |
Json document that contains the complete Discovery Response. | |
awsiotsdk::DiscoveryResponse::DiscoveryResponse | +( | +util::JsonDocument | +response_document | ) | ++ |
response_document | - Json document containing full Discovery Response |
ResponseCode awsiotsdk::DiscoveryResponse::GetParsedResponse | +( | +util::Vector< ConnectivityInfo > & | +connectivity_info_list, | +
+ | + | util::Map< util::String, util::Vector< util::String > > & | +root_ca_map | +
+ | ) | ++ |
Get the parse vector of all the connectivity information present in the Discovery Response Json along with a map of all the root CAs that correspond the the groups present in the Discovery Response. Returns SUCCESS if parsed successfully or DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR if the Json structure cannot be parsed
+connectivity_info_list | - vector in which the connectivity information is stored |
root_ca_map | - mapping between groups and filenames of the root CAs |
util::JsonDocument awsiotsdk::DiscoveryResponse::GetResponseDocument | +( | +) | ++ |
void awsiotsdk::DiscoveryResponse::SetResponseDocument | +( | +util::JsonDocument | +response_document | ) | ++ |
response_document |
ResponseCode awsiotsdk::DiscoveryResponse::WriteToPath | +( | +util::String | +output_file_absolute_path | ) | ++ |
Function to write out the whole Discovery Response Json out to a file that can be consumed by other applications directly. Returns SUCCESS if it was able to write to the file correctly. Otherwise throws FILE_OPEN_ERROR if the file cannot be opened to write to it or FILE_NAME_INVALID if the file name passed in is invalid.
+output_file_absolute_path | - absolute file path to which the Json will be written out to |
+ AWS IoT C++ SDK
+
+ |
+
MQTT Client Class. + More...
+ +#include <GreengrassMqttClient.hpp>
+Public Member Functions | |
+ | GreengrassMqttClient (const GreengrassMqttClient &)=delete |
+ | GreengrassMqttClient (GreengrassMqttClient &&)=default |
+GreengrassMqttClient & | operator= (const GreengrassMqttClient &) &=delete |
+GreengrassMqttClient & | operator= (GreengrassMqttClient &&) &=default |
virtual ResponseCode | Discover (std::chrono::milliseconds action_reponse_timeout, std::unique_ptr< Utf8String > p_thing_name, DiscoveryResponse &discovery_response) |
Performs a Sync Discovery operation. More... | |
![]() | |
+ | MqttClient (const MqttClient &)=delete |
+ | MqttClient (MqttClient &&)=default |
+MqttClient & | operator= (const MqttClient &) &=delete |
+MqttClient & | operator= (MqttClient &&) &=default |
virtual ResponseCode | Connect (std::chrono::milliseconds action_response_timeout, bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg) |
Perform Sync Connect. More... | |
virtual ResponseCode | Connect (std::chrono::milliseconds action_response_timeout, bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg, bool is_metrics_enabled) |
Perform Sync Connect. More... | |
virtual ResponseCode | Disconnect (std::chrono::milliseconds action_response_timeout) |
Perform Sync Disconnect. More... | |
virtual ResponseCode | Publish (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, mqtt::QoS qos, const util::String &payload, std::chrono::milliseconds action_response_timeout) |
Perform Sync Publish. More... | |
virtual ResponseCode | Subscribe (util::Vector< std::shared_ptr< mqtt::Subscription > > subscription_list, std::chrono::milliseconds action_response_timeout) |
Perform Sync Subscribe. More... | |
virtual ResponseCode | Unsubscribe (util::Vector< std::unique_ptr< Utf8String > > topic_list, std::chrono::milliseconds action_response_timeout) |
Perform Sync Unsubscribe. More... | |
virtual ResponseCode | PublishAsync (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, mqtt::QoS qos, const util::String &payload, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Publish. More... | |
virtual ResponseCode | SubscribeAsync (util::Vector< std::shared_ptr< mqtt::Subscription > > subscription_list, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Subscribe. More... | |
virtual ResponseCode | UnsubscribeAsync (util::Vector< std::unique_ptr< Utf8String > > topic_list, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Unsubscribe. More... | |
virtual bool | IsConnected () |
Check if Client is in Connected state. More... | |
virtual void | SetAutoReconnectEnabled (bool value) |
Sets the auto-reconnect flag for the client. More... | |
virtual bool | IsAutoReconnectEnabled () |
returns the current state of the auto-reconnect flag More... | |
virtual std::chrono::seconds | GetMinReconnectBackoffTimeout () |
returns the minimum back-off time value More... | |
virtual void | SetMinReconnectBackoffTimeout (std::chrono::seconds min_reconnect_backoff_timeout) |
sets the minimum back-off time value More... | |
virtual std::chrono::seconds | GetMaxReconnectBackoffTimeout () |
returns the maximum back-off time value More... | |
virtual void | SetMaxReconnectBackoffTimeout (std::chrono::seconds max_reconnect_backoff_timeout) |
sets the maximum back-off time value More... | |
virtual ResponseCode | SetDisconnectCallbackPtr (ClientCoreState::ApplicationDisconnectCallbackPtr p_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_app_handler_data) |
Set the callback function for disconnects. More... | |
virtual ResponseCode | SetReconnectCallbackPtr (ClientCoreState::ApplicationReconnectCallbackPtr p_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_app_handler_data) |
Set the callback function for reconnects. More... | |
virtual ResponseCode | SetResubscribeCallbackPtr (ClientCoreState::ApplicationResubscribeCallbackPtr p_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_app_handler_data) |
Set the callback function for resubscribes. More... | |
+Static Public Member Functions | |
static std::unique_ptr< GreengrassMqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) |
Create factory method. Returns a unique instance of GreengrassMqttClient. More... | |
static std::unique_ptr< GreengrassMqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) |
Create factory method, with additional parameters for disconnect callback. More... | |
static std::unique_ptr< GreengrassMqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr resubscribe_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) |
Create factory method, with additional parameters for disconnect, reconnect and resubscribe callbacks. More... | |
![]() | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) |
Create factory method. Returns a unique instance of MqttClient. More... | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) |
Create factory method, with additional parameters for disconnect callback. More... | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr p_resubscribec_callback, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) |
Create factory method, with additional parameters for disconnect, reconnect and resubscribe callbacks. More... | |
+Protected Member Functions | |
GreengrassMqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr resubscribe_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) | |
Constructor. More... | |
GreengrassMqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) | |
Constructor. More... | |
GreengrassMqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) | |
Constructor. More... | |
![]() | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr resubscribe_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) | |
Constructor. More... | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) | |
Constructor. More... | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) | |
Constructor. More... | |
+Additional Inherited Members | |
![]() | |
+std::unique_ptr< ClientCore > | p_client_core_ |
Unique pointer to the Client Core instance. | |
+std::shared_ptr< mqtt::ClientState > | p_client_state_ |
MQTT Client state. | |
Defining a class for the MQTT Client. This class is a wrapper on the Core Client and creates a Client Core instance with MQTT Actions It also provides APIs to perform MQTT operations directly on the Core Client instance
+
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_disconnect_app_handler_data | - context data for the disconnect handler |
reconnect_callback_ptr | - pointer of the reconnect callback handler |
p_reconnect_app_handler_data | - context data for the reconnect handler |
resubscribe_callback_ptr | - pointer of the resubscribe callback handler |
p_resubscribe_app_handler_data | - context data for the resubscribe handler |
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr_ptr | - pointer of the disconnect callback handler |
p_disconnect_app_handler_data | - context data for the disconnect handler |
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_disconnect_app_handler_data | - context data for the disconnect handler |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_app_handler_data | - context data for the disconnect handler |
reconnect_callback_ptr | - pointer of the reconnect callback handler |
p_reconnect_app_handler_data | - context data for the reconnect handler |
resubscribe_callback_ptr | - pointer of the resubscribe callback handler |
p_resubscribe_app_handler_data | - context data for the resubscribe handler |
+
|
+ +virtual | +
Performs a blocking discovery operation to receive the connectivity information for the GGCs in the group this device belongs to. Returns DISCOVERY_RESPONSE_SUCCESS if successful. The action timeout is the time for which the client waits for a response AFTER the request is sent.
+action_response_timeout | |
p_thing_name | |
discovery_response_payload |
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | Jobs (const Jobs &)=delete |
+ | Jobs (Jobs &&)=default |
+Jobs & | operator= (const Jobs &) &=delete |
+Jobs & | operator= (Jobs &&) &=default |
std::unique_ptr< Utf8String > | GetJobTopic (JobExecutionTopicType topicType, JobExecutionTopicReplyType replyType=JOB_REQUEST_TYPE, const util::String &jobId=util::String()) |
GetJobTopic. More... | |
ResponseCode | SendJobsQuery (JobExecutionTopicType topicType, const util::String &jobId=util::String()) |
SendJobsQuery. More... | |
ResponseCode | SendJobsStartNext (const util::Map< util::String, util::String > &statusDetailsMap=util::Map< util::String, util::String >()) |
SendJobsStartNext. More... | |
ResponseCode | SendJobsDescribe (const util::String &jobId=util::String(), int64_t executionNumber=0, bool includeJobDocument=true) |
SendJobsDescribe. More... | |
ResponseCode | SendJobsUpdate (const util::String &jobId, JobExecutionStatus status, const util::Map< util::String, util::String > &statusDetailsMap=util::Map< util::String, util::String >(), int64_t expectedVersion=0, int64_t executionNumber=0, bool includeJobExecutionState=false, bool includeJobDocument=false) |
SendJobsUpdate. More... | |
std::shared_ptr< mqtt::Subscription > | CreateJobsSubscription (mqtt::Subscription::ApplicationCallbackHandlerPtr p_app_handler, std::shared_ptr< mqtt::SubscriptionHandlerContextData > p_app_handler_data, JobExecutionTopicType topicType=JOB_WILDCARD_TOPIC, JobExecutionTopicReplyType replyType=JOB_REQUEST_TYPE, const util::String &jobId=util::String()) |
CreateJobsSubscription. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Jobs > | Create (std::shared_ptr< MqttClient > p_mqtt_client, mqtt::QoS qos, const util::String &thing_name, const util::String &client_token=util::String()) |
Create factory method. Returns a unique instance of Jobs. More... | |
+Protected Member Functions | |
Jobs (std::shared_ptr< MqttClient > p_mqtt_client, mqtt::QoS qos, const util::String &thing_name, const util::String &client_token) | |
Jobs constructor. More... | |
+util::String | SerializeJobExecutionUpdatePayload (JobExecutionStatus status, const util::Map< util::String, util::String > &statusDetailsMap=util::Map< util::String, util::String >(), int64_t expectedVersion=0, int64_t executionNumber=0, bool includeJobExecutionState=false, bool includeJobDocument=false) |
+util::String | SerializeDescribeJobExecutionPayload (int64_t executionNumber=0, bool includeJobDocument=true) |
+util::String | SerializeStartNextPendingJobExecutionPayload (const util::Map< util::String, util::String > &statusDetailsMap=util::Map< util::String, util::String >()) |
+util::String | SerializeClientTokenPayload () |
+Protected Attributes | |
+std::shared_ptr< MqttClient > | p_mqtt_client_ |
+mqtt::QoS | qos_ |
+util::String | thing_name_ |
+util::String | client_token_ |
+
|
+ +protected | +
Create Jobs object storing given parameters in created instance
+p_mqtt_client | - mqtt client |
qos | - QoS |
thing_name | - Thing name |
client_token | - Client token for correlating messages (optional) |
+
|
+ +static | +
p_mqtt_client | - mqtt client |
qos | - QoS |
thing_name | - Thing name |
client_token | - Client token for correlating messages (optional) |
std::shared_ptr< mqtt::Subscription > awsiotsdk::Jobs::CreateJobsSubscription | +( | +mqtt::Subscription::ApplicationCallbackHandlerPtr | +p_app_handler, | +
+ | + | std::shared_ptr< mqtt::SubscriptionHandlerContextData > | +p_app_handler_data, | +
+ | + | JobExecutionTopicType | +topicType = JOB_WILDCARD_TOPIC , |
+
+ | + | JobExecutionTopicReplyType | +replyType = JOB_REQUEST_TYPE , |
+
+ | + | const util::String & | +jobId = util::String() |
+
+ | ) | ++ |
Create a Jobs Subscription instance
+p_app_handler | - Application Handler instance |
p_app_handler_data | - Data to be passed to application handler. Can be nullptr |
topicType | - Jobs topic type to subscribe to (defaults to JOB_WILDCARD_TOPIC) |
jobId | - Job id, can be $next to indicate next queued or in process job, can also be omitted if N/A |
replyType | - Topic reply type (optional, defaults to JOB_REQUEST_TYPE which omits the reply type in the subscription) |
std::unique_ptr< Utf8String > awsiotsdk::Jobs::GetJobTopic | +( | +JobExecutionTopicType | +topicType, | +
+ | + | JobExecutionTopicReplyType | +replyType = JOB_REQUEST_TYPE , |
+
+ | + | const util::String & | +jobId = util::String() |
+
+ | ) | ++ |
This function creates a job topic based on the provided parameters.
+topicType | - Jobs topic type |
replyType | - Topic reply type (optional) |
jobId | - Job id, can be $next to indicate next queued or in process job, can also be omitted if N/A |
ResponseCode awsiotsdk::Jobs::SendJobsDescribe | +( | +const util::String & | +jobId = util::String() , |
+
+ | + | int64_t | +executionNumber = 0 , |
+
+ | + | bool | +includeJobDocument = true |
+
+ | ) | ++ |
Send request for job execution details
+jobId | - Job id, can be $next to indicate next queued or in process job, can also be omitted to request all pending and in progress job executions |
executionNumber | - Specific execution number to describe, omit to match latest |
includeJobDocument | - Flag to indicate whether response should include job document |
ResponseCode awsiotsdk::Jobs::SendJobsQuery | +( | +JobExecutionTopicType | +topicType, | +
+ | + | const util::String & | +jobId = util::String() |
+
+ | ) | ++ |
ResponseCode awsiotsdk::Jobs::SendJobsStartNext | +( | +const util::Map< util::String, util::String > & | +statusDetailsMap = util::Map<util::String, util::String>() | ) | ++ |
Call Jobs start-next API to start the next pending job execution and trigger response
+statusDetails | - Status details to be associated with started job execution (optional) |
ResponseCode awsiotsdk::Jobs::SendJobsUpdate | +( | +const util::String & | +jobId, | +
+ | + | JobExecutionStatus | +status, | +
+ | + | const util::Map< util::String, util::String > & | +statusDetailsMap = util::Map<util::String, util::String>() , |
+
+ | + | int64_t | +expectedVersion = 0 , |
+
+ | + | int64_t | +executionNumber = 0 , |
+
+ | + | bool | +includeJobExecutionState = false , |
+
+ | + | bool | +includeJobDocument = false |
+
+ | ) | ++ |
Send update for specified job
+jobId | - Job id associated with job execution to be updated |
status | - New job execution status |
statusDetailsMap | - Status details to be associated with job execution (optional) |
expectedVersion | - Optional expected current job execution number, error response if mismatched |
executionNumber | - Specific execution number to update, omit to match latest |
includeJobExecutionState | - Include job execution state in response (optional) |
includeJobDocument | - Include job document in response (optional) |
+ AWS IoT C++ SDK
+
+ |
+
MQTT Client Class. + More...
+ +#include <Client.hpp>
+Public Member Functions | |
+ | MqttClient (const MqttClient &)=delete |
+ | MqttClient (MqttClient &&)=default |
+MqttClient & | operator= (const MqttClient &) &=delete |
+MqttClient & | operator= (MqttClient &&) &=default |
virtual ResponseCode | Connect (std::chrono::milliseconds action_response_timeout, bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg) |
Perform Sync Connect. More... | |
virtual ResponseCode | Connect (std::chrono::milliseconds action_response_timeout, bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg, bool is_metrics_enabled) |
Perform Sync Connect. More... | |
virtual ResponseCode | Disconnect (std::chrono::milliseconds action_response_timeout) |
Perform Sync Disconnect. More... | |
virtual ResponseCode | Publish (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, mqtt::QoS qos, const util::String &payload, std::chrono::milliseconds action_response_timeout) |
Perform Sync Publish. More... | |
virtual ResponseCode | Subscribe (util::Vector< std::shared_ptr< mqtt::Subscription > > subscription_list, std::chrono::milliseconds action_response_timeout) |
Perform Sync Subscribe. More... | |
virtual ResponseCode | Unsubscribe (util::Vector< std::unique_ptr< Utf8String > > topic_list, std::chrono::milliseconds action_response_timeout) |
Perform Sync Unsubscribe. More... | |
virtual ResponseCode | PublishAsync (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, mqtt::QoS qos, const util::String &payload, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Publish. More... | |
virtual ResponseCode | SubscribeAsync (util::Vector< std::shared_ptr< mqtt::Subscription > > subscription_list, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Subscribe. More... | |
virtual ResponseCode | UnsubscribeAsync (util::Vector< std::unique_ptr< Utf8String > > topic_list, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler, uint16_t &packet_id_out) |
Perform Async Unsubscribe. More... | |
virtual bool | IsConnected () |
Check if Client is in Connected state. More... | |
virtual void | SetAutoReconnectEnabled (bool value) |
Sets the auto-reconnect flag for the client. More... | |
virtual bool | IsAutoReconnectEnabled () |
returns the current state of the auto-reconnect flag More... | |
virtual std::chrono::seconds | GetMinReconnectBackoffTimeout () |
returns the minimum back-off time value More... | |
virtual void | SetMinReconnectBackoffTimeout (std::chrono::seconds min_reconnect_backoff_timeout) |
sets the minimum back-off time value More... | |
virtual std::chrono::seconds | GetMaxReconnectBackoffTimeout () |
returns the maximum back-off time value More... | |
virtual void | SetMaxReconnectBackoffTimeout (std::chrono::seconds max_reconnect_backoff_timeout) |
sets the maximum back-off time value More... | |
virtual ResponseCode | SetDisconnectCallbackPtr (ClientCoreState::ApplicationDisconnectCallbackPtr p_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_app_handler_data) |
Set the callback function for disconnects. More... | |
virtual ResponseCode | SetReconnectCallbackPtr (ClientCoreState::ApplicationReconnectCallbackPtr p_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_app_handler_data) |
Set the callback function for reconnects. More... | |
virtual ResponseCode | SetResubscribeCallbackPtr (ClientCoreState::ApplicationResubscribeCallbackPtr p_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_app_handler_data) |
Set the callback function for resubscribes. More... | |
+Static Public Member Functions | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) |
Create factory method. Returns a unique instance of MqttClient. More... | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) |
Create factory method, with additional parameters for disconnect callback. More... | |
static std::unique_ptr< MqttClient > | Create (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr p_resubscribec_callback, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) |
Create factory method, with additional parameters for disconnect, reconnect and resubscribe callbacks. More... | |
+Protected Member Functions | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data, ClientCoreState::ApplicationReconnectCallbackPtr reconnect_callback_ptr, std::shared_ptr< ReconnectCallbackContextData > p_reconnect_app_handler_data, ClientCoreState::ApplicationResubscribeCallbackPtr resubscribe_callback_ptr, std::shared_ptr< ResubscribeCallbackContextData > p_resubscribe_app_handler_data) | |
Constructor. More... | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout, ClientCoreState::ApplicationDisconnectCallbackPtr disconnect_callback_ptr, std::shared_ptr< DisconnectCallbackContextData > p_disconnect_app_handler_data) | |
Constructor. More... | |
MqttClient (std::shared_ptr< NetworkConnection > p_network_connection, std::chrono::milliseconds mqtt_command_timeout) | |
Constructor. More... | |
+Protected Attributes | |
+std::unique_ptr< ClientCore > | p_client_core_ |
Unique pointer to the Client Core instance. | |
+std::shared_ptr< mqtt::ClientState > | p_client_state_ |
MQTT Client state. | |
Defining a class for the MQTT Client. This class is a wrapper on the Core Client and creates a Client Core instance with MQTT Actions It also provides APIs to perform MQTT operations directly on the Core Client instance
+
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_disconnect_app_handler_data | - context data for the disconnect handler |
reconnect_callback_ptr | - pointer of the reconnect callback handler |
p_reconnect_app_handler_data | - context data for the reconnect handler |
resubscribe_callback_ptr | - pointer of the resubscribe callback handler |
p_resubscribe_app_handler_data | - context data for the resubscribe handler |
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_disconnect_app_handler_data | - context data for the disconnect handler |
+
|
+ +protected | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
+
|
+ +virtual | +
Performs a Network and MQTT Connect operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent. SDK metrics enabled by default
+action_response_timeout | Timeout in milliseconds within which response should be obtained after request is sent |
is_clean_session | |
mqtt_version | |
keep_alive_timeout | |
p_client_id | |
p_username | |
p_password | |
p_will_msg | Last Will and Testament message |
+
|
+ +virtual | +
Performs a Network and MQTT Connect operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent.
+action_response_timeout | Timeout in milliseconds within which response should be obtained after request is sent |
is_clean_session | |
mqtt_version | |
keep_alive_timeout | |
p_client_id | |
p_username | |
p_password | |
p_will_msg | Last Will and Testament message |
is_metrics_enabled |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr_ptr | - pointer of the disconnect callback handler |
p_app_handler_data | - context data for the disconnect handler |
+
|
+ +static | +
p_network_connection | - Network connection to use with this MQTT Client instance |
mqtt_command_timeout | - Command timeout in milliseconds for internal blocking operations (Reconnect and Resubscribe) |
disconnect_callback_ptr | - pointer of the disconnect callback handler |
p_app_handler_data | - context data for the disconnect handler |
reconnect_callback_ptr | - pointer of the reconnect callback handler |
p_reconnect_app_handler_data | - context data for the reconnect handler |
resubscribe_callback_ptr | - pointer of the resubscribe callback handler |
p_resubscribe_app_handler_data | - context data for the resubscribe handler |
+
|
+ +virtual | +
Performs a Network and MQTT Disconnect operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent.
+action_response_timeout | - Timeout in milliseconds within which response should be obtained after request is sent |
+
|
+ +virtual | +
Returns the maximum back-off time that is set, which is the maximum time a client waits for before attempting a reconnect.
+
+
|
+ +virtual | +
Returns the minimum back-off time that is set, which is the minimum time a client waits for before attempting a reconnect.
+
+
|
+ +inlinevirtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
Performs a MQTT Publish operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent.
+p_topic_name | topic name on which the publish is performed |
is_retained | last message is retained |
is_duplicate | is a duplicate message |
qos | quality of service |
payload | MQTT message payload |
action_response_timeout | Timeout in milliseconds within which response should be obtained after request is sent |
+
|
+ +virtual | +
Performs a MQTT Publish operation in Async mode. In the case of QoS1 requests, packet ID obtained from this function can be used to match Ack to specific requests if needed. QoS0 requests do not have a corrosponding Ack message and we do not support QoS2 at this time. The request is queued up and in the case of QoS1, the Ack Handler is called if a PUBACK is received. If not, the handler is called with a ResponseCode indicating timeout
+p_topic_name | on which the publish is performed |
is_retained | last message is retained |
is_duplicate | is a duplicate message |
qos | quality of service |
payload | MQTT message payload |
p_async_ack_handler | the ack handling function |
packet_id_out | packet ID of the message being sent |
+
|
+ +inlinevirtual | +
value | for setting the flag |
+
|
+ +virtual | +
p_callback_ptr | |
p_app_handler_data |
+
|
+ +virtual | +
max_reconnect_backoff_timeout |
+
|
+ +virtual | +
min_reconnect_backoff_timeout |
+
|
+ +virtual | +
p_callback_ptr | |
p_app_handler_data |
+
|
+ +virtual | +
p_callback_ptr | |
p_app_handler_data |
+
|
+ +virtual | +
Performs a MQTT Subscribe operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent.
+subscription_list | - A list of subscriptions to use for the operation |
action_response_timeout | - Timeout in milliseconds within which response should be obtained after request is sent |
+
|
+ +virtual | +
Performs a MQTT Subscribe operation in Async mode. Packet ID obtained from this function can be used to match Ack to specific requests if needed. The Subscribe request is queued up and Client automatically activates Subscription if successful SUBACK is received. If not, the assigned Ack handler will be called with the corrosponding ResponseCode
+subscription_list | - A list of subscriptions to use for the operation |
p_async_ack_handler | - AsyncAck notification handler to be called when response for this request is processed |
packet_id_out | - Packet ID assigned to outgoing packet |
+
|
+ +virtual | +
Performs a MQTT Unsubscribe operation in blocking mode. Action timeout here is the time for which the client waits for a response AFTER the request is sent.
+p_unsubscribe_packet | - Unsubscribe packet to use for the operation |
action_response_timeout | - Timeout in milliseconds within which response should be obtained after request is sent |
+
|
+ +virtual | +
Performs a MQTT Unsubscribe operation in Async mode. Packet ID obtained from this function can be used to match Ack to specific requests if needed. The Unsubscribe request is queued up and Client automatically deactivates the subscription if successful UNSUBACK is received. If not, the assigned Ack handler will be called with the corrosponding ResponseCode
+p_unsubscribe_packet | - Unsubscribe packet to use for the operation |
p_async_ack_handler | - AsyncAck notification handler to be called when response for this request is processed |
packet_id_out | - Packet ID assigned to outgoing packet |
+ AWS IoT C++ SDK
+
+ |
+
Network Connection Class. + More...
+ +#include <NetworkConnection.hpp>
+Public Member Functions | |
virtual bool | IsConnected ()=0 |
Check if Network layer is still connected. More... | |
virtual bool | IsPhysicalLayerConnected ()=0 |
Check if Network Physical layer is still connected. More... | |
virtual ResponseCode | Connect () final |
Create a Network socket and open the connection. More... | |
virtual ResponseCode | Write (const util::String &buf, size_t &size_written_bytes_out) final |
Write bytes to the network socket. More... | |
virtual ResponseCode | Read (util::Vector< unsigned char > &buf, size_t buf_read_offset, size_t size_bytes_to_read, size_t &size_read_bytes_out) final |
Read bytes from the network socket. More... | |
virtual ResponseCode | Disconnect () final |
Disconnect from network socket. More... | |
+Protected Member Functions | |
virtual ResponseCode | ConnectInternal ()=0 |
Create a Network socket and open the connection. More... | |
virtual ResponseCode | WriteInternal (const util::String &buf, size_t &size_written_bytes_out)=0 |
Write bytes to the network socket. More... | |
virtual ResponseCode | ReadInternal (util::Vector< unsigned char > &buf, size_t buf_read_offset, size_t size_bytes_to_read, size_t &size_read_bytes_out)=0 |
Read bytes from the network socket. More... | |
virtual ResponseCode | DisconnectInternal ()=0 |
Disconnect from network socket. More... | |
+Protected Attributes | |
std::mutex | read_mutex |
Mutex for synchronizing read operations. More... | |
+std::mutex | write_mutex |
Mutex for synchronizing write operations. | |
Defines an interface to the Network layer to be used by the MQTT client. Starting point for porting the SDK to the networking layer of a new platform.
+This is an abstract class and cannot be instantiated.
+
+
|
+ +finalvirtual | +
Calls the internal connect function after obtaining read and write locks
+
+
|
+ +protectedpure virtual | +
Internal implementation of the Connect function to be provided by the derived class
+Creates an open socket connection including Network handshake.
+
+
|
+ +finalvirtual | +
Calls the internal disconnect function after obtaining read and write locks This will be called by the SDK for both manual and auto-disconnect. It separates the Disconnect logic from destroy, Network stack is NOT destroyed by this API SDK should still be able to reconnect after Disconnect, but not after Destroy
+
+
|
+ +protectedpure virtual | +
Internal implementation of the Disconnect function to be provided by the derived class
+
+
|
+ +pure virtual | +
Called to check if the Network layer is still connected or not.
+
+
|
+ +pure virtual | +
Called to check if the Network Physical layer is still connected or not.
+
+
|
+ +finalvirtual | +
Calls the internal read function after obtaining read lock
+util::String | - reference to buffer where read bytes should be copied |
size_t | - number of bytes to read |
size_t | - reference to store number of bytes read |
+
|
+ +protectedpure virtual | +
Internal implementation of the Read function to be provided by the derived class
+util::String | - reference to buffer where read bytes should be copied |
size_t | - number of bytes to read |
size_t | - reference to store number of bytes read |
+
|
+ +finalvirtual | +
Calls the internal write function after obtaining write lock
+util::String | - const reference to buffer which should be written to socket |
+
|
+ +protectedpure virtual | +
Internal implementation of the Write function to be provided by the derived class
+util::String | - const reference to buffer which should be written to socket |
+
|
+ +protected | +
Both the below mutexes must be locked before connect/disconnect
+ +
+ AWS IoT C++ SDK
+
+ |
+
MQTT Reconnect Callback Context Data. + More...
+ +#include <ClientCoreState.hpp>
This class can be used to provide customer context data to be provided with each reconnect callback. Uses a pure virtual destructor to allow for polymorphism
+
+ AWS IoT C++ SDK
+
+ |
+
MQTT Resubscribe Callback Context Data. + More...
+ +#include <ClientCoreState.hpp>
This class can be used to provide customer context data to be provided with each resubscribe callback. Uses a pure virtual destructor to allow for polymorphism
+
+ AWS IoT C++ SDK
+
+ |
+
Define a type for Shadow. +
+ +#include <Shadow.hpp>
+Public Types | |
typedef std::function< ResponseCode(util::String, ShadowRequestType, ShadowResponseType, util::JsonDocument &)> | RequestHandlerPtr |
Request Handler type for Shadow requests. Called after Shadow instance processes incoming message. More... | |
+Public Member Functions | |
Shadow (std::shared_ptr< MqttClient > p_mqtt_client, std::chrono::milliseconds mqtt_command_timeout, util::String &thing_name, util::String &client_token_prefix) | |
Constructor. More... | |
+ | Shadow (const Shadow &)=delete |
+ | Shadow (Shadow &&)=delete |
+Shadow & | operator= (const Shadow &) &=delete |
+Shadow & | operator= (Shadow &&) &=delete |
ResponseCode | UpdateDeviceShadow (util::JsonDocument &document) |
Update device shadow. More... | |
util::JsonDocument | GetDeviceReported () |
Get reported state of the shadow on the device. More... | |
util::JsonDocument | GetDeviceDesired () |
Get desired state of the shadow on the device. More... | |
util::JsonDocument | GetDeviceDocument () |
Get state document of the shadow on the device. More... | |
util::JsonDocument | GetServerReported () |
Get reported state of the shadow state received from the server. More... | |
util::JsonDocument | GetServerDesired () |
Get desired state of the shadow state received from the server. More... | |
util::JsonDocument | GetServerDocument () |
Get state document of the shadow state received from the server. More... | |
ResponseCode | PerformGetAsync () |
Perform a Get operation for this shadow. More... | |
ResponseCode | PerformUpdateAsync () |
Perform an Update operation for this shadow. More... | |
ResponseCode | PerformDeleteAsync () |
Perform a Delete operation for this shadow. More... | |
ResponseCode | HandleGetResponse (ShadowResponseType response_type, util::JsonDocument &payload) |
Handle response for Get Request. More... | |
ResponseCode | HandleUpdateResponse (ShadowResponseType response_type, util::JsonDocument &payload) |
Handle response for Update Request. More... | |
ResponseCode | HandleDeleteResponse (ShadowResponseType response_type, util::JsonDocument &payload) |
Handle response for Delete Request. More... | |
+void | ResetClientTokenSuffix () |
Reset the timestamp generated client suffix. | |
uint32_t | GetCurrentVersionNumber () |
Get the current version number of the shadow. More... | |
bool | IsInSync () |
Get whether the server shadow state is in sync. More... | |
ResponseCode | AddShadowSubscription (util::Map< ShadowRequestType, RequestHandlerPtr > &request_mapping) |
Add a specific shadow subscription. More... | |
ResponseCode | SubscriptionHandler (util::String topic_name, util::String payload, std::shared_ptr< mqtt::SubscriptionHandlerContextData > p_app_handler_data) |
Subscription handler for Shadow actions. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Shadow > | Create (std::shared_ptr< MqttClient > p_mqtt_client, std::chrono::milliseconds mqtt_command_timeout, util::String &thing_name, util::String &client_token_prefix) |
Factory method to create Shadow instances. More... | |
static util::JsonDocument | GetEmptyShadowDocument () |
Static function that creates and returns an empty Shadow json document. More... | |
+Protected Attributes | |
+bool | is_get_subscription_active_ |
Status of the get subscription. | |
+bool | is_update_subscription_active_ |
Status of the update subscription. | |
+bool | is_delete_subscription_active_ |
Status of the delete subscription. | |
+bool | is_delta_subscription_active_ |
Status of the delta subscription. | |
+uint32_t | cur_shadow_version_ |
Current version of the shadow as received from the server. | |
+util::String | thing_name_ |
Thing name for this shadow instance. | |
+util::String | client_token_prefix_ |
Client token prefix being used for shadow actions. | |
+util::String | client_token_ |
Full client token as generated while constructing this instance. | |
+util::String | shadow_topic_action_prefix_ |
Shadow topic action prefix. | |
+util::String | shadow_topic_get_ |
Get topic for this shadow. | |
+util::String | shadow_topic_delta_ |
Delta topic for this shadow. | |
+util::String | shadow_topic_update_ |
Update topic for this shadow. | |
+util::String | shadow_topic_delete_ |
Delete topic for this shadow. | |
+util::String | response_type_delta_text_ |
Delta response postfix. | |
+util::String | response_type_rejected_text_ |
Rejected reponse postfix. | |
+util::String | response_type_accepted_text_ |
Accepted response postfix. | |
+std::chrono::milliseconds | mqtt_command_timeout_ |
Mqtt command timeout. | |
+util::JsonDocument | cur_server_state_document_ |
Last received shadow state document from the server. | |
+util::JsonDocument | cur_device_state_document_ |
Current shadow state document on the device. | |
+util::Map< ShadowRequestType, RequestHandlerPtr > | request_mapping_ |
Request mappings for shadow actions. | |
+std::shared_ptr< MqttClient > | p_mqtt_client_ |
IoT Client being used by this Shadow instance. | |
typedef std::function<ResponseCode(util::String, ShadowRequestType, ShadowResponseType, util::JsonDocument &)> awsiotsdk::Shadow::RequestHandlerPtr | +
Takes the following as parameters util::String - Thing Name for which response was received ShadowRequestType - Request Type on which response was received ShadowResponseType - Response Type util::JsonDocument - JsonPayload of the response
+ +awsiotsdk::Shadow::Shadow | +( | +std::shared_ptr< MqttClient > | +p_mqtt_client, | +
+ | + | std::chrono::milliseconds | +mqtt_command_timeout, | +
+ | + | util::String & | +thing_name, | +
+ | + | util::String & | +client_token_prefix | +
+ | ) | ++ |
p_mqtt_client | - MQTT Client instance used for this Shadow, can NOT be changed later |
mqtt_command_timeout | - Timeout to use for MQTT Commands |
thing_name | - Thing name for this shadow |
client_token_prefix | - Client Token prefix to use for shadow operations |
ResponseCode awsiotsdk::Shadow::AddShadowSubscription | +( | +util::Map< ShadowRequestType, RequestHandlerPtr > & | +request_mapping | ) | ++ |
This function can be used to add a subscription to various shadow actions. Each action can optionally be assigned a handler that can process any response that is received. The internal shadow state will be updated before the response handler is called if it is provided.
+request_mapping | Mapping of request type to response handler |
+
|
+ +static | +
p_mqtt_client | - MQTT Client instance used for this Shadow, can NOT be changed later |
mqtt_command_timeout | - Timeout to use for MQTT Commands |
thing_name | - Thing name for this shadow |
client_token_prefix | - Client Token prefix to use for shadow operations |
uint32_t awsiotsdk::Shadow::GetCurrentVersionNumber | +( | +) | ++ |
util::JsonDocument awsiotsdk::Shadow::GetDeviceDesired | +( | +) | ++ |
util::JsonDocument awsiotsdk::Shadow::GetDeviceDocument | +( | +) | ++ |
util::JsonDocument awsiotsdk::Shadow::GetDeviceReported | +( | +) | ++ |
+
|
+ +static | +
util::JsonDocument awsiotsdk::Shadow::GetServerDesired | +( | +) | ++ |
util::JsonDocument awsiotsdk::Shadow::GetServerDocument | +( | +) | ++ |
util::JsonDocument awsiotsdk::Shadow::GetServerReported | +( | +) | ++ |
ResponseCode awsiotsdk::Shadow::HandleDeleteResponse | +( | +ShadowResponseType | +response_type, | +
+ | + | util::JsonDocument & | +payload | +
+ | ) | ++ |
response_type | - Response Type received from the server |
payload | - Json payload received with the response |
ResponseCode awsiotsdk::Shadow::HandleGetResponse | +( | +ShadowResponseType | +response_type, | +
+ | + | util::JsonDocument & | +payload | +
+ | ) | ++ |
response_type | - Response Type received from the server |
payload | - Json payload received with the response |
ResponseCode awsiotsdk::Shadow::HandleUpdateResponse | +( | +ShadowResponseType | +response_type, | +
+ | + | util::JsonDocument & | +payload | +
+ | ) | ++ |
response_type | - Response Type received from the server |
payload | - Json payload received with the response |
bool awsiotsdk::Shadow::IsInSync | +( | +) | ++ |
ResponseCode awsiotsdk::Shadow::PerformDeleteAsync | +( | +) | ++ |
If accepted, this will delete the shadow from the server. It also clears the shadow state received from the server and sets it to an empty object. This will NOT affect the shadow state for the device. To do that, use the UpdateDeviceShadow function with an empty document. If the subscription for this request type doesn't exist, it will also subscribe to the Accepted and Rejected topics.
+ResponseCode awsiotsdk::Shadow::PerformGetAsync | +( | +) | ++ |
If Accepted, this clears the current server shadow state and updates it with the new state received from the server. If the subscription for this request type doesn't exist, it will also subscribe to the Accepted and Rejected topics.
+ResponseCode awsiotsdk::Shadow::PerformUpdateAsync | +( | +) | ++ |
This function generates a diff between the current state of the shadow on the device and the last reported state of the shadow on the server. Then it calls update using this diff. If the subscription for this request type doesn't exist, it will also subscribe to the Accepted and Rejected topics. This does NOT automatically subscribe to the delta topic.
+ResponseCode awsiotsdk::Shadow::SubscriptionHandler | +( | +util::String | +topic_name, | +
+ | + | util::String | +payload, | +
+ | + | std::shared_ptr< mqtt::SubscriptionHandlerContextData > | +p_app_handler_data | +
+ | ) | ++ |
This function is the subscription handler used by this shadow instance for internal action topics. This function is for internal use ONLY. It is public because the mqtt client needs to be provided with a reference to this function.
+topic_name | - Topic name for which publish message is received |
payload | - Payload that was received |
p_app_handler_data | - Context data |
ResponseCode awsiotsdk::Shadow::UpdateDeviceShadow | +( | +util::JsonDocument & | +document | ) | ++ |
This function can be used to update a device shadow. The document passed here must have the same structure as a device shadow document. Whatever is provided here will be merged into the device shadow json with one of the below options: 1) Key exists in both current state and the provided document : Provided document value is used 2) Key exists only in current state : No changes, kept as is 3) Key exists only in the provided document : New document's key and value is copied to device shadow json
+To easily generate a source document, please use either the GetEmptyShadowDocument function to get an empty document or get either the current device state or server state document using the corrosponding functions
+document | - JsonDocument containing the new updates |
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | Utf8String (const Utf8String &)=default |
+ | Utf8String (Utf8String &&)=default |
+Utf8String & | operator= (const Utf8String &) &=default |
+Utf8String & | operator= (Utf8String &&) &=default |
+std::size_t | Length () |
+util::String | ToStdString () |
+Static Public Member Functions | |
+static std::unique_ptr< Utf8String > | Create (util::String str) |
+static std::unique_ptr< Utf8String > | Create (const char *str, std::size_t length) |
+Protected Member Functions | |
+ | Utf8String (util::String str) |
+ | Utf8String (const char *str, std::size_t length) |
+Static Protected Member Functions | |
+static bool | IsValidInput (util::String str) |
+static bool | IsValidInput (const char *str, std::size_t length) |
+Protected Attributes | |
+util::String | data |
+std::size_t | length |
+ AWS IoT C++ SDK
+
+ |
+
Define a class for DiscoverAction. + More...
+ +#include <Discovery.hpp>
+Public Member Functions | |
+ | DiscoverAction (const DiscoverAction &)=delete |
+ | DiscoverAction (DiscoverAction &&)=delete |
+DiscoverAction & | operator= (const DiscoverAction &) &=delete |
+DiscoverAction & | operator= (DiscoverAction &&) &=delete |
DiscoverAction (std::shared_ptr< mqtt::ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Performs the Discovery Action. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Member Functions | |
ResponseCode | ReadResponseFromNetwork (std::shared_ptr< NetworkConnection > p_network_connection, util::String &sent_packet, util::String &read_payload, std::chrono::milliseconds max_response_wait_time) |
Parses the discovery response to get the header and response data. More... | |
ResponseCode | MakeDiscoveryRequest (std::shared_ptr< NetworkConnection > p_network_connection, const util::String packet_data) |
Make the discovery request. More... | |
ResponseCode | InitializeDiscoveryResponseJson (const util::String received_response, std::shared_ptr< DiscoverRequestData > discover_packet) |
Initialize the discovery response json. More... | |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
+Protected Attributes | |
+std::shared_ptr< mqtt::ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
This class defines a Synchronous action for performing an AWS Greengrass Discovery operation
+awsiotsdk::discovery::DiscoverAction::DiscoverAction | +( | +std::shared_ptr< mqtt::ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +protected | +
Convert the received discovery response and insert it into the discover packet. Returns a SUCCESS if it able to covert it into a Json successfully. Returns error code otherwise.
+received_response | |
discover_packet |
+
|
+ +protected | +
Writes the discovery request to the network. Returns a SUCCESS when it is able to write to the network correctly. Returns error code otherwise.
+p_network_connection | |
p_discover_packet |
+
|
+ +virtual | +
Performs the Discovery operation to get the connectivity information of GGCs in the group that this device belongs to by making an HTTP GET request to the endpoint. Returns a DISCOVER_ACTION_SUCCESS response when connectivity information is found. Otherwise returns error codes based on whether it's an HTTP error or if connectivity information is not present.
+p_network_connection | |
p_action_data |
Implements awsiotsdk::Action.
+ +
+
|
+ +protected | +
Parses the discovery response to obtain the header and response payload. Returns a SUCCESS when it is able to parse it correctly. Otherwise returns error codes if the discovery request fails.
+sent_packet | |
read_payload | |
max_response_wait_time |
+ AWS IoT C++ SDK
+
+ |
+
Discover Request Packet Type. + More...
+ +#include <Discovery.hpp>
+Public Member Functions | |
+ | DiscoverRequestData (const DiscoverRequestData &)=delete |
+ | DiscoverRequestData (DiscoverRequestData &&)=delete |
+DiscoverRequestData & | operator= (const DiscoverRequestData &) &=delete |
+DiscoverRequestData & | operator= (DiscoverRequestData &&) &=delete |
DiscoverRequestData (std::unique_ptr< Utf8String > p_thing_name, std::chrono::milliseconds max_response_wait_time) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
std::chrono::milliseconds | GetMaxResponseWaitTime () |
return the max time for which it will wait for a discovery reply More... | |
virtual uint16_t | GetActionId () |
returns the action ID (currently unused in Discovery) More... | |
virtual void | SetActionId (uint16_t action_id) |
sets the action ID (currently unused in Discovery) More... | |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< DiscoverRequestData > | Create (std::unique_ptr< Utf8String > p_thing_name, std::chrono::milliseconds max_response_wait_time) |
Create Factory method. More... | |
+Data Fields | |
+DiscoveryResponse | discovery_response_ |
Response received in Discover request. | |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
+Protected Attributes | |
+std::unique_ptr< Utf8String > | p_thing_name_ |
Utf8 string defining the Thing name. | |
+util::String | discovery_request_data_ |
Packet data. | |
+std::chrono::milliseconds | max_response_wait_time_ |
Maximum time the device should wait for response. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
Defines a type for Discover Request Packet message
+awsiotsdk::discovery::DiscoverRequestData::DiscoverRequestData | +( | +std::unique_ptr< Utf8String > | +p_thing_name, | +
+ | + | std::chrono::milliseconds | +max_response_wait_time | +
+ | ) | ++ |
p_thing_name_ | - Thing name to use to perform discovery |
max_response_wait_time | - discovery reply timeout in milliseconds |
+
|
+ +static | +
p_thing_name_ | - Thing name to use to perform discovery |
max_response_wait_time | - max time for which it will wait for a discovery reply, in milliseconds |
+
|
+ +inlinevirtual | +
Implements awsiotsdk::ActionData.
+ +
+
|
+ +inline | +
+
|
+ +inlinevirtual | +
action_id |
Implements awsiotsdk::ActionData.
+ +util::String awsiotsdk::discovery::DiscoverRequestData::ToString | +( | +) | ++ |
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | ClientState (const ClientState &)=delete |
+ | ClientState (ClientState &&)=delete |
+ClientState & | operator= (const ClientState &) &=delete |
+ClientState & | operator= (ClientState &&) &=delete |
+ | ClientState (std::chrono::milliseconds mqtt_command_timeout) |
+bool | IsSessionPresent () |
+void | SetSessionPresent (bool value) |
+bool | IsConnected () |
+void | SetConnected (bool value) |
+bool | IsAutoReconnectEnabled () |
+void | SetAutoReconnectEnabled (bool value) |
+bool | IsAutoReconnectRequired () |
+void | SetAutoReconnectRequired (bool value) |
+bool | IsPingreqPending () |
+void | SetPingreqPending (bool value) |
+bool | isDisconnectCallbackPending () |
+void | setDisconnectCallbackPending (bool value) |
+virtual uint16_t | GetNextPacketId () |
virtual uint16_t | GetNextActionId () |
Overload for Get next Action ID. More... | |
std::chrono::seconds | GetKeepAliveTimeout () |
Get duration of Keep alive interval in seconds. More... | |
+void | SetKeepAliveTimeout (std::chrono::seconds keep_alive_timeout) |
+std::chrono::milliseconds | GetMqttCommandTimeout () |
+void | SetMqttCommandTimeout (std::chrono::milliseconds mqtt_command_timeout) |
+std::chrono::seconds | GetMinReconnectBackoffTimeout () |
+void | SetMinReconnectBackoffTimeout (std::chrono::seconds min_reconnect_backoff_timeout) |
+std::chrono::seconds | GetMaxReconnectBackoffTimeout () |
+void | SetMaxReconnectBackoffTimeout (std::chrono::seconds max_reconnect_backoff_timeout) |
+std::shared_ptr< ActionData > | GetAutoReconnectData () |
+void | SetAutoReconnectData (std::shared_ptr< ActionData > p_connect_data) |
+std::shared_ptr< Subscription > | GetSubscription (util::String p_topic_name) |
+std::shared_ptr< Subscription > | SetSubscriptionPacketInfo (util::String p_topic_name, uint16_t packet_id, uint8_t index_in_packet) |
+ResponseCode | SetSubscriptionActive (uint16_t packet_id, uint8_t index_in_sub_packet, mqtt::QoS max_qos) |
+ResponseCode | RemoveSubscription (uint16_t packet_id, uint8_t index_in_sub_packet) |
+ResponseCode | RemoveAllSubscriptionsForPacketId (uint16_t packet_id) |
+ResponseCode | RemoveSubscription (util::String p_topic_name) |
![]() | |
virtual uint16_t | GetNextActionId () |
Overload for Get next Action ID. More... | |
size_t | GetMaxActionQueueSize () |
Get current value of maximum action queue size. More... | |
void | SetMaxActionQueueSize (size_t max_queue_size) |
Set max size for action queue. More... | |
std::shared_ptr< std::atomic_bool > | GetCoreExecutionSyncPoint () |
Get pointer to sync point used for execution status of the Core instance. More... | |
void | SetProcessQueuedActions (bool process_queued_actions) |
Sets whether the Client is allowed to process queue actions. More... | |
bool | CanProcessQueuedActions () |
Get whether the Client can process queued actions. More... | |
void | ProcessOutboundActionQueue (std::shared_ptr< std::atomic_bool > thread_task_out_sync) |
Process the outbound action queue. More... | |
ResponseCode | PerformAction (ActionType action_type, std::shared_ptr< ActionData > action_data, std::chrono::milliseconds action_reponse_timeout) |
Perform Action in Blocking Mode. More... | |
ResponseCode | RegisterAction (ActionType action_type, Action::CreateHandlerPtr p_action_create_handler, std::shared_ptr< ActionState > p_action_state) |
Register Action for execution by Client Core. More... | |
ResponseCode | GetActionCreateHandler (ActionType action_type, Action::CreateHandlerPtr *p_action_create_handler) |
Get the Create Factory Method for the specified action type. More... | |
ResponseCode | EnqueueOutboundAction (ActionType action_type, std::shared_ptr< ActionData > action_data, uint16_t &action_id_out) |
Enqueue Action for processing in Outbound Queue. More... | |
ResponseCode | RegisterPendingAck (uint16_t action_id, ActionData::AsyncAckNotificationHandlerPtr p_async_ack_handler) |
Register Ack Handler for provided action id. More... | |
void | DeletePendingAck (uint16_t action_id) |
Delete Ack Handler for specified Action ID. More... | |
void | ForwardReceivedAck (uint16_t action_id, ResponseCode rc) |
Call registered Ack handler if it exists for specified Packet id. More... | |
void | DeleteExpiredAcks () |
Delete all expired Acks. More... | |
void | ClearRegisteredActions () |
Clears all registered Actions. More... | |
void | ClearOutboundActionQueue () |
Clears all pending outbound Actions. More... | |
+ | ClientCoreState () |
Default Constructor. | |
+virtual | ~ClientCoreState () |
Destructor. | |
+ | ClientCoreState (const ClientCoreState &)=delete |
+ | ClientCoreState (ClientCoreState &&)=delete |
+ClientCoreState & | operator= (const ClientCoreState &) &=delete |
+ClientCoreState & | operator= (ClientCoreState &&) &=delete |
![]() | |
virtual uint16_t | GetNextActionId ()=0 |
Get Action ID of the next Action. More... | |
+ | ActionState (const ActionState &)=delete |
+ | ActionState (ActionState &&)=delete |
+ActionState & | operator= (const ActionState &) &=delete |
+ActionState & | operator= (ActionState &&) &=delete |
+Static Public Member Functions | |
+static std::shared_ptr< ClientState > | Create (std::chrono::milliseconds mqtt_command_timeout) |
+Data Fields | |
+util::Map< util::String, std::shared_ptr< Subscription > > | subscription_map_ |
![]() | |
+ApplicationDisconnectCallbackPtr | disconnect_handler_ptr_ |
Pointer to the Application Disconnect Callback. | |
+std::shared_ptr< DisconnectCallbackContextData > | p_disconnect_app_handler_data_ |
Data to be passed to the Application Handler. | |
+ApplicationReconnectCallbackPtr | reconnect_handler_ptr_ |
Pointer to the Application Reconnect Callback. | |
+std::shared_ptr< ReconnectCallbackContextData > | p_reconnect_app_handler_data_ |
Data to be passed to the Application Handler. | |
+ApplicationResubscribeCallbackPtr | resubscribe_handler_ptr_ |
Pointer to the Application Resubscribe Callback. | |
+std::shared_ptr< ResubscribeCallbackContextData > | p_resubscribe_app_handler_data_ |
Data to be passed to the Application Handler. | |
+std::shared_ptr< NetworkConnection > | p_network_connection_ |
Network connection instance to use for this instance of the Client This is shared between Actions, public to avoid multiple shared pointer operations while passing as argument by ClientCore. | |
+Protected Attributes | |
+bool | is_session_present_ |
+std::atomic_bool | is_connected_ |
+std::atomic_bool | is_auto_reconnect_enabled_ |
+std::atomic_bool | is_auto_reconnect_required_ |
+std::atomic_bool | is_pingreq_pending_ |
+uint16_t | last_sent_packet_id_ |
+std::chrono::seconds | keep_alive_timeout_ |
+std::chrono::seconds | min_reconnect_backoff_timeout_ |
+std::chrono::seconds | max_reconnect_backoff_timeout_ |
+std::chrono::milliseconds | mqtt_command_timeout_ |
+std::shared_ptr< ActionData > | p_connect_data_ |
+std::atomic_bool | trigger_disconnect_callback_ |
![]() | |
+std::atomic< uint16_t > | next_action_id_ |
Atomic, ID of the next Action that will be enqueued. | |
+std::atomic_int | cur_core_threads_ |
Atomic, Count of currently running core threads. | |
+std::atomic_int | max_hardware_threads_ |
Atomic, Count of the maximum allowed hardware threads. | |
+std::atomic_size_t | max_queue_size_ |
Atomic, Current configured max queue size. | |
+std::chrono::seconds | ack_timeout_ |
Timeout for pending Acks, older Acks are deleted with a failed response. | |
+std::mutex | register_action_lock_ |
Mutex for Register Action Request flow. | |
+std::mutex | ack_map_lock_ |
Mutex for Ack Map operations. | |
+std::mutex | sync_action_request_lock_ |
Mutex for Sync Action Request flow. | |
+std::mutex | sync_action_response_lock_ |
Mutex for Sync Action Response flow. | |
+std::condition_variable | sync_action_response_wait_ |
Condition variable used to wake up calling thread on Sync Action response. | |
+ResponseCode | sync_action_response_ |
Variable to store received Sync Action response. | |
+std::atomic_bool | process_queued_actions_ |
Atomic, indicates whether currently queued Actions should be processed or not. | |
+std::shared_ptr< std::atomic_bool > | continue_execution_ |
Atomic, Used to synchronize running threads, false value causes running threads to stop. | |
+util::Map< ActionType, std::unique_ptr< Action > > | action_map_ |
Map containing currently initialized Action Instances. | |
+util::Map< uint16_t, std::unique_ptr< PendingAckData > > | pending_ack_map_ |
Map containing currently pending Acks. | |
+util::Map< ActionType, Action::CreateHandlerPtr > | action_create_handler_map_ |
Map containing currently registered Action Types and corrosponding Factories. | |
+util::Queue< std::pair< ActionType, std::shared_ptr< ActionData > > > | outbound_action_queue_ |
Queue of outbound actions. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< DisconnectCallbackContextData > p_app_handler_data)> | ApplicationDisconnectCallbackPtr |
Define Handler for Disconnect Callbacks. More... | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< ReconnectCallbackContextData > p_app_handler_data, ResponseCode reconnect_result)> | ApplicationReconnectCallbackPtr |
Define Handler for Reconnect Callbacks. More... | |
typedef std::function< ResponseCode(util::String mqtt_client_id, std::shared_ptr< ResubscribeCallbackContextData > p_app_handler_data, ResponseCode resubscribe_result)> | ApplicationResubscribeCallbackPtr |
Define Handler for Resubscribe Callbacks. More... | |
![]() | |
void | SyncActionHandler (uint16_t action_id, ResponseCode rc) |
Internal Action Handler for Sync Action responses. More... | |
+
|
+ +inline | +
+
|
+ +inlinevirtual | +
Reimplemented from awsiotsdk::ClientCoreState.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for ConnectActionAsync. + More...
+ +#include <Connect.hpp>
+Public Member Functions | |
+ | ConnectActionAsync (const ConnectActionAsync &)=delete |
+ | ConnectActionAsync (ConnectActionAsync &&)=delete |
+ConnectActionAsync & | operator= (const ConnectActionAsync &) &=delete |
+ConnectActionAsync & | operator= (ConnectActionAsync &&) &=delete |
ConnectActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Connect Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Connect operation
+awsiotsdk::mqtt::ConnectActionAsync::ConnectActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Connect Operation in Async mode. This also calls Connect on the Network Connection provided with the Perform Action call. If the Network connect call fails, the action will return with the ResponseCode returned by the Network Connect call. This does not wait for CONNACK to be received. CONNACK is handled separately in the HandleConnack function of NetworkReadAction. If the MQTT connection is already active, will not attempt another Connect and return with appropriate ResponseCode.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Connect Packet Type. + More...
+ +#include <Connect.hpp>
+Public Member Functions | |
+ | ConnectPacket (const ConnectPacket &)=delete |
+ | ConnectPacket (ConnectPacket &&)=delete |
+ConnectPacket & | operator= (const ConnectPacket &) &=delete |
+ConnectPacket & | operator= (ConnectPacket &&) &=delete |
ConnectPacket (bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg, bool is_metrics_enabled) | |
Constructor. More... | |
ConnectPacket (bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
std::chrono::seconds | GetKeepAliveTimeout () |
Get duration of Keep alive interval in seconds. More... | |
util::String | GetClientID () |
get the client ID from the connect packet More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< ConnectPacket > | Create (bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg, bool is_metrics_enabled) |
Create Factory method. More... | |
static std::shared_ptr< ConnectPacket > | Create (bool is_clean_session, mqtt::Version mqtt_version, std::chrono::seconds keep_alive_timeout, std::unique_ptr< Utf8String > p_client_id, std::unique_ptr< Utf8String > p_username, std::unique_ptr< Utf8String > p_password, std::unique_ptr< mqtt::WillOptions > p_will_msg) |
Create Factory method, SDK metrics enabled by default. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Protected Attributes | |
+bool | is_clean_session_ |
MQTT clean session. True = this session is to be treated as clean. Previous server state is cleared and no information is retained from any previous connection. | |
+unsigned char | connect_flags_ |
MQTT Connect flags byte. | |
+std::chrono::seconds | keep_alive_timeout_ |
MQTT Keepalive timeout in seconds. | |
+mqtt::Version | mqtt_version_ |
Desired MQTT version used during connection. | |
+std::unique_ptr< Utf8String > | p_protocol_id_ |
The protocol ID for this connection. | |
+std::unique_ptr< Utf8String > | p_client_id_ |
Pointer to a string defining the MQTT client ID (this needs to be unique per device across your AWS account) | |
+std::unique_ptr< WillOptions > | p_will_msg_ |
MQTT LWT parameters. | |
+std::unique_ptr< Utf8String > | p_username_ |
MQTT Username. | |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
Defines a type for MQTT Connect message
+awsiotsdk::mqtt::ConnectPacket::ConnectPacket | +( | +bool | +is_clean_session, | +
+ | + | mqtt::Version | +mqtt_version, | +
+ | + | std::chrono::seconds | +keep_alive_timeout, | +
+ | + | std::unique_ptr< Utf8String > | +p_client_id, | +
+ | + | std::unique_ptr< Utf8String > | +p_username, | +
+ | + | std::unique_ptr< Utf8String > | +p_password, | +
+ | + | std::unique_ptr< mqtt::WillOptions > | +p_will_msg, | +
+ | + | bool | +is_metrics_enabled | +
+ | ) | ++ |
is_clean_session | - Is this a clean session? Currently we do not support setting this to false |
mqtt_version | - Which version of the MQTT protocol to use. Currently the only allowed value is 3.1.1 |
p_client_id | - Client ID to use to make the connection |
p_username | - Username, currently unused in AWS IoT and will be ignored |
p_password | - Password, currently unused in AWS IoT and will be ignored |
p_will_msg | - MQTT Last Will and Testament message |
is_metrics_enabled | - enable SDK metrics in username string |
awsiotsdk::mqtt::ConnectPacket::ConnectPacket | +( | +bool | +is_clean_session, | +
+ | + | mqtt::Version | +mqtt_version, | +
+ | + | std::chrono::seconds | +keep_alive_timeout, | +
+ | + | std::unique_ptr< Utf8String > | +p_client_id, | +
+ | + | std::unique_ptr< Utf8String > | +p_username, | +
+ | + | std::unique_ptr< Utf8String > | +p_password, | +
+ | + | std::unique_ptr< mqtt::WillOptions > | +p_will_msg | +
+ | ) | ++ |
is_clean_session | - Is this a clean session? Currently we do not support setting this to false |
mqtt_version | - Which version of the MQTT protocol to use. Currently the only allowed value is 3.1.1 |
p_client_id | - Client ID to use to make the connection |
p_username | - Username, currently unused in AWS IoT and will be ignored |
p_password | - Password, currently unused in AWS IoT and will be ignored |
p_will_msg | - MQTT Last Will and Testament message |
+
|
+ +static | +
is_clean_session | - Is this a clean session? Currently we do not support setting this to false |
mqtt_version | - Which version of the MQTT protocol to use. Currently the only allowed value is 3.1.1 |
p_client_id | - Client ID to use to make the connection |
p_username | - Username, currently unused in AWS IoT |
p_password | - Password, currently unused in AWS IoT |
p_will_msg | - MQTT Last Will and Testament message |
+
|
+ +static | +
is_clean_session | - Is this a clean session? Currently we do not support setting this to false |
mqtt_version | - Which version of the MQTT protocol to use. Currently the only allowed value is 3.1.1 |
p_client_id | - Client ID to use to make the connection |
p_username | - Username, currently unused in AWS IoT |
p_password | - Password, currently unused in AWS IoT |
p_will_msg | - MQTT Last Will and Testament message |
is_metrics_enabled | - enable SDK metrics in username string |
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for DisconnectActionAsync. + More...
+ +#include <Connect.hpp>
+Public Member Functions | |
+ | DisconnectActionAsync (const DisconnectActionAsync &)=delete |
+ | DisconnectActionAsync (DisconnectActionAsync &&)=delete |
+DisconnectActionAsync & | operator= (const DisconnectActionAsync &) &=delete |
+DisconnectActionAsync & | operator= (DisconnectActionAsync &&) &=delete |
DisconnectActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Disconnect Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Puback operation
+awsiotsdk::mqtt::DisconnectActionAsync::DisconnectActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Disconnect Operation in Async mode. Also calls disconnect API of the provided network connection. If the client is already in disconnected state, will not attempt disconnect and return with appropriate ResponseCode.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Disconnect Packet Type. + More...
+ +#include <Connect.hpp>
+Public Member Functions | |
+ | DisconnectPacket (const DisconnectPacket &)=delete |
+ | DisconnectPacket (DisconnectPacket &&)=delete |
+DisconnectPacket & | operator= (const DisconnectPacket &) &=delete |
+DisconnectPacket & | operator= (DisconnectPacket &&) &=delete |
+ | DisconnectPacket () |
Constructor. | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< DisconnectPacket > | Create () |
Create Factory method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
Defines a type for MQTT Disconnect message
+
+
|
+ +static | +
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for KeepaliveActionRunner. + More...
+ +#include <Connect.hpp>
+Public Member Functions | |
+ | KeepaliveActionRunner (const KeepaliveActionRunner &)=delete |
+ | KeepaliveActionRunner (KeepaliveActionRunner &&)=delete |
+KeepaliveActionRunner & | operator= (const KeepaliveActionRunner &) &=delete |
+KeepaliveActionRunner & | operator= (KeepaliveActionRunner &&) &=delete |
KeepaliveActionRunner (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Keep Alive Action. Expects to run in a separate thread using ClientCore. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an action for performing a MQTT Keep Alive operation. This is meant to be run in a separate thread using ClientCore and will not do anything if called for one single execution using Perform Action.
+awsiotsdk::mqtt::KeepaliveActionRunner::KeepaliveActionRunner | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Keep Alive operation. Will send out Ping requests at Half the specified Keepalive interval and expect a response to be received before that same period passes again. If a response is not received during that time, assumes connection has been lost and initiates and performs a reconnect. Also resubscribes to any existing subscribed topics. Uses exponential backoff using minimum and maximum values defined in Client state.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
NOTE: All callbacks used by the keepalive should be non-blocking
+NOTE :The resubscribe response can be NETWORK_DISCONNECTED_ERROR as the network might have disconnected again after the reconnect was successful.
+ +Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for NetworkReadActionRunner. + More...
+ +#include <NetworkRead.hpp>
+Public Member Functions | |
NetworkReadActionRunner (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform Network Read Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Member Functions | |
ResponseCode | DecodeRemainingLength (size_t &rem_len) |
Decode Remaining length from MQTT packet. More... | |
ResponseCode | ReadPacketFromNetwork (unsigned char &fixed_header_byte, util::Vector< unsigned char > &read_buf) |
Read MQTT Packet from buffer. More... | |
ResponseCode | HandleConnack (const util::Vector< unsigned char > &read_buf) |
Handle MQTT Connack packet. More... | |
ResponseCode | HandlePublish (const util::Vector< unsigned char > &read_buf, bool is_duplicate, bool is_retained, QoS qos) |
Handle MQTT Publish packet. More... | |
ResponseCode | HandlePuback (const util::Vector< unsigned char > &read_buf) |
Handle MQTT Puback packet. More... | |
ResponseCode | HandleSuback (const util::Vector< unsigned char > &read_buf) |
Handle MQTT Suback packet. More... | |
ResponseCode | HandleUnsuback (const util::Vector< unsigned char > &read_buf) |
Handle MQTT Unsuback packet. More... | |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
+std::shared_ptr< NetworkConnection > | p_network_connection_ |
Shared Network Connection instance. | |
+std::atomic_bool | is_waiting_for_connack_ |
Is this waiting for connack? | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
This class defines an Asynchronous action for performing a MQTT Read operation Can run both as a one time operation as well as in a separate thread
+awsiotsdk::mqtt::NetworkReadActionRunner::NetworkReadActionRunner | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +protected | +
rem_len | reference in which to store decoded length |
+
|
+ +protected | +
read_buf | Reference to string buffer containing the MQTT Connack payload |
+
|
+ +protected | +
read_buf | Reference to string buffer containing the MQTT Puback payload |
+
|
+ +protected | +
read_buf | Reference to string buffer containing the MQTT Publish payload |
is_duplicate | MQTT Is Duplicate message flag |
is_retained | MQTT Is retained flag |
qos | QoS of received Publish message |
+
|
+ +protected | +
read_buf | Reference to string buffer containing the MQTT Suback payload |
+
|
+ +protected | +
read_buf | Reference to string buffer containing the MQTT Unsuback payload |
+
|
+ +virtual | +
Performs a Network read to see if there is any incoming MQTT packet in the provided Network Connection's Read buffer. Can be run as a one time operation or as a Client Core thread.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+
|
+ +protected | +
fixed_header_byte | Reference to string in which Fixed header byte should be stored |
read_buf | Reference to string in which the rest of the packet should be stored |
+ AWS IoT C++ SDK
+
+ |
+
Define a base class for all MQTT Packet types. +
+ +#include <Packet.hpp>
+Public Member Functions | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Protected Attributes | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
+
|
+ +inlinevirtual | +
Implements awsiotsdk::ActionData.
+ +
+
|
+ +inlinevirtual | +
action_id | - new Action ID |
Implements awsiotsdk::ActionData.
+ +
+
|
+ +pure virtual | +
Implemented in awsiotsdk::mqtt::ConnectPacket, awsiotsdk::mqtt::DisconnectPacket, awsiotsdk::mqtt::PingreqPacket, awsiotsdk::mqtt::PublishPacket, awsiotsdk::mqtt::PubackPacket, awsiotsdk::mqtt::SubscribePacket, awsiotsdk::mqtt::SubackPacket, awsiotsdk::mqtt::UnsubscribePacket, and awsiotsdk::mqtt::UnsubackPacket.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for the MQTT Fixed header. +
+ +#include <Packet.hpp>
+Public Member Functions | |
PacketFixedHeader () | |
Constructor. More... | |
ResponseCode | Initialize (MessageTypes message_type, bool is_duplicate, QoS qos, bool is_retained, size_t rem_len) |
Initialize the fixed header with provided values. Checks for validity. More... | |
bool | isHeaderValid () |
Is this a valid fixed header? More... | |
MessageTypes | GetMessageType () |
Get message type. More... | |
size_t | GetRemainingLength () |
Get remaining length. More... | |
size_t | GetRemainingLengthByteCount () |
Get number of bytes required to store remaining length. More... | |
size_t | Length () |
Get length of the fixed header. More... | |
void | AppendToBuffer (util::String &p_buf) |
Append this header to a string. More... | |
awsiotsdk::mqtt::PacketFixedHeader::PacketFixedHeader | +( | +) | ++ |
void awsiotsdk::mqtt::PacketFixedHeader::AppendToBuffer | +( | +util::String & | +p_buf | ) | ++ |
p_buf | Reference to target string |
MessageTypes awsiotsdk::mqtt::PacketFixedHeader::GetMessageType | +( | +) | ++ |
+
|
+ +inline | +
size_t awsiotsdk::mqtt::PacketFixedHeader::GetRemainingLengthByteCount | +( | +) | ++ |
ResponseCode awsiotsdk::mqtt::PacketFixedHeader::Initialize | +( | +MessageTypes | +message_type, | +
+ | + | bool | +is_duplicate, | +
+ | + | QoS | +qos, | +
+ | + | bool | +is_retained, | +
+ | + | size_t | +rem_len | +
+ | ) | ++ |
message_type | MQTT message type |
is_duplicate | Is this a duplicate message (For publish messages) |
qos | QoS to use for this message (For publish messages) |
is_retained | MQTT is retained flag (For publish messages) |
rem_len | Remaining length |
bool awsiotsdk::mqtt::PacketFixedHeader::isHeaderValid | +( | +) | ++ |
+
|
+ +inline | +
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | PingreqPacket (const PingreqPacket &)=delete |
+ | PingreqPacket (PingreqPacket &&)=delete |
+PingreqPacket & | operator= (const PingreqPacket &) &=delete |
+PingreqPacket & | operator= (PingreqPacket &&) &=delete |
+ | PingreqPacket () |
Constructor. | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< PingreqPacket > | Create () |
Create Factory method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
+
|
+ +static | +
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for PubackActionAsync. + More...
+ +#include <Publish.hpp>
+Public Member Functions | |
+ | PubackActionAsync (const PubackActionAsync &)=delete |
+ | PubackActionAsync (PubackActionAsync &&)=delete |
+PubackActionAsync & | operator= (const PubackActionAsync &) &=delete |
+PubackActionAsync & | operator= (PubackActionAsync &&) &=delete |
PubackActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Puback Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Puback operation
+awsiotsdk::mqtt::PubackActionAsync::PubackActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Puback Operation in Async mode. This action should be queued up by the HandlePublish function in NetworkRead action automatically whenever a QoS1 packet is received. We do not support QoS2 at this time.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for Puback Packet type. + More...
+ +#include <Publish.hpp>
+Public Member Functions | |
+ | PubackPacket (const PubackPacket &)=delete |
+ | PubackPacket (PubackPacket &&)=delete |
+PubackPacket & | operator= (const PubackPacket &) &=delete |
+PubackPacket & | operator= (PubackPacket &&) &=delete |
PubackPacket (uint16_t publish_packet_id) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
+uint16_t | GetPublishPacketId () |
+void | SetPublishPacketId (uint16_t publish_packet_id) |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< PubackPacket > | Create (uint16_t publish_packet_id) |
Factory Create method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Protected Attributes | |
+std::atomic_uint_fast16_t | publish_packet_id_ |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
This class defines the Packet type used in MQTT to Acknowledge Publish requests
+awsiotsdk::mqtt::PubackPacket::PubackPacket | +( | +uint16_t | +publish_packet_id | ) | ++ |
packet_id | Packet ID for this Puback |
+
|
+ +static | +
packet_id | Packet ID for this Puback |
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for PublishActionAsync. + More...
+ +#include <Publish.hpp>
+Public Member Functions | |
+ | PublishActionAsync (const PublishActionAsync &)=delete |
+ | PublishActionAsync (PublishActionAsync &&)=delete |
+PublishActionAsync & | operator= (const PublishActionAsync &) &=delete |
+PublishActionAsync & | operator= (PublishActionAsync &&) &=delete |
PublishActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Publish Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Publish operation
+awsiotsdk::mqtt::PublishActionAsync::PublishActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Publish Operation in Async mode. For QoS0 operations, the packet is written to the network layer and the operation returns. If the packet has QoS1, and a response handler is provided, the handler will be added to the Pending Acks list.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Publish Message Packet Type. + More...
+ +#include <Publish.hpp>
+Public Member Functions | |
+ | PublishPacket (const PublishPacket &)=delete |
+ | PublishPacket (PublishPacket &&)=delete |
+PublishPacket & | operator= (const PublishPacket &) &=delete |
+PublishPacket & | operator= (PublishPacket &&) &=delete |
PublishPacket (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, QoS qos, const util::String &payload) | |
Constructor, Individual data. More... | |
PublishPacket (const util::Vector< unsigned char > &buf, bool is_retained, bool is_duplicate, QoS qos) | |
Constructor, Deserializes data from buffer. More... | |
bool | IsRetained () |
Get the value of the Is Retained flag. More... | |
bool | IsDuplicate () |
Get the value of the Is Duplicate message flag. More... | |
util::String | GetTopicName () |
Get String containing topic name for this message. More... | |
util::String | GetPayload () |
Get string containing Payload. More... | |
size_t | GetPayloadLen () |
Get length of the payload. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
+QoS | GetQoS () |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< PublishPacket > | Create (std::unique_ptr< Utf8String > p_topic_name, bool is_retained, bool is_duplicate, QoS qos, const util::String &payload) |
Create Factory method using Individual data. More... | |
static std::shared_ptr< PublishPacket > | Create (const util::Vector< unsigned char > &buf, bool is_retained, bool is_duplicate, QoS qos) |
Create Factory method which deserializes data from a buffer. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Protected Attributes | |
+bool | is_retained_ |
Retained messages are NOT supported by the AWS IoT Service at the time of this SDK release. | |
+bool | is_duplicate_ |
Is this message a duplicate QoS > 0 message? Handled automatically by the MQTT client. | |
+QoS | qos_ |
Message Quality of Service. | |
+std::unique_ptr< Utf8String > | p_topic_name_ |
Topic Name this packet was published to. | |
+util::String | payload_ |
MQTT message payload. | |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
Defines a type for MQTT Publish messages. Used for both incoming and out going messages
+awsiotsdk::mqtt::PublishPacket::PublishPacket | +( | +std::unique_ptr< Utf8String > | +p_topic_name, | +
+ | + | bool | +is_retained, | +
+ | + | bool | +is_duplicate, | +
+ | + | QoS | +qos, | +
+ | + | const util::String & | +payload | +
+ | ) | ++ |
p_topic_name | Topic name on which message is to be published |
is_retained | Is retained flag |
is_duplicate | Is duplicate message flag |
qos | QoS to use for this message, QoS2 is not supported currently |
payload | String containing payload to send with message. Can be zero length. |
awsiotsdk::mqtt::PublishPacket::PublishPacket | +( | +const util::Vector< unsigned char > & | +buf, | +
+ | + | bool | +is_retained, | +
+ | + | bool | +is_duplicate, | +
+ | + | QoS | +qos | +
+ | ) | ++ |
buf | Buffer containing packet data |
is_retained | Is retained flag |
is_duplicate | Is duplicate message flag |
qos | QoS used by this message |
+
|
+ +static | +
buf | Buffer containing packet data |
is_retained | Is retained flag |
is_duplicate | Is duplicate message flag |
qos | QoS used by this message |
+
|
+ +static | +
p_topic_name | Topic name on which message is to be published |
is_retained | Is retained flag |
is_duplicate | Is duplicate message flag |
qos | QoS to use for this message, QoS2 is not supported currently |
payload | String containing payload to send with message. Can be zero length |
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for Suback Packet type. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | SubackPacket (const SubackPacket &)=delete |
+ | SubackPacket (SubackPacket &&)=delete |
+SubackPacket & | operator= (const SubackPacket &) &=delete |
+SubackPacket & | operator= (SubackPacket &&) &=delete |
SubackPacket (const util::Vector< unsigned char > &buf) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< SubackPacket > | Create (const util::Vector< unsigned char > &buf) |
Factory Create method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Data Fields | |
+util::Vector< uint8_t > | suback_list_ |
Vector containing subacks included in this packet. | |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
This class defines the Packet type used in MQTT to Acknowledge Subscribe requests
+awsiotsdk::mqtt::SubackPacket::SubackPacket | +( | +const util::Vector< unsigned char > & | +buf | ) | ++ |
buf | Serialized version of the packet to parse |
+
|
+ +static | +
buf | Serialized version of the packet to parse |
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for SubscribeActionAsync. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | SubscribeActionAsync (const SubscribeActionAsync &)=delete |
+ | SubscribeActionAsync (SubscribeActionAsync &&)=delete |
+SubscribeActionAsync & | operator= (const SubscribeActionAsync &) &=delete |
+SubscribeActionAsync & | operator= (SubscribeActionAsync &&) &=delete |
SubscribeActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Subscribe Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Subscribe operation
+awsiotsdk::mqtt::SubscribeActionAsync::SubscribeActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Subscribe Operation in Async mode. Registers the Subscriptions in the subscribe packet and sets them as inactive. Will NOT wait for SUBACK. Whenever SUBACK is received by the Network Read operation, the Subscriptions will be activated/removed depending on response.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for Subscribe Packet type. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | SubscribePacket (const SubscribePacket &)=delete |
+ | SubscribePacket (SubscribePacket &&)=delete |
+SubscribePacket & | operator= (const SubscribePacket &) &=delete |
+SubscribePacket & | operator= (SubscribePacket &&) &=delete |
SubscribePacket (util::Vector< std::shared_ptr< Subscription > > subscription_list) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< SubscribePacket > | Create (util::Vector< std::shared_ptr< Subscription > > subscription_list) |
Factory Create method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Data Fields | |
+util::Vector< std::shared_ptr< Subscription > > | subscription_list_ |
Vector containing subscriptions included in this packet. | |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
This class defines the Packet type used by MQTT Subscribe requests
+awsiotsdk::mqtt::SubscribePacket::SubscribePacket | +( | +util::Vector< std::shared_ptr< Subscription > > | +subscription_list | ) | ++ |
subscription_list | Vector of subscriptions to be included in this Subscribe packet |
+
|
+ +static | +
subscription_list | Vector of subscriptions to be included in this Subscribe packet |
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
MQTT Subscription Definition. + More...
+ +#include <Common.hpp>
+Public Types | |
typedef std::function< ResponseCode(util::String topic_name, util::String payload, std::shared_ptr< SubscriptionHandlerContextData > p_app_handler_data)> | ApplicationCallbackHandlerPtr |
Define handler for Application Callbacks. More... | |
+Public Member Functions | |
+ | Subscription (const Subscription &)=default |
+ | Subscription (Subscription &&)=default |
+Subscription & | operator= (const Subscription &) &=default |
+Subscription & | operator= (Subscription &&) &=default |
Subscription (std::unique_ptr< Utf8String > p_topic_name, QoS max_qos, ApplicationCallbackHandlerPtr p_app_handler, std::shared_ptr< SubscriptionHandlerContextData > p_app_handler_data) | |
Constructor. More... | |
bool | IsActive () |
Is Subscription Active? More... | |
void | SetActive (bool value) |
Set Subscription status. More... | |
uint16_t | GetPacketId () |
Get Packet ID for this subscription's Subscribe request. More... | |
void | SetAckIndex (uint16_t packet_id, uint8_t index_in_packet) |
Set expected index of Ack for this Subscription in the SUBACK packet. More... | |
QoS | GetMaxQos () |
Get Max QoS for this subscription. More... | |
void | SetMaxQos (mqtt::QoS max_qos) |
Set Max QoS for this subscription. More... | |
size_t | GetTopicNameLength () |
Get Length of topic name for this subscription. More... | |
std::shared_ptr< Utf8String > | GetTopicName () |
Get Topic Name. More... | |
bool | IsInSuback (uint16_t packet_id, uint8_t index_in_packet) |
Is this subscription in the Suback with given packet ID and index. More... | |
+Static Public Member Functions | |
static std::shared_ptr< Subscription > | Create (std::unique_ptr< Utf8String > p_topic_name, QoS max_qos, ApplicationCallbackHandlerPtr p_app_handler, std::shared_ptr< SubscriptionHandlerContextData > p_app_handler_data) |
Factory method to create a Subscription instance. More... | |
static bool | IsValidTopicName (util::String p_topic_name) |
Is the Topic Name Valid? More... | |
+Data Fields | |
+ApplicationCallbackHandlerPtr | p_app_handler_ |
Pointer to the Application Handler. | |
+std::shared_ptr< SubscriptionHandlerContextData > | p_app_handler_data_ |
Data to be passed to the Application Handler. | |
+util::String | p_topic_regex_ |
Topic regex string which is used if the topic is a wildcard topic. | |
+Protected Attributes | |
+bool | is_active_ |
Boolean indicating weather the subscription is active or not. | |
+uint16_t | packet_id_ |
Packet Id of the Subscribe/Unsubscribe Packet. | |
+uint8_t | index_in_packet_ |
Index of the subscription in the Subscribe/Unsubscribe Packet. | |
+QoS | max_qos_ |
Max QoS for messages on this subscription. | |
+std::shared_ptr< Utf8String > | p_topic_name_ |
Topic Name for this subscription. | |
Defining a type for the MQTT Subscriptions Contains all information required to process a subscription including callback handler
+typedef std::function<ResponseCode(util::String topic_name, util::String payload, std::shared_ptr<SubscriptionHandlerContextData> p_app_handler_data)> awsiotsdk::mqtt::Subscription::ApplicationCallbackHandlerPtr | +
This handler is used to provide notification to the application when a message is received on a subscribed topic
+ +awsiotsdk::mqtt::Subscription::Subscription | +( | +std::unique_ptr< Utf8String > | +p_topic_name, | +
+ | + | QoS | +max_qos, | +
+ | + | ApplicationCallbackHandlerPtr | +p_app_handler, | +
+ | + | std::shared_ptr< SubscriptionHandlerContextData > | +p_app_handler_data | +
+ | ) | ++ |
p_topic_name | - Topic name for this subscription |
max_qos | - Max QoS |
p_app_handler | - Application Handler instance |
p_app_handler_data | - Data to be passed to application handler. Can be nullptr |
+
|
+ +static | +
p_topic_name | - Topic name for this subscription |
max_qos | - Max QoS |
p_app_handler | - Application Handler instance |
p_app_handler_data | - Data to be passed to application handler. Can be nullptr |
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
packet_id | - Packet ID of received SUBACK |
index_in_packet | - Index in SUBACK |
+
|
+ +static | +
+
|
+ +inline | +
packet_id | - Expected packet id |
index_in_packet | - Expected Index in packet |
+
|
+ +inline | +
value | - boolean value indicating target status |
+
|
+ +inline | +
max_qos | Target QoS value |
+ AWS IoT C++ SDK
+
+ |
+
MQTT Subscription Handler Context Data. + More...
+ +#include <Common.hpp>
This class can be used to provide customer context data to be provided with each Subscription Handler call. Uses a pure virtual destructor to allow for polymorphism
+
+ AWS IoT C++ SDK
+
+ |
+
Define a class for Unsuback Packet type. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | UnsubackPacket (const UnsubackPacket &)=delete |
+ | UnsubackPacket (UnsubackPacket &&)=delete |
+UnsubackPacket & | operator= (const UnsubackPacket &) &=delete |
+UnsubackPacket & | operator= (UnsubackPacket &&) &=delete |
UnsubackPacket (const util::Vector< unsigned char > &buf) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< UnsubackPacket > | Create (const util::Vector< unsigned char > &buf) |
Factory Create method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
This class defines the Packet type used in MQTT to Acknowledge Unsubscribe requests
+awsiotsdk::mqtt::UnsubackPacket::UnsubackPacket | +( | +const util::Vector< unsigned char > & | +buf | ) | ++ |
buf | Serialized version of the packet to parse |
+
|
+ +static | +
buf | Serialized version of the packet to parse |
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for UnsubscribeActionAsync. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | UnsubscribeActionAsync (const UnsubscribeActionAsync &)=delete |
+ | UnsubscribeActionAsync (UnsubscribeActionAsync &&)=delete |
+UnsubscribeActionAsync & | operator= (const UnsubscribeActionAsync &) &=delete |
+UnsubscribeActionAsync & | operator= (UnsubscribeActionAsync &&) &=delete |
UnsubscribeActionAsync (std::shared_ptr< ClientState > p_client_state) | |
Constructor. More... | |
ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data) |
Perform MQTT Unsubscribe Action in Async mode. More... | |
![]() | |
ActionType | GetActionType () |
Get Type of this Action. More... | |
util::String | GetActionInfo () |
Get information/description about the current action. More... | |
void | SetParentThreadSync (std::shared_ptr< std::atomic_bool > p_thread_continue) |
Sets the parent thread sync variable. More... | |
virtual ResponseCode | PerformAction (std::shared_ptr< NetworkConnection > p_network_connection, std::shared_ptr< ActionData > p_action_data)=0 |
Virtual base function for Performing Action. More... | |
+ | Action (const Action &)=delete |
+ | Action (Action &&)=delete |
+Action & | operator= (const Action &) &=delete |
+Action & | operator= (Action &&) &=delete |
Action (ActionType action_type, util::String action_info_string) | |
Action Constructor. More... | |
+Static Public Member Functions | |
static std::unique_ptr< Action > | Create (std::shared_ptr< ActionState > p_action_state) |
Factory Create method. More... | |
+Protected Attributes | |
+std::shared_ptr< ClientState > | p_client_state_ |
Shared Client State instance. | |
![]() | |
+ActionType | action_type_ |
Type of the action. | |
+util::String | action_info_string_ |
Info string. | |
+std::shared_ptr< std::atomic_bool > | p_thread_continue_ |
Shared atomic variable used for sync when action is run in separate thread. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< std::unique_ptr< Action >(std::shared_ptr< ActionState > p_action_state)> | CreateHandlerPtr |
![]() | |
ResponseCode | ReadFromNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, util::Vector< unsigned char > &read_buf, size_t bytes_to_read) |
Generic Network Read function for all actions. More... | |
ResponseCode | WriteToNetworkBuffer (std::shared_ptr< NetworkConnection > p_network_connection, const util::String &write_buf) |
Generic Network Write function for all actions. More... | |
This class defines an Asynchronous action for performing a MQTT Unsubscribe operation
+awsiotsdk::mqtt::UnsubscribeActionAsync::UnsubscribeActionAsync | +( | +std::shared_ptr< ClientState > | +p_client_state | ) | ++ |
p_client_state | - Shared Client State instance |
+
|
+ +static | +
p_client_state | - Shared Client State instance |
+
|
+ +virtual | +
Performs the MQTT Unsubscribe Operation in Async mode. Does NOT deactivate or deregister active subscriptions. Does modify subscription information to keep track of which packet ID the unsuback request is using. Will NOT wait for UNSUBACK. Whenever UNSUBACK is received by the Network Read operation, the Subscriptions will be removed.
+p_network_connection | - Network connection instance to use for performing this action |
p_action_data | - Action data specific to this execution of the Action |
Implements awsiotsdk::Action.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Define a class for Unsubscribe Packet type. + More...
+ +#include <Subscribe.hpp>
+Public Member Functions | |
+ | UnsubscribePacket (const UnsubscribePacket &)=delete |
+ | UnsubscribePacket (UnsubscribePacket &&)=delete |
+UnsubscribePacket & | operator= (const UnsubscribePacket &) &=delete |
+UnsubscribePacket & | operator= (UnsubscribePacket &&) &=delete |
UnsubscribePacket (util::Vector< std::unique_ptr< Utf8String > > topic_list) | |
Constructor. More... | |
util::String | ToString () |
Serialize this packet into a String. More... | |
![]() | |
+ | Packet (const Packet &)=delete |
+ | Packet (Packet &&)=delete |
+Packet & | operator= (const Packet &) &=delete |
+Packet & | operator= (Packet &&) &=delete |
uint16_t | GetActionId () |
Get ID of the current run of this Action. More... | |
void | SetActionId (uint16_t action_id) |
Set the Action ID for this run of the Action. More... | |
+bool | isPacketDataValid () |
+uint16_t | GetPacketId () |
+void | SetPacketId (uint16_t packet_id) |
+size_t | Size () |
virtual util::String | ToString ()=0 |
![]() | |
+ | ActionData (const ActionData &)=default |
+ | ActionData (ActionData &&)=default |
+ActionData & | operator= (const ActionData &) &=default |
+ActionData & | operator= (ActionData &&) &=default |
virtual uint16_t | GetActionId ()=0 |
Get ID of the current run of this Action. More... | |
virtual void | SetActionId (uint16_t action_id)=0 |
Set the Action ID for this run of the Action. More... | |
+Static Public Member Functions | |
static std::shared_ptr< UnsubscribePacket > | Create (util::Vector< std::unique_ptr< Utf8String > > topic_list) |
Factory Create method. More... | |
![]() | |
+static void | AppendUInt16ToBuffer (util::String &buf, uint16_t value) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str) |
+static void | AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str) |
+static uint16_t | ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+static std::unique_ptr< Utf8String > | ReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index) |
+Data Fields | |
+util::Vector< std::unique_ptr< Utf8String > > | topic_list_ |
![]() | |
+AsyncAckNotificationHandlerPtr | p_async_ack_handler_ |
Handler to call when response is received for this action. | |
+Additional Inherited Members | |
![]() | |
typedef std::function< void(uint16_t action_id, ResponseCode rc)> | AsyncAckNotificationHandlerPtr |
![]() | |
+PacketFixedHeader | fixed_header_ |
Fixed header for this packet instance. | |
+size_t | packet_size_ |
Size of the packet. | |
+size_t | serialized_packet_length_ |
Serialized length of the entire packet including fixed header. | |
+std::atomic_uint_fast16_t | packet_id_ |
Message sequence identifier. Handled automatically by the MQTT client. | |
This class defines the Packet type used by MQTT Unsubscribe requests
+awsiotsdk::mqtt::UnsubscribePacket::UnsubscribePacket | +( | +util::Vector< std::unique_ptr< Utf8String > > | +topic_list | ) | ++ |
topic_list | Vector of topic names to be included in this Unsubscribe packet |
+
|
+ +static | +
topic_list | Vector of topic names to be included in this Unsubscribe packet |
+
|
+ +virtual | +
Implements awsiotsdk::mqtt::Packet.
+ +
+ AWS IoT C++ SDK
+
+ |
+
Last Will and Testament Definition. + More...
+ +#include <Common.hpp>
+Public Member Functions | |
WillOptions (bool is_retained, QoS qos, std::unique_ptr< Utf8String > p_topic_name, util::String &message) | |
Constructor. More... | |
+ | WillOptions (WillOptions &&)=default |
+WillOptions & | operator= (WillOptions &&) &=default |
+ | WillOptions (const WillOptions &source) |
+WillOptions & | operator= (const WillOptions &source) & |
size_t | Length () |
Get length of Will Options message. More... | |
void | WriteToBuffer (util::String &buf) |
Serialize and write Will Options to provided buffer. More... | |
void | SetConnectFlags (unsigned char &p_flag) |
Set Connect flags in the provided buffer based on Will Options instance. More... | |
+Static Public Member Functions | |
static std::unique_ptr< WillOptions > | Create (bool is_retained, QoS qos, std::unique_ptr< Utf8String > p_topic_name, util::String &message) |
Factory method to Create a Will Options instance. More... | |
Defining a type for the MQTT "Last Will and Testament" (LWT) parameters.
awsiotsdk::mqtt::WillOptions::WillOptions | +( | +bool | +is_retained, | +
+ | + | QoS | +qos, | +
+ | + | std::unique_ptr< Utf8String > | +p_topic_name, | +
+ | + | util::String & | +message | +
+ | ) | ++ |
is_retained | - MQTT Is Retained flag |
qos | - QoS for the Will Message |
p_topic_name | - Topic name on which to publish the will message |
p_message | - Payload of the message to publish |
+
|
+ +static | +
is_retained | - MQTT Is Retained flag |
qos | - QoS for the Will Message |
p_topic_name | - Topic name on which to publish the will message |
p_message | - Payload of the message to publish |
size_t awsiotsdk::mqtt::WillOptions::Length | +( | +) | ++ |
void awsiotsdk::mqtt::WillOptions::SetConnectFlags | +( | +unsigned char & | +p_flag | ) | ++ |
p_flag | Target buffer |
void awsiotsdk::mqtt::WillOptions::WriteToBuffer | +( | +util::String & | +buf | ) | ++ |
buf | - Reference to target buffer |
+ AWS IoT C++ SDK
+
+ |
+
+Static Public Member Functions | |
+static ResponseCode | InitializeFromJsonFile (JsonDocument &json_document, const util::String &input_file_path) |
+static ResponseCode | InitializeFromJsonString (JsonDocument &json_document, const util::String &input_json_string) |
+static ResponseCode | GetBoolValue (const JsonDocument &json_document, const char *key, bool &value) |
+static ResponseCode | GetIntValue (const JsonDocument &json_document, const char *key, int &value) |
+static ResponseCode | GetUint16Value (const JsonDocument &json_document, const char *key, uint16_t &value) |
+static ResponseCode | GetUint32Value (const JsonDocument &json_document, const char *key, uint32_t &value) |
+static ResponseCode | GetSizeTValue (const JsonDocument &json_document, const char *key, size_t &value) |
+static ResponseCode | GetCStringValue (const JsonDocument &json_document, const char *key, char *value, uint16_t max_string_len) |
+static ResponseCode | GetStringValue (const JsonDocument &json_document, const char *key, util::String &value) |
+static rapidjson::ParseErrorCode | GetParseErrorCode (const JsonDocument &json_document) |
+static size_t | GetParseErrorOffset (const JsonDocument &json_document) |
+static ResponseCode | MergeValues (JsonValue &target, JsonValue &source, JsonValue::AllocatorType &allocator) |
+static ResponseCode | DiffValues (JsonValue &target_doc, JsonValue &old_doc, JsonValue &new_doc, JsonValue::AllocatorType &allocator) |
+static util::String | ToString (JsonDocument &json_document) |
+static util::String | ToString (JsonValue &json_value) |
+static ResponseCode | WriteToFile (JsonDocument &json_document, const util::String &output_file_path) |
+ AWS IoT C++ SDK
+
+ |
+
#include <ConsoleLogSystem.hpp>
+Public Types | |
+using | Base = FormattedLogSystem |
![]() | |
+using | Base = LogSystemInterface |
+Public Member Functions | |
+ | ConsoleLogSystem (LogLevel logLevel) |
![]() | |
FormattedLogSystem (LogLevel logLevel) | |
virtual LogLevel | GetLogLevel (void) const override |
void | SetLogLevel (LogLevel logLevel) |
virtual void | Log (LogLevel logLevel, const char *tag, const char *function, unsigned int line, const char *formatStr,...) override |
virtual void | LogStream (LogLevel logLevel, const char *tag, const util::OStringStream &messageStream) override |
virtual LogLevel | GetLogLevel (void) const =0 |
virtual void | Log (LogLevel logLevel, const char *tag, const char *function, unsigned int line, const char *formatStr,...)=0 |
virtual void | LogStream (LogLevel logLevel, const char *tag, const util::OStringStream &messageStream)=0 |
+Protected Member Functions | |
virtual void | ProcessFormattedStatement (util::String &&statement) override |
virtual void | ProcessFormattedStatement (util::String &&statement)=0 |
Log system interface that logs to std::cout
+
+
|
+ +overrideprotectedvirtual | +
This is the method that most logger implementations will want to override. At this point the message is formatted and is ready to go to the output stream
+ +Implements awsiotsdk::util::Logging::FormattedLogSystem.
+ +
+ AWS IoT C++ SDK
+
+ |
+
#include <FormattedLogSystem.hpp>
+Public Types | |
+using | Base = LogSystemInterface |
+Public Member Functions | |
FormattedLogSystem (LogLevel logLevel) | |
virtual LogLevel | GetLogLevel (void) const override |
void | SetLogLevel (LogLevel logLevel) |
virtual void | Log (LogLevel logLevel, const char *tag, const char *function, unsigned int line, const char *formatStr,...) override |
virtual void | LogStream (LogLevel logLevel, const char *tag, const util::OStringStream &messageStream) override |
virtual LogLevel | GetLogLevel (void) const =0 |
virtual void | Log (LogLevel logLevel, const char *tag, const char *function, unsigned int line, const char *formatStr,...)=0 |
virtual void | LogStream (LogLevel logLevel, const char *tag, const util::OStringStream &messageStream)=0 |
+Protected Member Functions | |
virtual void | ProcessFormattedStatement (util::String &&statement)=0 |
Logger that formats log messages into [LEVEL] timestamp [threadid] message
+FormattedLogSystem::FormattedLogSystem | +( | +LogLevel | +logLevel | ) | ++ |
Initializes log system with logLevel
+ +
+
|
+ +inlineoverridevirtual | +
Gets the currently configured log level.
+ +Implements awsiotsdk::util::Logging::LogSystemInterface.
+ +
+
|
+ +overridevirtual | +
Does a printf style output to ProcessFormattedStatement. Don't use this, it's unsafe. See LogStream
+ +Implements awsiotsdk::util::Logging::LogSystemInterface.
+ +
+
|
+ +overridevirtual | +
Writes the stream to ProcessFormattedStatement.
+ +Implements awsiotsdk::util::Logging::LogSystemInterface.
+ +
+
|
+ +protectedpure virtual | +
This is the method that most logger implementations will want to override. At this point the message is formatted and is ready to go to the output stream
+ +Implemented in awsiotsdk::util::Logging::ConsoleLogSystem.
+ +
+
|
+ +inline | +
Set a new log level. This has the immediate effect of changing the log output to the new level.
+ +
+ AWS IoT C++ SDK
+
+ |
+
#include <LogSystemInterface.hpp>
+Public Member Functions | |
virtual LogLevel | GetLogLevel (void) const =0 |
virtual void | Log (LogLevel logLevel, const char *tag, const char *function, unsigned int line, const char *formatStr,...)=0 |
virtual void | LogStream (LogLevel logLevel, const char *tag, const util::OStringStream &messageStream)=0 |
Interface for logging implementations. If you want to write your own logger, you can start here, though you may have more luck going down one more level to FormattedLogSystem. It does a bit more of the work for you and still gives you the ability to override the IO portion.
+
+
|
+ +pure virtual | +
Gets the currently configured log level for this logger.
+ +Implemented in awsiotsdk::util::Logging::FormattedLogSystem.
+ +
+
|
+ +pure virtual | +
Does a printf style output to the output stream. Don't use this, it's unsafe. See LogStream
+ +Implemented in awsiotsdk::util::Logging::FormattedLogSystem.
+ +
+
|
+ +pure virtual | +
Writes the stream to the output stream.
+ +Implemented in awsiotsdk::util::Logging::FormattedLogSystem.
+ +
+ AWS IoT C++ SDK
+
+ |
+
+Public Member Functions | |
+ | ThreadTask (DestructorAction destructor_action, std::shared_ptr< std::atomic_bool > sync_point, util::String thread_descriptor) |
+ | ThreadTask (const ThreadTask &)=delete |
+ThreadTask & | operator= (const ThreadTask &)=delete |
+ | ThreadTask (ThreadTask &&)=delete |
+ThreadTask & | operator= (ThreadTask &&)=delete |
+template<class Fn , class ... Args> | |
void | Run (Fn &&fn, Args &&... args) |
+void | Stop () |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | ConsoleLogSystem.cpp |
file | FormattedLogSystem.cpp |
file | Logging.cpp |
file | LogLevel.cpp |
+ AWS IoT C++ SDK
+
+ |
+
+Directories | |
directory | stl |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Client.cpp |
file | ClientState.cpp |
file | Common.cpp |
file | Connect.cpp |
file | NetworkRead.cpp |
file | Packet.cpp |
file | Publish.cpp |
MQTT Publish and Puback Actions and Action data definitions for IoT Client. | |
file | Subscribe.cpp |
MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client. | |
+ AWS IoT C++ SDK
+
+ |
+
+Directories | |
directory | logging |
directory | threading |
+Files | |
file | Core_EXPORTS.hpp [code] |
file | JsonParser.hpp [code] |
file | Utf8String.hpp [code] |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Jobs.cpp |
+ AWS IoT C++ SDK
+
+ |
+
+Directories | |
directory | discovery |
directory | jobs |
directory | mqtt |
directory | shadow |
directory | util |
+Files | |
file | Action.cpp |
Action Base class and related definitions for IoT Client. | |
file | ClientCore.cpp |
file | ClientCoreState.cpp |
file | NetworkConnection.cpp |
Network interface base class for IoT Client. | |
file | ResponseCode.cpp |
Response Code class with helper functions. | |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Shadow.hpp [code] |
This file defines a shadow type for AWS IoT Shadow operations. | |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Map.hpp [code] |
file | Queue.hpp [code] |
file | String.hpp [code] |
file | StringStream.hpp [code] |
file | Vector.hpp [code] |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Client.hpp [code] |
Contains the MQTT Client class. | |
file | ClientState.hpp [code] |
file | Common.hpp [code] |
Common class definitions for the MQTT Client. | |
file | Connect.hpp [code] |
file | GreengrassMqttClient.hpp [code] |
Contains the MQTT Client class for AWS Greengrass devices. | |
file | NetworkRead.hpp [code] |
file | Packet.hpp [code] |
file | Publish.hpp [code] |
MQTT Publish and Puback Actions and Action data definitions for IoT Client. | |
file | Subscribe.hpp [code] |
MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client. | |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | ConsoleLogSystem.hpp [code] |
file | FormattedLogSystem.hpp [code] |
file | Logging.hpp [code] |
file | LogLevel.hpp [code] |
file | LogMacros.hpp [code] |
file | LogSystemInterface.hpp [code] |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Shadow.cpp |
+ AWS IoT C++ SDK
+
+ |
+
+Directories | |
directory | logging |
directory | threading |
+Files | |
file | JsonParser.cpp |
file | Utf8String.cpp |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | ConfigCommon.cpp |
file | ConfigCommon.hpp [code] |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | ThreadTask.cpp |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Discovery.hpp [code] |
file | DiscoveryResponse.hpp [code] |
Contains constant strings used as keys in the discovery response JSON. | |
+ AWS IoT C++ SDK
+
+ |
+
+Directories | |
directory | discovery |
directory | jobs |
directory | mqtt |
directory | shadow |
directory | util |
+Files | |
file | Action.hpp [code] |
Action Base class and related definitions for IoT Client. | |
file | ClientCore.hpp [code] |
Contains the Client Core class. | |
file | ClientCoreState.hpp [code] |
file | NetworkConnection.hpp [code] |
Network interface base class for IoT Client. | |
file | ResponseCode.hpp [code] |
Strongly typed enumeration of return values from functions within the SDK. | |
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | ThreadTask.hpp [code] |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+Files | |
file | Discovery.cpp |
file | DiscoveryResponse.cpp |
+ AWS IoT C++ SDK
+
+ |
+
▼ common | |
ConfigCommon.cpp | |
ConfigCommon.hpp | |
▼ include | |
▼ discovery | |
Discovery.hpp | |
DiscoveryResponse.hpp | Contains constant strings used as keys in the discovery response JSON |
▼ jobs | |
Jobs.hpp | |
▼ mqtt | |
Client.hpp | Contains the MQTT Client class |
ClientState.hpp | |
Common.hpp | Common class definitions for the MQTT Client |
Connect.hpp | |
GreengrassMqttClient.hpp | Contains the MQTT Client class for AWS Greengrass devices |
NetworkRead.hpp | |
Packet.hpp | |
Publish.hpp | MQTT Publish and Puback Actions and Action data definitions for IoT Client |
Subscribe.hpp | MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client |
▼ shadow | |
Shadow.hpp | This file defines a shadow type for AWS IoT Shadow operations |
▼ util | |
▼ logging | |
ConsoleLogSystem.hpp | |
FormattedLogSystem.hpp | |
Logging.hpp | |
LogLevel.hpp | |
LogMacros.hpp | |
LogSystemInterface.hpp | |
▼ memory | |
▼ stl | |
Map.hpp | |
Queue.hpp | |
String.hpp | |
StringStream.hpp | |
Vector.hpp | |
▼ threading | |
ThreadTask.hpp | |
Core_EXPORTS.hpp | |
JsonParser.hpp | |
Utf8String.hpp | |
Action.hpp | Action Base class and related definitions for IoT Client |
ClientCore.hpp | Contains the Client Core class |
ClientCoreState.hpp | |
NetworkConnection.hpp | Network interface base class for IoT Client |
ResponseCode.hpp | Strongly typed enumeration of return values from functions within the SDK |
▼ src | |
▼ discovery | |
Discovery.cpp | |
DiscoveryResponse.cpp | |
▼ jobs | |
Jobs.cpp | |
▼ mqtt | |
Client.cpp | |
ClientState.cpp | |
Common.cpp | |
Connect.cpp | |
NetworkRead.cpp | |
Packet.cpp | |
Publish.cpp | MQTT Publish and Puback Actions and Action data definitions for IoT Client |
Subscribe.cpp | MQTT Subscribe and Unsubscribe Actions and Action data definitions for IoT Client |
▼ shadow | |
Shadow.cpp | |
▼ util | |
▼ logging | |
ConsoleLogSystem.cpp | |
FormattedLogSystem.cpp | |
Logging.cpp | |
LogLevel.cpp | |
▼ threading | |
ThreadTask.cpp | |
JsonParser.cpp | |
Utf8String.cpp | |
Action.cpp | Action Base class and related definitions for IoT Client |
ClientCore.cpp | |
ClientCoreState.cpp | |
NetworkConnection.cpp | Network interface base class for IoT Client |
ResponseCode.cpp | Response Code class with helper functions |
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
+ AWS IoT C++ SDK
+
+ |
+
A new AWS IoT Device SDK is now available. It is a complete rework, built to improve reliability, performance, and security. We invite your feedback!
+This SDK will no longer receive feature updates, but will receive security updates.
+This document provides information about the AWS IoT device SDK for C++.
+ +The Device SDK simplifies access to the Pub/Sub functionality of the AWS IoT broker via MQTT and provides APIs to interact with Thing Shadows. The SDK has been tested to work with the AWS IoT platform to ensure best interoperability of a device with the AWS IoT platform.
+The Device SDK provides functionality to create and maintain a MQTT Connection. It expects to be provided with a Network Connection class that connects and authenticates to AWS IoT using either direct TLS or WebSocket over TLS. This connection is used for any further publish operations. It also allows for subscribing to MQTT topics which will call a configurable callback function when these messages are received on these topics.
+This SDK implements the specific protocol for Thing Shadows to retrieve, update and delete Thing Shadows adhering to the protocol that is implemented to ensure correct versioning and support for client tokens. It abstracts the necessary MQTT topic subscriptions by automatically subscribing to and unsubscribing from the reserved topics as needed for each API call. Inbound state change requests are automatically signalled via a configurable callback.
+This SDK also implements the Jobs protocol to interact with the AWS IoT Jobs service. The IoT Job service manages deployment of IoT fleet wide tasks such as device software/firmware deployments and updates, rotation of security certificates, device reboots, and custom device specific management tasks. For additional information please see the Jobs developer guide.
+ +The C++ SDK was specifically designed for devices that are not resource constrained and required advanced features such as Message queueing, multi-threading support and the latest language features
+Primary aspects are:
Beginning with Release v1.2.0 of the SDK, AWS collects usage metrics indicating which language and version of the SDK is being used. This allows us to prioritize our resources towards addressing issues faster in SDKs that see the most and is an important data point. However, we do understand that not all customers would want to report this data by default. In that case, the sending of usage metrics can be easily disabled by the user by using the overloaded Connect action which takes in a boolean for enabling or disabling the SDK metrics:
Ensure you understand the AWS IoT platform and create the necessary certificates and policies. For more information on the AWS IoT platform please visit the AWS IoT developer guide.
+ +This section explains the individual steps to retrieve the necessary files and be able to build your first application using the AWS IoT C++ SDK. The SDK uses CMake to generate the necessary Makefile. CMake version 3.2 and above is required.
+Prerequisites:
+Build Targets:
+aws-iot-sdk-cpp
aws-iot-unit-tests
aws-iot-integration-tests
pub-sub-sample
shadow-delta-sample
This following sample targets are generated only if OpenSSL is being used:
discovery-sample
.robot-arm-sample
.switch-sample
Steps:
+build
to hold the build files and change to this folder. In-source builds are NOT allowedcmake ../.
to build the SDK with the CLI.make <target name>
to build the desired target. It will create a folder called bin
that will have the build outputThe SDK has been written to adhere to C++11 standard without any additional compiler specific features enabled. It should compile on any platform that has a modern C++11 enabled compiler without issue. The platform should be able to provide a C++11 compatible threading implementation (eg. pthread on linux). TLS libraries can be added by simply implementing a derived class of NetworkConnection and providing an instance to the Client. We provide the following reference implementations for the Network layer:
+The included ToolchainFile.cmake file can be used to cross-compile the SDK for other platforms. Procedure for testing cross compiling (if using OpenSSL):
+network/CMakeLists.txt.in
and change OpenSSL library location to cross-compiled OpenSSL5.
./<application>
For MbedTLS, you don't need to cross-compile MbedTLS as it gets compiled when you run make
with the same compiler as pointed to by the toolchain file.
Also included is a simple example 'toolchain' which is used for setting the default compiler as clang++ instead of g++ as an example to show how the toolchain file can be modified.
+ +Creating a basic MQTT Client requires a NetworkConnection instance and MQTT Command timeout in milliseconds for any internal blocking operations.
+Connecting to the AWS IoT MQTT platform
+Subscribe to a topic
+Publish to a topic
Unsubscribe from a topic
+Connect is a sync only API in this version of the SDK. Subscribe to a topic
+Publish to a topic
Unsubscribe from a topic
+To enable logging, create an instance of the ConsoleLogSystem in the main() of your application as shown below:
+Create a log tag for your application to distinguish it from the SDK logs:
You can now add logging to any part of your application using AWS_LOG_ERROR or AWS_LOG_INFO as shown below:
+This SDK is distributed under the Apache License, Version 2.0, see LICENSE and NOTICE.txt for more information.
+ +If you have any technical questions about AWS IoT C++ SDK, use the AWS IoT forum. For any other questions on AWS IoT, contact AWS Support.
+A list of known issues is maintained in KnownIssues.md.
+Note: customers have reported deadlocks while using the AWS IoT Device SDK for C++. If you are affected, a fix is available in the locking-fixes branch. This issue is also resolved in the new AWS IoT Device SDK for C++, which is currently in Developer Preview.
+