Skip to content

Commit def51aa

Browse files
committed
fix: unused variable warnings
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 612d7d1 commit def51aa

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/utility/HCI.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,19 +521,17 @@ int HCIClass::leReadPeerResolvableAddress(uint8_t peerAddressType, uint8_t* peer
521521
#ifdef _BLE_TRACE_
522522
Serial.print("res: 0x");
523523
Serial.println(res, HEX);
524-
#endif
525524
if(res==0){
526525
struct __attribute__ ((packed)) Response {
527526
uint8_t status;
528527
uint8_t peerResolvableAddress[6];
529528
} *response = (Response*)_cmdResponse;
530-
#ifdef _BLE_TRACE_
531529
Serial.print("Address resolution status: 0x");
532530
Serial.println(response->status, HEX);
533531
Serial.print("peer resolvable address: ");
534532
btct.printBytes(response->peerResolvableAddress,6);
535-
#endif
536533
}
534+
#endif
537535
return res;
538536
}
539537

src/utility/btct.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ void BluetoothCryptoToolbox::printBytes(uint8_t bytes[], uint8_t length){
3737
Serial.print(bytes[i],HEX);
3838
}
3939
Serial.print('\n');
40+
#else
41+
(void)bytes;
42+
(void)length;
4043
#endif
4144
}
4245

@@ -130,7 +133,7 @@ int BluetoothCryptoToolbox::ah(uint8_t k[16], uint8_t r[3], uint8_t* result)
130133
}
131134
void BluetoothCryptoToolbox::testAh()
132135
{
133-
uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};
136+
uint8_t irk[16] = {0xec,0x02,0x34,0xa3,0x57,0xc8,0xad,0x05,0x34,0x10,0x10,0xa6,0x0a,0x39,0x7d,0x9b};
134137
uint8_t expected_final[3] = {0x0d,0xfb,0xaa};
135138
uint8_t ourResult[3];
136139
ah(irk, expected_final, ourResult);
@@ -165,14 +168,12 @@ void BluetoothCryptoToolbox::testg2(){
165168
uint8_t Y[16] = {0xa6,0xe8,0xe7,0xcc,0x25,0xa7,0x5f,0x6e,0x21,0x65,0x83,0xf7,0xff,0x3d,0xc4,0xcf};
166169
uint8_t out[4];
167170

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

173175
#ifdef _BLE_TRACE_
174-
Serial.print("Expected : ");
175-
Serial.println(expected);
176+
Serial.println("Expected : 0");
176177
Serial.print("Result : ");
177178
Serial.println(result);
178179
Serial.println();
@@ -383,4 +384,4 @@ void BluetoothCryptoToolbox::xor_128(unsigned char *a, unsigned char *b, unsigne
383384
out[i] = a[i] ^ b[i];
384385
}
385386
}
386-
BluetoothCryptoToolbox btct;
387+
BluetoothCryptoToolbox btct;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy