-
Notifications
You must be signed in to change notification settings - Fork 27
Setup on a new platform
To setup telemetry on a new platform, first, include, telemetry_core.h
. Next, you must define appropriately a specific data structure an initialize its elements.
This data structure is declared by telemetry
but it's your job, for adding a new platform, to initialize it properly.
This data structure, called TM_transport
, has the following signature.
typedef struct TM_transport TM_transport;
struct TM_transport {
int32_t (*read)(void * buf, uint32_t sizeToRead);
int32_t (*readable)();
int32_t (*write)(void * buf, uint32_t sizeToWrite);
int32_t (*writeable)();
};
As you may have recognized, TM_transport
contains 4 function pointers. These 4 function pointers, and the TM_transport
structure in general, provide an abstraction over any communication hardware.
This way, telemetry
's core code is not tied to a particular hardware and can run on a wide range of platforms.
Now, let's initialize this data structure so that telemetry
will use the UART (Serial port) of your device.
Imagine you have access to the UART hardware through a library defined in uart.h. The library will look something like this:
uart.h
// UART library function definitions
// Usually, you have those libraries provided with your platform
int32_t uart_read(void * data, uint32_t length);
int32_t uart_write(void * data, uint32_t length);
int32_t uart_readable();
int32_t uart_writeable();
Now, when you have such a library already, all the work is pretty much done.
in main.c, instantiate the TM_transport
data structure like you would for any other structure.
void main()
{
TM_transport transport;
And give to each function pointer of transport
the corresponding uart function.
transport.read = uart_read;
transport.write = uart_write;
transport.readable = uart_readable;
transport.writeable = uart_writeable;
And initialize telemetry with it.
init_telemetry(&transport);
And that's it ! You have successfully added telemetry
to your platform.
Now continue to the Tutorial section to learn more on how to use it.
Back Wiki home
- Fast data visualization with the command line interface (todo)
- Fast prototyping remote program control with python (todo)
- Overview of the library
- Protocol description
- All the good stuff inside Telemetry
- List of supported platforms
- Good practices (Must-read !) in writing
- Frequently Asked Questions todo
- List of official examples
- List of projects using telemetry