added end() method, stop'ping BLE

This commit is contained in:
lathoub 2021-05-28 21:06:07 +02:00
parent e0fb12b9c0
commit aa0f6bc44a
6 changed files with 31 additions and 1 deletions

View File

@ -48,6 +48,11 @@ public:
mBleClass.begin(mDeviceName, this); mBleClass.begin(mDeviceName, this);
} }
void end()
{
mBleClass.end();
}
bool beginTransmission(MIDI_NAMESPACE::MidiType type) bool beginTransmission(MIDI_NAMESPACE::MidiType type)
{ {
getMidiTimestamp(&mTxBuffer[0], &mTxBuffer[1]); getMidiTimestamp(&mTxBuffer[0], &mTxBuffer[1]);

View File

@ -22,6 +22,11 @@ public:
bool begin(const char*, BLEMIDI<class BLEMIDI_Client_ESP32>*); bool begin(const char*, BLEMIDI<class BLEMIDI_Client_ESP32>*);
void end()
{
}
void write(uint8_t* data, uint8_t length) void write(uint8_t* data, uint8_t length)
{ {
_characteristic->setValue(data, length); _characteristic->setValue(data, length);

View File

@ -75,6 +75,11 @@ public:
bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ArduinoBLE>*); bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ArduinoBLE>*);
void end()
{
}
void write(uint8_t* buffer, size_t length) void write(uint8_t* buffer, size_t length)
{ {
// TODO: test length // TODO: test length

View File

@ -30,6 +30,11 @@ public:
bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ESP32>*); bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ESP32>*);
void end()
{
}
void write(uint8_t* buffer, size_t length) void write(uint8_t* buffer, size_t length)
{ {
_characteristic->setValue(buffer, length); _characteristic->setValue(buffer, length);

View File

@ -27,6 +27,11 @@ public:
bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ESP32_NimBLE>*); bool begin(const char*, BLEMIDI_Transport<class BLEMIDI_ESP32_NimBLE>*);
void end()
{
}
void write(uint8_t* buffer, size_t length) void write(uint8_t* buffer, size_t length)
{ {
_characteristic->setValue(buffer, length); _characteristic->setValue(buffer, length);

View File

@ -24,6 +24,11 @@ public:
bool begin(const char*, BLEMIDI_NAMESPACE::BLEMIDI_Transport<class BLEMIDI_nRF52>*); bool begin(const char*, BLEMIDI_NAMESPACE::BLEMIDI_Transport<class BLEMIDI_nRF52>*);
void end()
{
}
void write(uint8_t* buffer, size_t length) void write(uint8_t* buffer, size_t length)
{ {
} }