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.
Diff: mbedserial.h
- Revision:
- 0:4289fbe66d45
diff -r 000000000000 -r 4289fbe66d45 mbedserial.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbedserial.h Sun Jun 21 01:48:47 2020 +0000
@@ -0,0 +1,44 @@
+// 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
\ No newline at end of file