First class data visualization and communication library with embedded devices. Code is maintained at github.com/Overdrivr/Telemetry

Dependents:   telemetry_car_demo telemetry_demo_FRDM-TFC telemetry_example_01 telemetry_indexed_data_demo ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Telemetry.hpp Source File

Telemetry.hpp

00001 #ifndef TELEMETRY_HPP_
00002 #define TELEMETRY_HPP_
00003 
00004 #include "telemetry_config.h"
00005 
00006 #ifdef TELEMETRY_ARDUINO_DISTRIBUTION
00007 #include "telemetry_utils.h"
00008 #else
00009 #include "c_api/telemetry_utils.h"
00010 #endif
00011 
00012 class Telemetry
00013 {
00014     public:
00015 #ifdef TELEMETRY_ARDUINO_DISTRIBUTION
00016       Telemetry();
00017 #else
00018       Telemetry(uint32_t bauds = 9600);
00019 #endif
00020 
00021       void begin(uint32_t bauds = 9600);
00022 
00023       //void attach_to(const char * topic, );
00024       void attach_f32_to(const char * topic, float * variable);
00025       void attach_u8_to(const char * topic, uint8_t * variable);
00026       void attach_u16_to(const char * topic, uint16_t * variable);
00027       void attach_u32_to(const char * topic, uint32_t * variable);
00028       void attach_i8_to(const char * topic, int8_t * variable);
00029       void attach_i16_to(const char * topic, int16_t * variable);
00030       void attach_i32_to(const char * topic, int32_t * variable);
00031 
00032       TM_transport * get_transport();
00033 
00034       void pub(const char * topic, const char * msg);
00035       void pub_u8(const char * topic, uint8_t msg);
00036       void pub_u16(const char * topic, uint16_t msg);
00037       void pub_u32(const char * topic, uint32_t msg);
00038       void pub_i8(const char * topic, int8_t msg);
00039       void pub_i16(const char * topic, int16_t msg);
00040       void pub_i32(const char * topic, int32_t msg);
00041       void pub_f32(const char * topic, float msg);
00042 
00043       void sub(void (*callback)(TM_state * s, TM_msg * m), TM_state* userData);
00044 
00045       void update();
00046 
00047     private:
00048       TM_transport transport;
00049 };
00050 
00051 #endif