Skip to content

Commit c80127e

Browse files
authored
Correctly initialise blankAddress variable to prevent compiler warning
1 parent c48ca5d commit c80127e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

BleGamepad.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,13 +1535,12 @@ NimBLEAddress BleGamepad::getAddress()
15351535

15361536
if (server)
15371537
{
1538-
15391538
// Get current connection information and address
15401539
NimBLEConnInfo currentConnInfo = server->getPeerInfo(0);
15411540
NimBLEAddress currentAddress = currentConnInfo.getAddress();
15421541
return currentAddress;
15431542
}
1544-
NimBLEAddress blankAddress;
1543+
NimBLEAddress blankAddress("00:00:00:00:00:00", 0);
15451544
return blankAddress;
15461545
}
15471546

@@ -1551,13 +1550,12 @@ String BleGamepad::getStringAddress()
15511550

15521551
if (server)
15531552
{
1554-
15551553
// Get current connection information and address
15561554
NimBLEConnInfo currentConnInfo = server->getPeerInfo(0);
15571555
NimBLEAddress currentAddress = currentConnInfo.getAddress();
15581556
return currentAddress.toString().c_str();
15591557
}
1560-
NimBLEAddress blankAddress;
1558+
NimBLEAddress blankAddress("00:00:00:00:00:00", 0);
15611559
return blankAddress.toString().c_str();
15621560
}
15631561

@@ -1605,7 +1603,8 @@ void BleGamepad::taskServer(void *pvParameter)
16051603
BleGamepadInstance->inputGamepad = BleGamepadInstance->hid->getInputReport(BleGamepadInstance->configuration.getHidReportId()); // <-- input REPORTID from report map
16061604
BleGamepadInstance->connectionStatus->inputGamepad = BleGamepadInstance->inputGamepad;
16071605

1608-
if (enableOutputReport) {
1606+
if (enableOutputReport)
1607+
{
16091608
BleGamepadInstance->outputGamepad = BleGamepadInstance->hid->getOutputReport(BleGamepadInstance->configuration.getHidReportId());
16101609
BleGamepadInstance->outputReceiver = new BleOutputReceiver(outputReportLength);
16111610
BleGamepadInstance->outputBackupBuffer = new uint8_t[outputReportLength];

0 commit comments

Comments
 (0)