#pragma once #include "SerialMessage.h" #include template class BluetoothSerialMessage : public SerialMessage{ public: /** * @brief Construct a new Bluetooth Serial Message object */ BluetoothSerialMessage(BluetoothSerial *serial); void Init(uint32_t baudRate) override{this->Init();} /** * @brief Initialize the BluetoothSerialMessage object */ void Init(); /** * @brief prints the args array to the serial monitor */ void PrintArgs() override; private: /** * @brief reads the serial data and stores it in the data array */ char getChar() override; uint32_t dataAvailable() override; BluetoothSerial *serial; }; template char BluetoothSerialMessage::getChar(){ return serial->read(); } template uint32_t BluetoothSerialMessage::dataAvailable(){ return serial->available(); } template BluetoothSerialMessage::BluetoothSerialMessage(BluetoothSerial *serial){ this->serial = serial; } template void BluetoothSerialMessage::Init(){ serial->begin("MiniBot"); } template void BluetoothSerialMessage::PrintArgs(){ serial->print("Current number of args: "); serial->println(this->populatedArgs); for (int i = 0; i < this->populatedArgs; i++) { serial->print(this->args[i]); serial->print(" "); } serial->println(); }