Skip to content

Commit

Permalink
Fix compatibility with NimBle version 2.0.0
Browse files Browse the repository at this point in the history
- Modified method signatures to adapt to changes in NimBle version 2.0.0.
  • Loading branch information
Sab1e-GitHub committed Dec 2, 2024
1 parent cdf05b3 commit 51cdda3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions BleConnectionStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ BleConnectionStatus::BleConnectionStatus(void)
{
}

void BleConnectionStatus::onConnect(NimBLEServer *pServer, ble_gap_conn_desc* desc)
void BleConnectionStatus::onConnect(NimBLEServer *pServer, NimBLEConnInfo& connInfo)
{
pServer->updateConnParams(desc->conn_handle, 6, 7, 0, 600);
pServer->updateConnParams(connInfo.getConnHandle(), 6, 7, 0, 600);
this->connected = true;
}

void BleConnectionStatus::onDisconnect(NimBLEServer *pServer)
void BleConnectionStatus::onDisconnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo, int reason)
{
this->connected = false;
}
4 changes: 2 additions & 2 deletions BleConnectionStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class BleConnectionStatus : public NimBLEServerCallbacks
public:
BleConnectionStatus(void);
bool connected = false;
void onConnect(NimBLEServer *pServer, ble_gap_conn_desc* desc);
void onDisconnect(NimBLEServer *pServer);
void onConnect(NimBLEServer *pServer, NimBLEConnInfo& connInfo) override;
void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo& connInfo, int reason) override;
NimBLECharacteristic *inputGamepad;
};

Expand Down
2 changes: 1 addition & 1 deletion BleOutputReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BleOutputReceiver::~BleOutputReceiver()
}
}

void BleOutputReceiver::onWrite(NimBLECharacteristic *pCharacteristic)
void BleOutputReceiver::onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo& connInfo)
{
// Retrieve data sent from the host
std::string value = pCharacteristic->getValue();
Expand Down
2 changes: 1 addition & 1 deletion BleOutputReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BleOutputReceiver : public NimBLECharacteristicCallbacks
public:
BleOutputReceiver(uint16_t outputReportLength);
~BleOutputReceiver();
void onWrite(NimBLECharacteristic *pCharacteristic) override;
void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo& connInfo) override;
bool outputFlag = false;
uint16_t outputReportLength;
uint8_t *outputBuffer;
Expand Down

0 comments on commit 51cdda3

Please sign in to comment.