Skip to content

fix: unused variable warnings #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/utility/HCI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,19 +521,17 @@ int HCIClass::leReadPeerResolvableAddress(uint8_t peerAddressType, uint8_t* peer
#ifdef _BLE_TRACE_
Serial.print("res: 0x");
Serial.println(res, HEX);
#endif
if(res==0){
struct __attribute__ ((packed)) Response {
uint8_t status;
uint8_t peerResolvableAddress[6];
} *response = (Response*)_cmdResponse;
#ifdef _BLE_TRACE_
Serial.print("Address resolution status: 0x");
Serial.println(response->status, HEX);
Serial.print("peer resolvable address: ");
btct.printBytes(response->peerResolvableAddress,6);
#endif
}
#endif
return res;
}

Expand Down
11 changes: 6 additions & 5 deletions src/utility/btct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
Serial.print(bytes[i],HEX);
}
Serial.print('\n');
#else
(void)bytes;
(void)length;
#endif
}

Expand Down Expand Up @@ -130,7 +133,7 @@
}
void BluetoothCryptoToolbox::testAh()
{
uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};
uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};

Check warning on line 136 in src/utility/btct.cpp

View check run for this annotation

Codecov / codecov/patch

src/utility/btct.cpp#L136

Added line #L136 was not covered by tests
uint8_t expected_final[3] = {0x0d,0xfb,0xaa};
uint8_t ourResult[3];
ah(irk, expected_final, ourResult);
Expand Down Expand Up @@ -165,14 +168,12 @@
uint8_t Y[16] = {0xa6,0xe8,0xe7,0xcc,0x25,0xa7,0x5f,0x6e,0x21,0x65,0x83,0xf7,0xff,0x3d,0xc4,0xcf};
uint8_t out[4];

uint32_t expected = 0;
g2(U,V,X,Y,out);
uint32_t result = 0;
for(int i=0; i<4; i++) result += out[i] << 8*i;

#ifdef _BLE_TRACE_
Serial.print("Expected : ");
Serial.println(expected);
Serial.println("Expected : 0");
Serial.print("Result : ");
Serial.println(result);
Serial.println();
Expand Down Expand Up @@ -383,4 +384,4 @@
out[i] = a[i] ^ b[i];
}
}
BluetoothCryptoToolbox btct;
BluetoothCryptoToolbox btct;
Loading