There are a number of different Target Communication options that you can use for data exchange with a target device. The choice for your specific GUI Composer application will depend on your target device
, your application program and how the device is connected. During new project creation you will need to choose which target communication method your target firmware should use. You may also change or adjust
target communication method later through project properties. GUI Composer now supports multiple data connections in a single application. You may combine USB-UART to stream data for visualization and add XDS communication option to write user changes to control the operation of target firmware.(supported on some devices only)
In most cases you will need to choose a physical connection i.e. a transport and a data encoding i.e. protocol that is used to trasfer data. E.g. USB-UART option uses a USB cable to connect your device, where data is sent through UART.
One of the protocols for encoding data is JSON. Some choices may have a fixed protocol e.g. XDS uses JTAG protocol.
In general the flow is to click on + button in top left corner and select physical transport (e.g. Network based transport) and then add a data model by clicking on Add button. Model specific options will be presented.
Exact listing of options depends on selected Target Communication option. Please refer below for more information.
-
Network
In this case we are using Network based communication channel to talk to the device.
IBM IOT
- The target code is linked with an 'MQTT' library that handles communication with IBM IoT MQTT Broker, enabling the project to send and receive JSON formatted strings via the Internet. Please see JSON Strings topic for more information on JSON.
- The GUI Composer 2 project uses bindings to the ti-model-iot-ibm component to allow widgets to be automatically updated to reflect the value of received JSON-formatted property strings when those values change, and to transmit property values to the target via JSON-formatted strings when a widget is configured by the user.
- Please refer to the IoT Tutorial for details on how to do this.
- Use IBM IoT if:
- your target can communicate with the Internet
- you are using IBM IoT broker either Quickstart or authenticated to communicate with your target
- you would like your application to communicate with your device without a direct physical connection
MQTT
- The target code is linked with an 'MQTT' library that handles communication with an MQTT Broker, enabling the project to send and receive JSON formatted strings via the Internet. Please see JSON Strings topic for more information on JSON.
- The GUI Composer 2 project uses bindings to the ti-model-iot-mqtt component to allow widgets to be automatically updated to reflect the value of received JSON-formatted property strings when those values change, and to transmit property values to the target via JSON-formatted strings when a widget is configured by the user.
- Please refer to the IoT Tutorial for details on how to do this.
- Use MQTT (IoT) if:
- your target can communicate with the Internet
- you have configured an MQTT broker to communicate with your target
- you would like your application to communicate with your device without a direct physical connection
HTTP
- The target code is built with a webserver which GUI Composer application uses to obtain data. There are two schemes that are supported. urlecoded and JSON. Please see JSON Strings topic for more information on JSON.
- Once you click on Add and add HTTP model, you will need to enter the webserver address and optionally provide credentials. Once webserver connection information is specified you will need add varialbes
that represent your data. You will need to click on Add and fill in a variable name, then a path that webserver needs to respond to and then whether the data will be urleconded or JSON format. JSON format allows
to return multiple data pieces in an object.
- HTTP if:
- your target can communicate with the Internet
- you have configured a webserver to communicate with your target
- you would like your application to communicate with your device without a direct physical connection between PC and target system.
-
USB - UART
The target device is physically connected with a USB cable and data is sent using UART peripheral. You may optionally specify device ID which will help with automatically selecting
the right COM port.
Next step is to add a model. There are two options supported, Monitor and Streaming.
Monitor model is used to simulate XDS type communication with assistance of target monitor.
- monitor: In this case data is encoded through a custom monitor that needs to be integrated with your target program (firmware). GUI Composer has a host side implementation that can obtain the information,
however it requires a target side implementation that uses the same protocol. Using monitor based protocol This is an example of pull based protocol as GUI Composer infrastructure will periodically pull data from target device.
Please see USB - UART with monitor tutorial more information.
Streaming model is used consume data that target is continously streaming to host PC. There are two schemes spported JSON and custom
- JSON: In this case data is sent using JSON formatted strings.Please see JSON Strings topic for more information on JSON.
Also please see this tutorial USB - UART over JSON
for step by step instructions on how to create a project that received JSON encoded data from the device. This is an example of push based protocol as target application pushes data to client (i.e. host PC)
- custom: In this case the target application can send custom data that is optimized for your application. This option provides greatest efficiency in sending the data as only data that is required is sent.
The main disadvantage is that custom javascript functions need to be written to parse this data and bind them to widgets. This is an example of push based protocol as target application pushes data to client (i.e. host PC)
Using custom based protocol
-
XDS
- GUI Composer application uses a debug probe for physical connection (in most cases this is also over USB cable) for data exchange.
- A program file (i.e. your firmware) is used to obtain symbolic information to bind to widgets. Widget bindings use global variables that exist in your program.
- GUI Composer infrastructure will convert symbolic data to memory addresses that are then read or written from/to. Using xds based protocol
- This option is often the simplest to get started with as it does not require any special target program changes or any special handling on the client (host) side.
However, it does require device and debug probe to have support for non-intrusive memory access. This option is available on Cortex based MCU's and C2000 devices.
- Please see the XDS tutorial for details on how to do this.
-
Use XDS if:
- you are converting a project from GUI Composer 1 to GUI Composer 2 or you have a CCStudio project that you wish to add a user interface to without writing much target-side code to provide the interface API
- you would like the freedom to bind to any global variable on your target without having to change your target-side code
- GUI Composer application will pull data from the device on a fixed timer interval.
- Please refer to XDS Configuration section for information on how to use custom target configuration files if your device requires custom adjustments. Using xds based protocol