Loom_Bluetooth class
Bluetooth communication platform module.
Contents
Needs more work for complete functionality.
Base classes
- class LoomCommPlat
- Abstract base of communication platform modules.
Protected variables
CONSTRUCTORS / DESTRUCTOR
- Loom_Bluetooth(LoomManager* manager, const uint16_t max_message_len = 120, const uint8_t spi_CS = 8, const uint8_t spi_IRQ = 7, const uint8_t spi_RST = 4)
- Constructor.
- Loom_Bluetooth(LoomManager* manager, JsonArrayConst p)
- Constructor that takes Json Array, extracts args and delegates to regular constructor.
- ~Loom_Bluetooth() defaulted
- Destructor.
OPERATION
- void add_config(JsonObject json) override
- Currently no implementation.
- void connect(const uint16_t connect_timeout)
- Allow a phone to connect.
- auto getCommand(const uint16_t max_timeout) -> int8_t
- Receive a command from user.
PRINT INFORMATION
- void print_config() const override
- Display the configuration settings of the module.
GETTERS
- auto get_address() const -> uint8_t override
- Bluetooth currently does not use addresses.
SETTERS
- void set_address(const uint8_t addr) override
- Bluetooth currently does not use addresses.
Function documentation
Loom_ Bluetooth:: Loom_Bluetooth(LoomManager* manager,
const uint16_t max_message_len = 120,
const uint8_t spi_CS = 8,
const uint8_t spi_IRQ = 7,
const uint8_t spi_RST = 4)
Constructor.
Parameters | |
---|---|
manager | |
max_message_len in | The maximum possible message length |
spi_CS in | SPI chip select pin |
spi_IRQ in | SPI IRQ pin |
spi_RST in | SPI reset pin |
Loom_ Bluetooth:: Loom_Bluetooth(LoomManager* manager,
JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
Parameters | |
---|---|
manager | |
p in | The array of constuctor args to expand |
void Loom_ Bluetooth:: connect(const uint16_t connect_timeout)
Allow a phone to connect.
Parameters | |
---|---|
connect_timeout in | Max time to allow user to try to connect |
int8_t Loom_ Bluetooth:: getCommand(const uint16_t max_timeout)
Receive a command from user.
Parameters | |
---|---|
max_timeout in | Maximum number of milliseconds to wait for command |
Returns | Status Gets a command from the ble interface, or times out. This is used in combination with parseCommand if the return value is valid. |
uint8_t Loom_ Bluetooth:: get_address() const override
Bluetooth currently does not use addresses.
Override with empty body
void Loom_ Bluetooth:: set_address(const uint8_t addr) override
Bluetooth currently does not use addresses.
Override with empty body