-->
USB-UART : custom
- Using this method for accessing target data allows full control for how data is sent over UART peripheral.
- Main advantage of this method is that data to be sent over can be fully controlled as there is no generic protocol overhead. The user defines the protocol. As an example
a trivial single float variable in JSON could be represened as {"value":"12345.0"}. Sending this single value requires 19 bytes. If this was sent using binary format (i.e. just the value itself)
then entire number could be reprsented by 4 bytes(on most architectures).
- This option usually carries minimal overhead for data transmission. However, it is the most complex option for application developer. The developer needs to:
- Provide a target application (firmware) that sends/receives the data over UART. This option will require UART peripheral handling code to e added to your target application.
- Implement host (client) side java script function that parses received data and makes it available to widgets. This function may be provided by following the custom codec steps listed below.
Custom Codec
- Create a new project using USB-UART as transport option and add Streaming model with custom from protocol selection. You may optionally provide a program to program the device through Target Programming page.
However this is optional if correct firmware is already flashed on the device.
- Close the dialog to create a project. Now choose File->New -> Custom Codec File. A javascript file will open that contains boilerplate file and documentation in comments to will help you with
parsing custom data and updating widgets.
- Please see the Processing custom UART data page for more information on how to add custom javascript files that allow you to add parsing code.