Skip to content

Commit 3fc460e

Browse files
authored
Merge pull request #2 from RobertoHE/patch-1
fixed template sintaxis of Client
2 parents 75e994c + c69bb30 commit 3fc460e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/hardware/BLEMIDI_Client_ESP32.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ BEGIN_BLEMIDI_NAMESPACE
174174
#define BLEMIDI_CLIENT_SECURITY_AUTH (BLEMIDI_CLIENT_BOND_DUMMY | BLEMIDI_CLIENT_MITM_DUMMY | BLEMIDI_CLIENT_PAIR_DUMMY)
175175

176176
/** Define a class to handle the callbacks when advertisments are received */
177-
template <class _Settings>
178177
class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
179178
{
180179
public:
@@ -235,10 +234,7 @@ class BLEMIDI_Client_ESP32
235234

236235
bool specificTarget = false;
237236

238-
// TODO: somehow the forward declaration of the template class is not accepted by the compiler
239-
// template <class> friend MyClientCallbacks;
240-
241-
AdvertisedDeviceCallbacks<_Settings> myAdvCB;
237+
AdvertisedDeviceCallbacks myAdvCB;
242238

243239
protected:
244240
QueueHandle_t mRxQueue;
@@ -300,7 +296,7 @@ class BLEMIDI_Client_ESP32
300296
void scan();
301297
bool connect();
302298

303-
public: // TODO: somehow the forward declaration of the template class is not accepted by the compiler
299+
public:
304300
void connected()
305301
{
306302
if (_bleMidiTransport->_connectedCallback)
@@ -432,7 +428,7 @@ bool BLEMIDI_Client_ESP32<_Settings>::begin(const char *deviceName, BLEMIDI_Tran
432428

433429
// To communicate between the 2 cores.
434430
// Core_0 runs here, core_1 runs the BLE stack
435-
mRxQueue = xQueueCreate(256, sizeof(uint8_t)); // TODO Settings::MaxBufferSize
431+
mRxQueue = xQueueCreate(_Settings::MaxBufferSize, sizeof(uint8_t));
436432

437433
NimBLEDevice::setSecurityIOCap(BLEMIDI_CLIENT_SECURITY_CAP); // Attention, it may need a passkey
438434
NimBLEDevice::setSecurityAuth(BLEMIDI_CLIENT_SECURITY_AUTH);

0 commit comments

Comments
 (0)