|
|
| (12 intermediate revisions by 2 users not shown) |
| Line 16: |
Line 16: |
|
| |
|
| ==Component Source Code== | | ==Component Source Code== |
| | |
| | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_IoTMadeEasy.fcfx FC_Comp_Source_IoTMadeEasy.fcfx] |
|
| |
|
| Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_IoTMadeEasy.fcfx FC_Comp_Source_IoTMadeEasy.fcfx] | | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_IoTMadeEasy.fcfx FC_Comp_Source_IoTMadeEasy.fcfx] |
|
| |
|
| ==Detailed description== | | ==Detailed description== |
| | |
| | |
| | |
| | |
| | |
| | |
|
| |
|
|
| |
|
| Line 62: |
Line 70: |
|
| |
|
|
| |
|
| ''<span style="color:red;">No additional examples</span>''
| |
|
| |
|
|
| |
|
| ==Macro reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ErrorAsString'''
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Error
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishString'''
| |
| |-
| |
| | colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | TopicID
| |
| |-
| |
| | colspan="2" | The topic ID to publish data to
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
| | width="90%" | Data
| |
| |-
| |
| | colspan="2" | Data string to publish
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
| | ''<span style="color:red;">No additional examples</span>'' |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTopicID'''
| |
| |-
| |
| | colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect'''
| |
| |-
| |
| | colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadInteger'''
| |
| |-
| |
| | colspan="2" | Get the Payload of the last received (Read) packet as a signed long value
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LastError'''
| |
| |-
| |
| | colspan="2" | Returns the last error
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
| |
| |-
| |
| | colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disconnect'''
| |
| |-
| |
| | colspan="2" | Disconnects from the MQTT server and the network
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
| | ==Macro reference== |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===Connect=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishFloat''' | | | width="90%" class="mtx-class-macrohead" | '''Connect''' |
| |- | | |- |
| | colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful | | | colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected. |
| |- | | |- |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | TopicID
| |
| |-
| |
| | colspan="2" | The topic ID to publish data to
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| |
| | width="90%" | Data
| |
| |-
| |
| | colspan="2" | Data to publish
| |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| Line 209: |
Line 105: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===Disconnect=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Ping''' | | | width="90%" class="mtx-class-macrohead" | '''Disconnect''' |
| |- | | |- |
| | colspan="2" | Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful | | | colspan="2" | Disconnects from the MQTT server and the network |
| |- | | |- |
| |- | | |- |
| Line 222: |
Line 119: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===ErrorAsString=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishInteger''' | | | width="90%" class="mtx-class-macrohead" | '''ErrorAsString''' |
| |- | | |- |
| | colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful | | | colspan="2" | |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| | width="90%" | TopicID | | | width="90%" | Error |
| |- | | |- |
| | colspan="2" | The topic ID to publish data to | | | colspan="2" | |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING |
| | width="90%" | Data
| |
| |-
| |
| | colspan="2" | Data to publish
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===GetPayloadFloat=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadFloat''' | | | width="90%" class="mtx-class-macrohead" | '''GetPayloadFloat''' |
| |- | | |- |
| | colspan="2" | Get the Payload of the last received (Read) packet as a floating point value | | | colspan="2" | Get the Payload of the last received (Read) packet as a floating point value |
| Line 258: |
Line 152: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===GetPayloadInteger=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadString''' | | | width="90%" class="mtx-class-macrohead" | '''GetPayloadInteger''' |
| |- | | |- |
| | colspan="2" | Get the Payload of the last received (Read) packet as a string value | | | colspan="2" | Get the Payload of the last received (Read) packet as a signed long value |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG |
| | width="90%" | Payload
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Size
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===GetPayloadString=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | | | width="90%" class="mtx-class-macrohead" | '''GetPayloadString''' |
| |- | | |- |
| | colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component. | | | colspan="2" | Get the Payload of the last received (Read) packet as a string value |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| | | width="90%" | Payload |
| |}
| |
| | |
| | |
| | |
| | |
| ==Property reference==
| |
| | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | MQTT Properties
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | LinkTo
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
| | width="90%" | Host
| |
| |-
| |
| | colspan="2" | Address of MQTT Broker Can be an IP Address or URL (URL only supported by some hardware platforms)
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
| | width="90%" | Port
| |
| |-
| |
| | colspan="2" | Port used by MQTT Broker Default 1883 for unencrypted access and 8883 for encrypted access.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
| | width="90%" | Client identifier
| |
| |-
| |
| | colspan="2" | Client identifier (Maximum length 20 characters) Must be unique to the broker.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
| | width="90%" | Network Timeout
| |
| |-
| |
| | colspan="2" | Maximum time in mS to wait for network responses
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
| | width="90%" | Read Timeout
| |
| |-
| |
| | colspan="2" | Time to wait in ms when waiting for incoming messages
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
| | width="90%" | Keep Alive
| |
| |-
| |
| | colspan="2" | The Keep Alive is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next, measured in seconds.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Authentication
| |
| |-
| |
| | colspan="2" | Selects if the broker is open or if the broker requires a username and password.
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topics
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Number of topics
| |
| |-
| |
| | colspan="2" | Sets the number of data topics that can be sent or received
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 0
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
| | width="90%" | Topic String
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Topic Type
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 1
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
| | width="90%" | Topic String
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Topic Type | |
| |- | | |- |
| | colspan="2" | | | | colspan="2" | |
| |}==Macro reference==
| |
|
| |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ErrorAsString'''
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| | width="90%" | Error | | | width="90%" | Size |
| |- | | |- |
| | colspan="2" | | | | colspan="2" | |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
| |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishString'''
| |
| |-
| |
| | colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | TopicID
| |
| |-
| |
| | colspan="2" | The topic ID to publish data to
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
| | width="90%" | Data
| |
| |-
| |
| | colspan="2" | Data string to publish
| |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| Line 427: |
Line 190: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===GetTopicID=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTopicID''' | | | width="90%" class="mtx-class-macrohead" | '''GetTopicID''' |
| |- | | |- |
| | colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. | | | colspan="2" | Compares the topic ID of the last received message with enabled IDs. Returns the topic ID received. |
| Line 440: |
Line 204: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===Initialise=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect''' | | | width="90%" class="mtx-class-macrohead" | '''Initialise''' |
| |- | | |- |
| | colspan="2" | Connect to the MQTT Server. Returns the connected state. 0 if not connected, 1 if successful connection, or already connected. | | | colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component. |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===LastError=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadInteger''' | | | width="90%" class="mtx-class-macrohead" | '''LastError''' |
| |-
| |
| | colspan="2" | Get the Payload of the last received (Read) packet as a signed long value
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
| | |
| | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LastError'''
| |
| |- | | |- |
| | colspan="2" | Returns the last error | | | colspan="2" | Returns the last error |
| Line 479: |
Line 232: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===Ping=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read''' | | | width="90%" class="mtx-class-macrohead" | '''Ping''' |
| |- | | |- |
| | colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. | | | colspan="2" | Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
| | |
| | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disconnect'''
| |
| |-
| |
| | colspan="2" | Disconnects from the MQTT server and the network
| |
| |- | | |- |
| |- | | |- |
| Line 505: |
Line 246: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===PublishFloat=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishFloat''' | | | width="90%" class="mtx-class-macrohead" | '''PublishFloat''' |
| |- | | |- |
| | colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful | | | colspan="2" | Publishes data to the selected topic ID using a floating point value. Returns none zero if successful |
| Line 528: |
Line 270: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===PublishInteger=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Ping''' | | | width="90%" class="mtx-class-macrohead" | '''PublishInteger''' |
| |-
| |
| | colspan="2" | Ping packet is sent to the server and checks for a reply. If nothing is sent or received within the keep alive period then a ping is required to keep the connection to the server active. Returns non-zero value if successful
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
| | |
| | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PublishInteger'''
| |
| |- | | |- |
| | colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful | | | colspan="2" | Publishes data to the selected topic ID using a signed long integer value. Returns none zero if successful |
| Line 564: |
Line 294: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===PublishString=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadFloat''' | | | width="90%" class="mtx-class-macrohead" | '''PublishString''' |
| |- | | |- |
| | colspan="2" | Get the Payload of the last received (Read) packet as a floating point value | | | colspan="2" | Publishes data to the selected topic ID using a data string. Returns none zero if successful |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| | | width="90%" | TopicID |
| |}
| |
| | |
| | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadString''' | |
| |-
| |
| | colspan="2" | Get the Payload of the last received (Read) packet as a string value
| |
| |- | | |- |
| | | colspan="2" | The topic ID to publish data to |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
| | width="90%" | Payload | | | width="90%" | Data |
| |- | | |- |
| | colspan="2" | | | | colspan="2" | Data string to publish |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Size
| |
| |-
| |
| | colspan="2" |
| |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| Line 600: |
Line 318: |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===Read=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | | | width="90%" class="mtx-class-macrohead" | '''Read''' |
| |- | | |- |
| | colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component. | | | colspan="2" | Read incoming data. Returns non-zero if packet received. Use GetTopicID and GetPayloadXXX to read the contents. |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
| |
|
| |
|
|
| |
|
| ==Property reference== | | ==Property reference== |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | | width="90%" class="mtx-class-macrohead" | '''Properties''' |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | MQTT Properties | | | width="90%" class="mtx-class-propfolder" | MQTT Properties |
| |- | | |- |
| |- | | |- |
| Line 667: |
Line 384: |
| | colspan="2" | Selects if the broker is open or if the broker requires a username and password. | | | colspan="2" | Selects if the broker is open or if the broker requires a username and password. |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topics | | | width="90%" class="mtx-class-propfolder" | Topics |
| |- | | |- |
| |- | | |- |
| Line 676: |
Line 393: |
| | colspan="2" | Sets the number of data topics that can be sent or received | | | colspan="2" | Sets the number of data topics that can be sent or received |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 0 | | | width="90%" class="mtx-class-propfolder" | Topic ID: 0 |
| |- | | |- |
| |- | | |- |
| Line 690: |
Line 407: |
| | colspan="2" | | | | colspan="2" | |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Topic ID: 1 | | | width="90%" class="mtx-class-propfolder" | Topic ID: 1 |
| |- | | |- |
| |- | | |- |