MQTT Connection functions definitions
Methods
# inner connectToMqttBroker(session_uuid, client_id, mqtt_hostname, mqtt_port, reconnect_timeout, clientUsername, clientPassword, ssl_flag, backend_read_rate, messageToSend, mqttTopicToReceivePredictions, mqttTopicToReceiveCalculations, geojson_asset_points, geojson_antennas, geojson_anchors, geojson_precison_decimal_places, pulsing_dots_layers_IDs, pulsing_dots_layers_sources, selectedMapIndex, received_uuid)
Execute the MQTT client connection to the broker
Parameters:
| Name | Type | Description |
|---|---|---|
session_uuid |
string
|
Generated MQTT session UUID |
client_id |
string
|
MQTT client ID |
mqtt_hostname |
string
|
MQTT hostname connection |
mqtt_port |
string
|
MQTT port connection |
reconnect_timeout |
number
|
MQTT reconnect Time Out value |
clientUsername |
string
|
MQTT client username connection |
clientPassword |
string
|
MQTT client password connection |
ssl_flag |
boolean
|
MQTT connection SSL flag |
backend_read_rate |
number
|
Backend read rate value |
messageToSend |
string
|
MQTT message to send to broker |
mqttTopicToReceivePredictions |
string
|
MQTT Topic To Receive Predictions |
mqttTopicToReceiveCalculations |
string
|
MQTT Topic To Receive Calculations |
geojson_asset_points |
FeatureCollection
|
Asset Points FeatureCollection |
geojson_antennas |
FeatureCollection
|
Antennas FeatureCollection |
geojson_anchors |
FeatureCollection
|
Anchors FeatureCollection |
geojson_precison_decimal_places |
number
|
Value of precison decimal places |
pulsing_dots_layers_IDs |
Array
|
Pulsing Dots IDs Array |
pulsing_dots_layers_sources |
Array
|
Pulsing Dots sources Array |
selectedMapIndex |
number
|
Index of selected Map |
received_uuid |
string
|
MQTT received session UUID |
# inner disconnectFromMqttBroker(client_id, connection_string, geojson_asset_points, geojson_antennas, geojson_anchors, geojson_precison_decimal_places, selectedMapIndex, messageToSend, pulsing_dots_layers_IDs)
Execute the MQTT client Disconnection to the broker
Parameters:
| Name | Type | Description |
|---|---|---|
client_id |
string
|
MQTT client ID |
connection_string |
string
|
MQTT connection string value (hostname + port) |
geojson_asset_points |
FeatureCollection
|
Asset Points FeatureCollection |
geojson_antennas |
FeatureCollection
|
Antennas FeatureCollection |
geojson_anchors |
FeatureCollection
|
Anchors FeatureCollection |
geojson_precison_decimal_places |
number
|
Value of precison decimal places |
selectedMapIndex |
number
|
Index of selected Map |
messageToSend |
string
|
MQTT message to send to broker |
pulsing_dots_layers_IDs |
Array
|
Pulsing Dots IDs Array |
# inner onConnect(session_uuid, client_id, connection_string, backend_read_rate, selectedMapIndex, messageToSend, mqttTopicToReceivePredictions, mqttTopicToReceiveCalculations, geojson_asset_points, geojson_antennas, geojson_anchors, geojson_precison_decimal_places)
Called when the client connects sucessfully
Parameters:
| Name | Type | Description |
|---|---|---|
session_uuid |
string
|
Generated MQTT session UUID |
client_id |
string
|
MQTT client ID |
connection_string |
string
|
MQTT connection string value (hostname + port) |
backend_read_rate |
number
|
Backend read rate value |
selectedMapIndex |
number
|
Index of selected Map |
messageToSend |
string
|
MQTT message to send to broker |
mqttTopicToReceivePredictions |
string
|
MQTT Topic To Receive Predictions |
mqttTopicToReceiveCalculations |
string
|
MQTT Topic To Receive Calculations |
geojson_asset_points |
FeatureCollection
|
Asset Points FeatureCollection |
geojson_antennas |
FeatureCollection
|
Antennas FeatureCollection |
geojson_anchors |
FeatureCollection
|
Anchors FeatureCollection |
geojson_precison_decimal_places |
number
|
Value of precison decimal places |
# inner onFailureUnsubscription(responseObject)
Called when the client can't unsubscribe (uncalled)
Parameters:
| Name | Type | Description |
|---|---|---|
responseObject |
Object
|
On Failure Response Object |
# inner onMqttConnectionFailure(responseObject, connection_string, session_uuid, client_id, mqtt_hostname, mqtt_port, reconnect_timeout, clientUsername, clientPassword, ssl_flag, backend_read_rate, messageToSend, mqttTopicToReceivePredictions, mqttTopicToReceiveCalculations, geojson_asset_points, geojson_antennas, geojson_anchors, geojson_precison_decimal_places, pulsing_dots_layers_IDs, pulsing_dots_layers_sources, selectedMapIndex, received_uuid)
Called when the client can't connect, try reconnect after a timeout
Parameters:
| Name | Type | Description |
|---|---|---|
responseObject |
Object
|
On Failure Response Object |
connection_string |
string
|
MQTT connection string value (hostname + port) |
session_uuid |
string
|
Generated MQTT session UUID |
client_id |
string
|
MQTT client ID |
mqtt_hostname |
string
|
MQTT hostname connection |
mqtt_port |
string
|
MQTT port connection |
reconnect_timeout |
number
|
MQTT reconnect Time Out value |
clientUsername |
string
|
MQTT client username connection |
clientPassword |
string
|
MQTT client password connection |
ssl_flag |
boolean
|
MQTT connection SSL flag |
backend_read_rate |
number
|
Backend read rate value |
messageToSend |
string
|
MQTT message to send to broker |
mqttTopicToReceivePredictions |
string
|
MQTT Topic To Receive Predictions |
mqttTopicToReceiveCalculations |
string
|
MQTT Topic To Receive Calculations |
geojson_asset_points |
FeatureCollection
|
Asset Points FeatureCollection |
geojson_antennas |
FeatureCollection
|
Antennas FeatureCollection |
geojson_anchors |
FeatureCollection
|
Anchors FeatureCollection |
geojson_precison_decimal_places |
number
|
Value of precison decimal places |
pulsing_dots_layers_IDs |
Array
|
Pulsing Dots IDs Array |
pulsing_dots_layers_sources |
Array
|
Pulsing Dots sources Array |
selectedMapIndex |
number
|
Index of selected Map |
received_uuid |
string
|
MQTT received session UUID |
# inner onMqttConnectionLost(responseObject, pulsing_dots_layers_IDs)
Called when the client loses its connection
Parameters:
| Name | Type | Description |
|---|---|---|
responseObject |
Object
|
On Failure Response Object |
pulsing_dots_layers_IDs |
Array
|
Pulsing Dots IDs Array |
# inner onMqttFailureSubscription(responseObject)
Called when the MQTT client can't subscribe a topic
Parameters:
| Name | Type | Description |
|---|---|---|
responseObject |
Object
|
On Failure Response Object |
# inner onMqttMessageArrived(message, session_uuid, geojson_asset_points, geojson_anchors, geojson_antennas, pulsing_dots_layers_sources, mqttTopicToReceivePredictions, mqttTopicToReceiveCalculations, received_uuid)
Called when a MQTT message arrives
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string
|
MQTT message received from the broker |
session_uuid |
string
|
Generated MQTT session UUID |
geojson_asset_points |
FeatureCollection
|
Asset Points FeatureCollection |
geojson_anchors |
FeatureCollection
|
Anchors FeatureCollection |
geojson_antennas |
FeatureCollection
|
Antennas FeatureCollection |
pulsing_dots_layers_sources |
number
|
Pulsing Dots sources Array |
mqttTopicToReceivePredictions |
string
|
MQTT Topic To Receive Predictions |
mqttTopicToReceiveCalculations |
string
|
MQTT Topic To Receive Calculations |
received_uuid |
string
|
MQTT received session UUID |
# inner onMqttSuccessSubscription()
Called when the MQTT client subscribe the topic successfully
# inner onSuccessUnsubscription()
Called when the client unsubscribe the topic successfully (uncalled)
# inner publishMqttMessage(topicName, messagePayload)
Publish a MQTT message in the topic
Parameters:
| Name | Type | Description |
|---|---|---|
topicName |
string
|
Name of the MQTT topic to publish a message |
messagePayload |
string
|
Message payload string data to publish |
# inner subscribeMqttTopic(topicName)
Subscribe to a MQTT topic
Parameters:
| Name | Type | Description |
|---|---|---|
topicName |
string
|
Name of the MQTT topic to subscribe |
# inner unsubscribeMqttTopic(topicName)
Unsubscribe to a MQTT topic (uncalled)
Parameters:
| Name | Type | Description |
|---|---|---|
topicName |
string
|
Name of the MQTT topic to unsubscribe |