Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbedserial.h
- Committer:
- Kize
- Date:
- 2020-06-21
- Revision:
- 0:4289fbe66d45
File content as of revision 0:4289fbe66d45:
// mbedserial.h
// serial communication : mbed <-> ROS
#ifndef _MBEDSERIAL_
#define _MBEDSERIAL_
#include <mbed.h>
#include <stdio.h>
#include <string.h>
// mbedserial class
class Mbedserial
{
private:
char *msg_buf;
int bufsize;
char endmsg;
Serial& rospc;
void rcv_callback();
void (*pfunccb[3])();
public:
float getfloat[32];
int getint[32];
char getchar[256];
int floatarraysize;
int intarraysize;
int chararraysize;
Mbedserial(Serial&);
void float_write(float *array,int arraysize);
void int_write(int *array,int arraysize);
void char_write(char *array,int arraysize);
void float_attach(void (*pfunc)()){
pfunccb[0] = pfunc;
};
void int_attach(void (*pfunc)()){
pfunccb[1] = pfunc;
};
void char_attach(void (*pfunc)()){
pfunccb[2] = pfunc;
};
};
#endif