arduino stuffs
Diffstat (limited to 'car_driver/godot/src/gdserial.h')
| -rw-r--r-- | car_driver/godot/src/gdserial.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/car_driver/godot/src/gdserial.h b/car_driver/godot/src/gdserial.h new file mode 100644 index 0000000..b48f58d --- /dev/null +++ b/car_driver/godot/src/gdserial.h @@ -0,0 +1,30 @@ +#ifndef GDSERIAL_H +#define GDSERIAL_H + +#include <Godot.hpp> + +namespace godot { + +class GDSerial : public Reference { + GODOT_CLASS(GDSerial, Reference) + + int serial_port; + +public: + static void _register_methods(); + + GDSerial(); + ~GDSerial(); + + void _init(); // our initializer called by Godot + + bool start(String port, int baud_rate); + void end(); + void send(String text); + int get_available(); + String read_string(); +}; + +} // namespace godot + +#endif |