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
Diff: Telemetry.h
- Revision:
- 4:8e3de1a314e1
- Parent:
- 3:37d2d127bc83
--- a/Telemetry.h Mon Feb 22 17:17:52 2016 +0000 +++ b/Telemetry.h Mon Feb 22 17:55:46 2016 +0000 @@ -1,29 +1,28 @@ -#include "c_api/_telemetry.h" +#include "c_api/telemetry.h" class Telemetry { public: Telemetry(uint32_t bauds = 9600); + // Need different names from C API otherwise calling a method will call + // this method again and again + void pub(const char * topic, char * msg); + void pub_u8(const char * topic, uint8_t msg); + void pub_u16(const char * topic, uint16_t msg); + void pub_u32(const char * topic, uint32_t msg); + void pub_i8(const char * topic, int8_t msg); + void pub_i16(const char * topic, int16_t msg); + void pub_i32(const char * topic, int32_t msg); + void pub_f32(const char * topic, float msg); - void publish(const char * topic, char * msg); - void publish_u8(const char * topic, uint8_t msg); - void publish_u16(const char * topic, uint16_t msg); - void publish_u32(const char * topic, uint32_t msg); - void publish_i8(const char * topic, int8_t msg); - void publish_i16(const char * topic, int16_t msg); - void publish_i32(const char * topic, int32_t msg); - void publish_f32(const char * topic, float msg); - - void subscribe(void (*callback)(TM_state * s, TM_msg * m)); - - void set(TM_state* userData); + void sub(void (*callback)(TM_state * s, TM_msg * m), TM_state* userData); void update(); private: TM_transport transport; }; - +/* uint32_t cast(TM_msg * m, char * buf, size_t bufSize); uint32_t cast_u8(TM_msg * m, uint8_t * dst); uint32_t cast_u16(TM_msg * m, uint16_t * dst); @@ -32,3 +31,4 @@ uint32_t cast_i16(TM_msg * m, int16_t * dst); uint32_t cast_i32(TM_msg * m, int32_t * dst); uint32_t cast_f32(TM_msg * m, float * dst); +*/