Kazufumi Honda / Mbed 2 deprecated RosSerialModule

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbedserial.h Source File

mbedserial.h

00001 // mbedserial.h
00002 // serial communication : mbed <-> ROS
00003 
00004 #ifndef _MBEDSERIAL_
00005 #define _MBEDSERIAL_
00006 
00007 #include <mbed.h>
00008 #include <stdio.h>
00009 #include <string.h>
00010 
00011 // mbedserial class
00012 class Mbedserial
00013 {
00014     private:
00015         char *msg_buf;
00016         int bufsize;
00017         char endmsg;
00018         Serial& rospc;
00019         void rcv_callback();
00020         void (*pfunccb[3])();
00021 
00022     public:
00023         float getfloat[32];
00024         int getint[32];
00025         char getchar[256];
00026         int floatarraysize;
00027         int intarraysize;
00028         int chararraysize;
00029         Mbedserial(Serial&);
00030         void float_write(float *array,int arraysize);
00031         void int_write(int *array,int arraysize);
00032         void char_write(char *array,int arraysize);
00033         void float_attach(void (*pfunc)()){
00034             pfunccb[0] = pfunc;
00035         };
00036         void int_attach(void (*pfunc)()){
00037             pfunccb[1] = pfunc;
00038         };
00039         void char_attach(void (*pfunc)()){
00040             pfunccb[2] = pfunc;
00041         };
00042 };
00043 
00044 #endif