LibAwsIot
Documentation for LibAwsIot.
LibAwsIot.AWS_C_IOTDEVICE_PACKAGE_ID
LibAwsIot.AWS_IOT_ST_FIELD_NUMBER_SHIFT
LibAwsIot.AWS_IOT_ST_MAXIMUM_1_BYTE_VARINT_VALUE
LibAwsIot.AWS_IOT_ST_MAXIMUM_2_BYTE_VARINT_VALUE
LibAwsIot.AWS_IOT_ST_MAXIMUM_3_BYTE_VARINT_VALUE
LibAwsIot.AWS_IOT_ST_MAXIMUM_VARINT
LibAwsIot.AWS_IOT_ST_MAX_PAYLOAD_SIZE
LibAwsIot.AWS_IOT_ST_SPLIT_MESSAGE_SIZE
LibAwsIot.__JL_Ctag_205
LibAwsIot.aws_iotdevice_defender_get_ip_list_fn
LibAwsIot.aws_iotdevice_defender_get_number_fn
LibAwsIot.aws_iotdevice_defender_get_number_list_fn
LibAwsIot.aws_iotdevice_defender_get_string_list_fn
LibAwsIot.aws_iotdevice_defender_publish_fn
LibAwsIot.aws_iotdevice_defender_report_accepted_fn
LibAwsIot.aws_iotdevice_defender_report_format
LibAwsIot.aws_iotdevice_defender_report_rejected_fn
LibAwsIot.aws_iotdevice_defender_task
LibAwsIot.aws_iotdevice_defender_task_canceled_fn
LibAwsIot.aws_iotdevice_defender_task_config
LibAwsIot.aws_iotdevice_defender_task_failure_fn
LibAwsIot.aws_iotdevice_error
LibAwsIot.aws_iotdevice_log_subject
LibAwsIot.aws_secure_tunnel
LibAwsIot.aws_secure_tunnel_connection_view
LibAwsIot.aws_secure_tunnel_connections
LibAwsIot.aws_secure_tunnel_field_number
LibAwsIot.aws_secure_tunnel_message_received_fn
LibAwsIot.aws_secure_tunnel_message_storage
LibAwsIot.aws_secure_tunnel_message_type
LibAwsIot.aws_secure_tunnel_message_view
LibAwsIot.aws_secure_tunnel_on_message_received_fn
LibAwsIot.aws_secure_tunnel_operation
LibAwsIot.aws_secure_tunnel_options
LibAwsIot.aws_secure_tunnel_options_storage
LibAwsIot.aws_secure_tunnel_protocol_buffer_wire_type
LibAwsIot.aws_secure_tunnel_state
LibAwsIot.aws_secure_tunnel_vtable
LibAwsIot.aws_secure_tunneling_local_proxy_mode
LibAwsIot.aws_secure_tunneling_on_connection_complete_fn
LibAwsIot.aws_secure_tunneling_on_connection_reset_fn
LibAwsIot.aws_secure_tunneling_on_connection_shutdown_fn
LibAwsIot.aws_secure_tunneling_on_connection_start_fn
LibAwsIot.aws_secure_tunneling_on_send_message_complete_fn
LibAwsIot.aws_secure_tunneling_on_session_reset_fn
LibAwsIot.aws_secure_tunneling_on_stopped_fn
LibAwsIot.aws_secure_tunneling_on_stream_reset_fn
LibAwsIot.aws_secure_tunneling_on_stream_start_fn
LibAwsIot.aws_secure_tunneling_on_termination_complete_fn
LibAwsIot.data_tunnel_pair
LibAwsIot.defender_custom_metric_type
LibAwsIot.aws_iot_st_msg_serialize_from_view
LibAwsIot.aws_iotdevice_defender_config_clean_up
LibAwsIot.aws_iotdevice_defender_config_create
LibAwsIot.aws_iotdevice_defender_config_register_ip_list_metric
LibAwsIot.aws_iotdevice_defender_config_register_number_list_metric
LibAwsIot.aws_iotdevice_defender_config_register_number_metric
LibAwsIot.aws_iotdevice_defender_config_register_string_list_metric
LibAwsIot.aws_iotdevice_defender_config_set_callback_userdata
LibAwsIot.aws_iotdevice_defender_config_set_report_accepted_fn
LibAwsIot.aws_iotdevice_defender_config_set_report_rejected_fn
LibAwsIot.aws_iotdevice_defender_config_set_task_cancelation_fn
LibAwsIot.aws_iotdevice_defender_config_set_task_failure_fn
LibAwsIot.aws_iotdevice_defender_config_set_task_period_ns
LibAwsIot.aws_iotdevice_defender_task_clean_up
LibAwsIot.aws_iotdevice_defender_task_create
LibAwsIot.aws_iotdevice_defender_task_create_ex
LibAwsIot.aws_iotdevice_library_clean_up
LibAwsIot.aws_iotdevice_library_init
LibAwsIot.aws_secure_tunnel_acquire
LibAwsIot.aws_secure_tunnel_connection_reset
LibAwsIot.aws_secure_tunnel_connection_start
LibAwsIot.aws_secure_tunnel_deserialize_message_from_cursor
LibAwsIot.aws_secure_tunnel_get_default_vtable
LibAwsIot.aws_secure_tunnel_message_type_to_c_string
LibAwsIot.aws_secure_tunnel_new
LibAwsIot.aws_secure_tunnel_release
LibAwsIot.aws_secure_tunnel_send_message
LibAwsIot.aws_secure_tunnel_set_vtable
LibAwsIot.aws_secure_tunnel_start
LibAwsIot.aws_secure_tunnel_stop
LibAwsIot.aws_secure_tunnel_stream_reset
LibAwsIot.aws_secure_tunnel_stream_start
LibAwsIot.AWS_C_IOTDEVICE_PACKAGE_ID
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_FIELD_NUMBER_SHIFT
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_MAXIMUM_1_BYTE_VARINT_VALUE
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_MAXIMUM_2_BYTE_VARINT_VALUE
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_MAXIMUM_3_BYTE_VARINT_VALUE
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_MAXIMUM_VARINT
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_MAX_PAYLOAD_SIZE
— ConstantDocumentation not found.
LibAwsIot.AWS_IOT_ST_SPLIT_MESSAGE_SIZE
— ConstantDocumentation not found.
LibAwsIot.__JL_Ctag_205
— Type__JL_Ctag_205
Documentation not found.
LibAwsIot.aws_iotdevice_defender_get_ip_list_fn
— TypeUser callback type invoked to retrieve an ip list custom metric
List provided will already be initialized and caller must push items into the list of type (struct aws_string *
). String allocated that are placed into the list are destroyed by the defender task after it is done with the list.
returns: AWS_OP_SUCCESS if the custom metric was successfully added to the task config
LibAwsIot.aws_iotdevice_defender_get_number_fn
— TypeUser callback type invoked to retrieve a number type custom metric.
returns: AWS_OP_SUCCESS if the custom metric was successfully added to the task config
LibAwsIot.aws_iotdevice_defender_get_number_list_fn
— TypeUser callback type invoked to retrieve a number list custom metric
List provided will already be initialized and caller must push items into the list of type double.
returns: AWS_OP_SUCCESS if the custom metric was successfully added to the task config
LibAwsIot.aws_iotdevice_defender_get_string_list_fn
— TypeUser callback type invoked to retrieve a string list custom metric
List provided will already be initialized and caller must push items into the list of type (struct aws_string *
). String allocated that are placed into the list are destroyed by the defender task after it is done with the list.
returns: AWS_OP_SUCCESS if the custom metric was successfully added to the task config
LibAwsIot.aws_iotdevice_defender_publish_fn
— TypeCallback to invoke when the defender task needs to "publish" a report. Useful to override default MQTT publish behavior, for testing report outputs
Notes: * This function should not perform blocking IO. * This function should copy the report if it needs to hold on to the memory for an IO operation
returns: AWS_OP_SUCCESS if the user callback wants to consider the publish failed.
LibAwsIot.aws_iotdevice_defender_report_accepted_fn
— TypeUser callback type invoked when the subscribed device defender topic for accepted reports receives a message.
LibAwsIot.aws_iotdevice_defender_report_format
— Typeaws_iotdevice_defender_report_format
Documentation not found.
LibAwsIot.aws_iotdevice_defender_report_rejected_fn
— TypeUser callback type invoked when a report fails to submit.
There are two possibilities for failed submission: 1. The MQTT client fails to publish the message and returns an error code. In this scenario, the client_error_code will be a value other than AWS_ERROR_SUCCESS. The rejected_message_payload parameter will be NULL. 2. After a successful publish, a reply is received on the respective MQTT rejected topic with a message. In this scenario, the client_error_code will be AWS_ERROR_SUCCESS, and rejected_message_payload will contain the payload of the rejected message received.
Arguments
rejected_message_payload
:[in] response payload recieved from rejection topicuserdata
:[in] callback userdata
LibAwsIot.aws_iotdevice_defender_task
— TypeDocumentation not found.
LibAwsIot.aws_iotdevice_defender_task_canceled_fn
— TypeUser callback type invoked when DeviceDefender task has completed cancellation. After a request to stop the task, this signals the completion of the cancellation and no further user callbacks will be invoked.
Arguments
userdata
:[in] callback userdata
LibAwsIot.aws_iotdevice_defender_task_config
— TypeDocumentation not found.
LibAwsIot.aws_iotdevice_defender_task_failure_fn
— TypeGeneral callback handler for the task to report that an error occurred while running the DeviceDefender task. Error codes can only go so far in describing where/when and how the failure occur so the errors here may best communicate where/when and the how of the underlying call should be found in log output
Arguments
is_task_stopped
:[in] flag indicating whether or not the task is unable to continue runningerror_code
:[in] error code describing the nature of the failure
LibAwsIot.aws_iotdevice_error
— Typeaws_iotdevice_error
Documentation not found.
LibAwsIot.aws_iotdevice_log_subject
— Typeaws_iotdevice_log_subject
Documentation not found.
LibAwsIot.aws_secure_tunnel
— Typeaws_secure_tunnel
Documentation not found.
LibAwsIot.aws_secure_tunnel_connection_view
— Typeaws_secure_tunnel_connection_view
Read-only snapshot of a Secure Tunnel Connection Completion Data
LibAwsIot.aws_secure_tunnel_connections
— Typeaws_secure_tunnel_connections
Documentation not found.
LibAwsIot.aws_secure_tunnel_field_number
— Typeaws_secure_tunnel_field_number
Documentation not found.
LibAwsIot.aws_secure_tunnel_message_received_fn
— TypeSignature of callback to invoke on received messages
LibAwsIot.aws_secure_tunnel_message_storage
— Typeaws_secure_tunnel_message_storage
Documentation not found.
LibAwsIot.aws_secure_tunnel_message_type
— Typeaws_secure_tunnel_message_type
Type of IoT Secure Tunnel message. Enum values match IoT Secure Tunneling Local Proxy V3 Websocket Protocol Guide values.
https://github.com/aws-samples/aws-iot-securetunneling-localproxy/blob/main/V3WebSocketProtocolGuide.md
LibAwsIot.aws_secure_tunnel_message_view
— Typeaws_secure_tunnel_message_view
Read-only snapshot of a Secure Tunnel Message
LibAwsIot.aws_secure_tunnel_on_message_received_fn
— TypeDocumentation not found.
LibAwsIot.aws_secure_tunnel_operation
— TypeDocumentation not found.
LibAwsIot.aws_secure_tunnel_options
— Typeaws_secure_tunnel_options
Basic Secure Tunnel configuration struct.
Contains connection properties for the creation of a Secure Tunnel
LibAwsIot.aws_secure_tunnel_options_storage
— Typeaws_secure_tunnel_options_storage
Documentation not found.
LibAwsIot.aws_secure_tunnel_protocol_buffer_wire_type
— Typeaws_secure_tunnel_protocol_buffer_wire_type
Documentation not found.
LibAwsIot.aws_secure_tunnel_state
— Typeaws_secure_tunnel_state
The various states that the secure tunnel can be in. A secure tunnel has both a current state and a desired state. Desired state is only allowed to be one of {STOPPED, CONNECTED, TERMINATED}. The secure tunnel transitions states based on either (1) changes in desired state, or (2) external events.
Most states are interruptible (in the sense of a change in desired state causing an immediate change in state) but CONNECTING cannot be interrupted due to waiting for an asynchronous callback (that has no cancel) to complete.
LibAwsIot.aws_secure_tunnel_vtable
— Typeaws_secure_tunnel_vtable
Documentation not found.
LibAwsIot.aws_secure_tunneling_local_proxy_mode
— Typeaws_secure_tunneling_local_proxy_mode
Documentation not found.
LibAwsIot.aws_secure_tunneling_on_connection_complete_fn
— TypeSignature of callback to invoke on fully established connection to Secure Tunnel Service
LibAwsIot.aws_secure_tunneling_on_connection_reset_fn
— TypeSignature of callback to invoke on a connection id stream being reset
LibAwsIot.aws_secure_tunneling_on_connection_shutdown_fn
— TypeSignature of callback to invoke on shutdown of connection to Secure Tunnel Service
LibAwsIot.aws_secure_tunneling_on_connection_start_fn
— TypeSignature of callback to invoke on start of a connection id stream
LibAwsIot.aws_secure_tunneling_on_send_message_complete_fn
— TypeSignature of callback to invoke on completion of an outbound message
LibAwsIot.aws_secure_tunneling_on_session_reset_fn
— TypeSignature of callback to invoke on session reset recieved from the Secure Tunnel Service
LibAwsIot.aws_secure_tunneling_on_stopped_fn
— TypeSignature of callback to invoke on Secure Tunnel reaching a STOPPED state
LibAwsIot.aws_secure_tunneling_on_stream_reset_fn
— TypeSignature of callback to invoke on a stream being reset
LibAwsIot.aws_secure_tunneling_on_stream_start_fn
— TypeSignature of callback to invoke on the start of a stream
LibAwsIot.aws_secure_tunneling_on_termination_complete_fn
— TypeSignature of callback to invoke on termination completion of the Native Secure Tunnel Client
LibAwsIot.data_tunnel_pair
— Typedata_tunnel_pair
Documentation not found.
LibAwsIot.defender_custom_metric_type
— Typedefender_custom_metric_type
Change name if this needs external exposure. Needed to keep track of how to interpret instantiated metrics, and cast the supplier_fn correctly.
LibAwsIot.aws_iot_st_msg_serialize_from_view
— Methodaws_iot_st_msg_serialize_from_view(buffer, allocator, message_view)
Documentation not found.
Prototype
int aws_iot_st_msg_serialize_from_view( struct aws_byte_buf *buffer, struct aws_allocator *allocator, const struct aws_secure_tunnel_message_view *message_view);
LibAwsIot.aws_iotdevice_defender_config_clean_up
— Methodaws_iotdevice_defender_config_clean_up(config)
Destroys a new reporting task for Device Defender metrics
Arguments
config
:[in] defender task configuration
Prototype
void aws_iotdevice_defender_config_clean_up(struct aws_iotdevice_defender_task_config *config);
LibAwsIot.aws_iotdevice_defender_config_create
— Methodaws_iotdevice_defender_config_create(config_out, allocator, thing_name, report_format)
Creates a new reporting task config for Device Defender metrics collection
Arguments
config_out
:[in] output to write a pointer to a task configuration. Will write non-NULL if successful in creating the the task configuration. Will write NULL if there is an error during creationallocator
:[in] allocator to use for the task configuration's internal data, and the task itself when startedthing_name
:[in] thing name the task config is reporting forreport_format
:[in] report format to produce when publishing to IoT
Returns
AWS_OP_SUCCESS and config_out will be non-NULL. Returns an error code otherwise
Prototype
int aws_iotdevice_defender_config_create( struct aws_iotdevice_defender_task_config **config_out, struct aws_allocator *allocator, const struct aws_byte_cursor *thing_name, enum aws_iotdevice_defender_report_format report_format);
LibAwsIot.aws_iotdevice_defender_config_register_ip_list_metric
— Methodaws_iotdevice_defender_config_register_ip_list_metric(task_config, metric_name, supplier, userdata)
Adds IP list custom metric to the Device Defender task configuration. Has no impact on a defender task already started using the configuration.
Arguments
task_config
:[in] the defender task configuration to register the metric tometric_name
:[in] UTF8 byte string of the metric namesupplier
:[in] callback function to produce the metric value when requested at report generation timeuserdata
:[in] specific callback data for the supplier callback function
Prototype
void aws_iotdevice_defender_config_register_ip_list_metric( struct aws_iotdevice_defender_task_config *task_config, const struct aws_byte_cursor *metric_name, aws_iotdevice_defender_get_ip_list_fn *supplier, void *userdata);
LibAwsIot.aws_iotdevice_defender_config_register_number_list_metric
— Methodaws_iotdevice_defender_config_register_number_list_metric(task_config, metric_name, supplier, userdata)
Adds number list custom metric to the Device Defender task configuration. Has no impact on a defender task already started using the configuration.
Arguments
task_config
:[in] the defender task configuration to register the metric tometric_name
:[in] UTF8 byte string of the metric namesupplier
:[in] callback function to produce the metric value when requested at report generation timeuserdata
:[in] specific callback data for the supplier callback function
Prototype
void aws_iotdevice_defender_config_register_number_list_metric( struct aws_iotdevice_defender_task_config *task_config, const struct aws_byte_cursor *metric_name, aws_iotdevice_defender_get_number_list_fn *supplier, void *userdata);
LibAwsIot.aws_iotdevice_defender_config_register_number_metric
— Methodaws_iotdevice_defender_config_register_number_metric(task_config, metric_name, supplier, userdata)
Adds number custom metric to the Device Defender task configuration. Has no impact on a defender task already started using the configuration.
Arguments
task_config
:[in] the defender task configuration to register the metric tometric_name
:[in] UTF8 byte string of the metric namesupplier
:[in] callback function to produce the metric value when requested at report generation timeuserdata
:[in] specific callback data for the supplier callback function
Prototype
void aws_iotdevice_defender_config_register_number_metric( struct aws_iotdevice_defender_task_config *task_config, const struct aws_byte_cursor *metric_name, aws_iotdevice_defender_get_number_fn *supplier, void *userdata);
LibAwsIot.aws_iotdevice_defender_config_register_string_list_metric
— Methodaws_iotdevice_defender_config_register_string_list_metric(task_config, metric_name, supplier, userdata)
Adds string list custom metric to the Device Defender task configuration. Has no impact on a defender task already started using the configuration.
Arguments
task_config
:[in] the defender task configuration to register the metric tometric_name
:[in] UTF8 byte string of the metric namesupplier
:[in] callback function to produce the metric value when requested at report generation timeuserdata
:[in] specific callback data for the supplier callback function
Prototype
void aws_iotdevice_defender_config_register_string_list_metric( struct aws_iotdevice_defender_task_config *task_config, const struct aws_byte_cursor *metric_name, aws_iotdevice_defender_get_string_list_fn *supplier, void *userdata);
LibAwsIot.aws_iotdevice_defender_config_set_callback_userdata
— Methodaws_iotdevice_defender_config_set_callback_userdata(config, userdata)
Sets the userdata for the device defender task's callback functions
Arguments
config
:[in] defender task configurationuserdata
:[in] how much time in nanoseconds between defender task runs
Returns
AWS_OP_SUCCESS when the property has been set properly. Returns an error code if the value was not able to be set
Prototype
int aws_iotdevice_defender_config_set_callback_userdata( struct aws_iotdevice_defender_task_config *config, void *userdata);
LibAwsIot.aws_iotdevice_defender_config_set_report_accepted_fn
— Methodaws_iotdevice_defender_config_set_report_accepted_fn(config, accepted_fn)
Sets the report rejected callback function to invoke when is canceled and not going to be scheduled to run. This is a suggestion of when it is OK to close or free resources kept around while the task is running.
Arguments
config
:[in] defender task configurationaccepted_fn
:[in] accepted report callback function
Returns
AWS_OP_SUCCESS when the report accepted callback has been set. Returns an error if the callback was not set
Prototype
int aws_iotdevice_defender_config_set_report_accepted_fn( struct aws_iotdevice_defender_task_config *config, aws_iotdevice_defender_report_accepted_fn *accepted_fn);
LibAwsIot.aws_iotdevice_defender_config_set_report_rejected_fn
— Methodaws_iotdevice_defender_config_set_report_rejected_fn(config, rejected_fn)
Sets the report rejected callback function to invoke when is canceled and not going to be scheduled to run. This is a suggestion of when it is OK to close or free resources kept around while the task is running.
Arguments
config
:[in] defender task configurationrejected_fn
:[in] rejected report callback function
Returns
AWS_OP_SUCCESS when the report rejected callback has been set. Returns an error if the callback was not set
Prototype
int aws_iotdevice_defender_config_set_report_rejected_fn( struct aws_iotdevice_defender_task_config *config, aws_iotdevice_defender_report_rejected_fn *rejected_fn);
LibAwsIot.aws_iotdevice_defender_config_set_task_cancelation_fn
— Methodaws_iotdevice_defender_config_set_task_cancelation_fn(config, cancel_fn)
Sets the task cancelation callback function to invoke when the task is canceled and not going to be scheduled to run. This is a suggestion of when it is OK to close or free resources kept around while the task is running.
Arguments
config
:[in] defender task configurationcancel_fn
:[in] cancelation callback function
Returns
AWS_OP_SUCCESS when the task cancelation callback has been set. Returns an error if the callback was not set
Prototype
int aws_iotdevice_defender_config_set_task_cancelation_fn( struct aws_iotdevice_defender_task_config *config, aws_iotdevice_defender_task_canceled_fn *cancel_fn);
LibAwsIot.aws_iotdevice_defender_config_set_task_failure_fn
— Methodaws_iotdevice_defender_config_set_task_failure_fn(config, failure_fn)
Sets the task failure callback function to invoke when the running of the task encounters a failure. Though this is optional to specify, it is important to register a handler to at least monitor failure that stops the task from running
The most likely scenario for task not being able to continue is failure to reschedule the task
Arguments
config
:[in] defender task configurationfailure_fn
:[in] failure callback function
Returns
AWS_OP_SUCCESS when the task failure callback has been set. Returns an error if the callback was not set
Prototype
int aws_iotdevice_defender_config_set_task_failure_fn( struct aws_iotdevice_defender_task_config *config, aws_iotdevice_defender_task_failure_fn *failure_fn);
LibAwsIot.aws_iotdevice_defender_config_set_task_period_ns
— Methodaws_iotdevice_defender_config_set_task_period_ns(config, task_period_ns)
Sets the period of the device defender task
Arguments
config
:[in] defender task configurationtask_period_ns
:[in] how much time in nanoseconds between defender task runs
Returns
AWS_OP_SUCCESS when the property has been set properly. Returns an error code if the value was not able to be set.
Prototype
int aws_iotdevice_defender_config_set_task_period_ns( struct aws_iotdevice_defender_task_config *config, uint64_t task_period_ns);
LibAwsIot.aws_iotdevice_defender_task_clean_up
— Methodaws_iotdevice_defender_task_clean_up(defender_task)
Cancels the running task reporting Device Defender metrics and cleans up. If the task is currently running, it will block until the task has been canceled and cleaned up successfully
Arguments
defender_task
:[in] running task to stop and clean up
Prototype
void aws_iotdevice_defender_task_clean_up(struct aws_iotdevice_defender_task *defender_task);
LibAwsIot.aws_iotdevice_defender_task_create
— Methodaws_iotdevice_defender_task_create(task_out, config, connection, event_loop)
Creates and starts a new Device Defender reporting task
Arguments
task_out
:[out] output parameter to set to point to the defender taskconfig
:[in] defender task configuration to use to start the taskconnection
:[in] mqtt connection to use to publish reports toevent_loop
:[in] IoT device thing name used to determine the MQTT topic to publish the report to and listen for accepted or rejected responses
Returns
AWS_OP_SUCCESS if the task has been created successfully and is scheduled to run
Prototype
int aws_iotdevice_defender_task_create( struct aws_iotdevice_defender_task **task_out, const struct aws_iotdevice_defender_task_config *config, struct aws_mqtt_client_connection *connection, struct aws_event_loop *event_loop);
LibAwsIot.aws_iotdevice_defender_task_create_ex
— Methodaws_iotdevice_defender_task_create_ex(task_out, config, publish_fn, event_loop)
Creates and starts a new Device Defender reporting task with the ability to define a function to accept/handle each report when the task needs to publish.
Arguments
task_out
:[out] output parameter to set to point to the defender taskconfig
:[in] defender task configuration to use to start the taskpublish_fn
:[in] callback to handle reports generated by the task. The userdata comes from the task configevent_loop
:[in] IoT device thing name used to determine the MQTT topic to publish the report to and listen for accepted or rejected responses
Returns
AWS_OP_SUCCESS if the task has been created successfully and is scheduled to run
Prototype
int aws_iotdevice_defender_task_create_ex( struct aws_iotdevice_defender_task **task_out, const struct aws_iotdevice_defender_task_config *config, aws_iotdevice_defender_publish_fn *publish_fn, struct aws_event_loop *event_loop);
LibAwsIot.aws_iotdevice_library_clean_up
— Methodaws_iotdevice_library_clean_up()
Shuts down the internal datastructures used by aws-c-iot
Prototype
void aws_iotdevice_library_clean_up(void);
LibAwsIot.aws_iotdevice_library_init
— Methodaws_iotdevice_library_init(allocator)
Initializes internal datastructures used by aws-c-iot. Must be called before using any functionality in aws-c-iot.
Prototype
void aws_iotdevice_library_init(struct aws_allocator *allocator);
LibAwsIot.aws_secure_tunnel_acquire
— Methodaws_secure_tunnel_acquire(secure_tunnel)
Acquires a reference to a secure tunnel
Arguments
secure_tunnel
: secure tunnel to acquire a reference to. May be NULL
Returns
what was passed in as the secure tunnel (a client or NULL)
Prototype
struct aws_secure_tunnel *aws_secure_tunnel_acquire(struct aws_secure_tunnel *secure_tunnel);
LibAwsIot.aws_secure_tunnel_connection_reset
— Methodaws_secure_tunnel_connection_reset(secure_tunnel, message_options)
Documentation not found.
Prototype
int aws_secure_tunnel_connection_reset( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_message_view *message_options);
LibAwsIot.aws_secure_tunnel_connection_start
— Methodaws_secure_tunnel_connection_start(secure_tunnel, message_options)
Queue a CONNECTION_START message in a secure tunnel
This function should only be used from source mode.
Arguments
secure_tunnel
: secure tunnel to queue a message formessage_options
: configuration options for the message operation
Returns
success/failure in the synchronous logic that kicks off the message operation
Prototype
int aws_secure_tunnel_connection_start( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_message_view *message_options);
LibAwsIot.aws_secure_tunnel_deserialize_message_from_cursor
— Methodaws_secure_tunnel_deserialize_message_from_cursor(secure_tunnel, cursor, on_message_received)
Documentation not found.
Prototype
int aws_secure_tunnel_deserialize_message_from_cursor( struct aws_secure_tunnel *secure_tunnel, struct aws_byte_cursor *cursor, aws_secure_tunnel_on_message_received_fn *on_message_received);
LibAwsIot.aws_secure_tunnel_get_default_vtable
— Methodaws_secure_tunnel_get_default_vtable()
Documentation not found.
Prototype
const struct aws_secure_tunnel_vtable *aws_secure_tunnel_get_default_vtable(void);
LibAwsIot.aws_secure_tunnel_message_type_to_c_string
— Methodaws_secure_tunnel_message_type_to_c_string(message_type)
Get the const char description of a message type
Arguments
message_type
: message type used by a secure tunnel message
Returns
const char translation of the message type
Prototype
const char *aws_secure_tunnel_message_type_to_c_string(enum aws_secure_tunnel_message_type message_type);
LibAwsIot.aws_secure_tunnel_new
— Methodaws_secure_tunnel_new(allocator, options)
Creates a new secure tunnel
Arguments
options
: secure tunnel configuration
Returns
a new secure tunnel or NULL
Prototype
struct aws_secure_tunnel *aws_secure_tunnel_new( struct aws_allocator *allocator, const struct aws_secure_tunnel_options *options);
LibAwsIot.aws_secure_tunnel_release
— Methodaws_secure_tunnel_release(secure_tunnel)
Release a reference to a secure tunnel. When the secure tunnel ref count drops to zero, the secure tunnel will automatically trigger a stop and once the stop completes, the secure tunnel will delete itself.
Arguments
secure_tunnel
: secure tunnel to release a reference to. May be NULL
Returns
NULL
Prototype
struct aws_secure_tunnel *aws_secure_tunnel_release(struct aws_secure_tunnel *secure_tunnel);
LibAwsIot.aws_secure_tunnel_send_message
— Methodaws_secure_tunnel_send_message(secure_tunnel, message_options)
Queues a message operation in a secure tunnel
Arguments
secure_tunnel
: secure tunnel to queue a message formessage_options
: configuration options for the message operation
Returns
success/failure in the synchronous logic that kicks off the message operation
Prototype
int aws_secure_tunnel_send_message( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_message_view *message_options);
LibAwsIot.aws_secure_tunnel_set_vtable
— Methodaws_secure_tunnel_set_vtable(secure_tunnel, vtable)
Documentation not found.
Prototype
void aws_secure_tunnel_set_vtable( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_vtable *vtable);
LibAwsIot.aws_secure_tunnel_start
— Methodaws_secure_tunnel_start(secure_tunnel)
Asynchronous notify to the secure tunnel that you want it to attempt to connect. The secure tunnel will attempt to stay connected.
Arguments
secure_tunnel
: secure tunnel to start
Returns
success/failure in the synchronous logic that kicks off the start process
Prototype
int aws_secure_tunnel_start(struct aws_secure_tunnel *secure_tunnel);
LibAwsIot.aws_secure_tunnel_stop
— Methodaws_secure_tunnel_stop(secure_tunnel)
Asynchronous notify to the secure tunnel that you want it to transition to the stopped state. When the secure tunnel reaches the stopped state, all session state is erased.
Arguments
secure_tunnel
: secure tunnel to stop
Returns
success/failure in the synchronous logic that kicks off the start process
Prototype
int aws_secure_tunnel_stop(struct aws_secure_tunnel *secure_tunnel);
LibAwsIot.aws_secure_tunnel_stream_reset
— Methodaws_secure_tunnel_stream_reset(secure_tunnel, message_options)
Queue a STREAM_RESET message in a secure tunnel
This function should not be used.
Arguments
secure_tunnel
: secure tunnel to queue a message formessage_options
: configuration options for the message operation
Returns
success/failure in the synchronous logic that kicks off the message operation
Prototype
int aws_secure_tunnel_stream_reset( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_message_view *message_options);
LibAwsIot.aws_secure_tunnel_stream_start
— Methodaws_secure_tunnel_stream_start(secure_tunnel, message_options)
Queue a STREAM_START message in a secure tunnel
This function should only be used from source mode.
Arguments
secure_tunnel
: secure tunnel to queue a message formessage_options
: configuration options for the message operation
Returns
success/failure in the synchronous logic that kicks off the message operation
Prototype
int aws_secure_tunnel_stream_start( struct aws_secure_tunnel *secure_tunnel, const struct aws_secure_tunnel_message_view *message_options);