|
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... | |
Public Member Functions inherited from awsiotsdk::Action | |
| 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... | |
Protected Member Functions inherited from awsiotsdk::Action | |
| 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. | |
Protected Attributes inherited from awsiotsdk::Action | |
| 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 | |
Public Types inherited from awsiotsdk::Action | |
| 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 |