Function rusp::usp_generator::usp_mqtt_connect_record
source · pub fn usp_mqtt_connect_record<'a>(
version: &'a str,
to_id: &'a str,
from_id: &'a str,
payload_security: PayloadSecurity,
mac_signature: &'a [u8],
sender_cert: &'a [u8],
mqtt311: bool,
subscribed_topic: &'a str
) -> Record<'a>
Expand description
Create a USP record of type MQTT Connect
§Arguments
version
- The USP version of the recordto_id
- The USP Endpoint ID of the receiverfrom_id
- The USP Endpoint ID of the senderpayload_security
- An enumeration of typePayloadSecurity
mac_signature
- Message authentication code or signature used to ensure the integrity of the non-payload fields, when integrity protection of non-payload fields is performedsender_cert
- PEM encoded certificate used to provide the signature in themac_signature
field, when the payload security mechanism does not provide the mechanism to do somqtt311
- true if we want to use MQTT v3.11, false for MQTT v5subscribed_topic
- The topic the sender can receive responses on
§Examples
use rusp::usp_generator::usp_mqtt_connect_record;
use rusp::usp_types::PayloadSecurity;
let newrecord = usp_mqtt_connect_record("1.3", "doc::to", "doc::from", PayloadSecurity::PLAINTEXT, &[], &[], false, "/topic/doc::from");