4 #include <boost/asio.hpp>
5 #include <boost/asio/serial_port.hpp>
6 #include <boost/log/trivial.hpp>
18 namespace goliath::btc {
48 Input(std::string type, std::string control, std::string value);
63 void set(
Status status,
short value);
104 void start(
const std::string &newDevicePath, std::string &newDeviceAddress);
124 void send(
Status status,
int value);
132 void send(
int severity, std::string message);
154 const char *devicePath;
155 const int BUFFER_SIZE = 1024;
156 std::string deviceAddress;
157 boost::asio::io_service io;
158 boost::asio::serial_port serialPort = boost::asio::serial_port(io);
161 Input convertInput(
char buffer[]);
Definition: bluetooth_controller.h:58
void start()
Start the controller.
Definition: bluetooth_controller.cpp:50
BluetoothController()
Constructor.
Definition: bluetooth_controller.cpp:224
void reconnect()
Reconnect to controller if connection was lost.
Definition: bluetooth_controller.cpp:63
void sendLast()
Send last status message to controller.
Definition: bluetooth_controller.cpp:170
InputError
enum for input errors
Definition: bluetooth_controller.h:35
Status
enum for all status updates to controller
Definition: bluetooth_controller.h:23
bool connect()
Connect to controller.
Definition: bluetooth_controller.cpp:10
Definition: bluetooth_controller.h:73
bool connected()
Check if still connected to controller.
Definition: bluetooth_controller.cpp:79
Input receive()
Wait for input to be received.
Definition: bluetooth_controller.cpp:102
void clear()
Clear bluetooth serial buffer.
Definition: bluetooth_controller.cpp:215