@@ -119,7 +119,8 @@ void setup()
119
119
120
120
// Configure and Start BLE Uart Service
121
121
// Set Permission to access BLE Uart is to require man-in-the-middle protection
122
- // This will cause central to perform pairing with static PIN we set above
122
+ // This will cause central to perform pairing with a generated passkey, the passkey will
123
+ // be printed on display or Serial and wait for our input
123
124
Serial.println (" Configure BLE Uart to require man-in-the-middle protection for PIN pairing" );
124
125
bleuart.setPermission (SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
125
126
bleuart.begin ();
@@ -266,7 +267,7 @@ bool pairing_passkey_callback(uint16_t conn_handle, uint8_t const passkey[6], bo
266
267
uint32_t justReleased;
267
268
do
268
269
{
269
- // Disconnected while waiting for input
270
+ // Peer is disconnected while waiting for input
270
271
if ( !Bluefruit.connected (conn_handle) ) break ;
271
272
272
273
// time out
@@ -286,7 +287,7 @@ bool pairing_passkey_callback(uint16_t conn_handle, uint8_t const passkey[6], bo
286
287
// wait until either button is pressed (30 seconds timeout)
287
288
while ( digitalRead (BUTTON_YES) && digitalRead (BUTTON_NO) )
288
289
{
289
- // Disconnected while waiting for input
290
+ // Peer is disconnected while waiting for input
290
291
if ( !Bluefruit.connected (conn_handle) ) break ;
291
292
292
293
// time out
@@ -355,6 +356,9 @@ void disconnect_callback(uint16_t conn_handle, uint8_t reason)
355
356
Serial.print (" Disconnected, reason = 0x" ); Serial.println (reason, HEX);
356
357
357
358
#ifdef USE_ARCADA
359
+ tft->fillScreen (ARCADA_BLACK);
360
+ tft->setTextSize (2 );
361
+ tft->setCursor (0 , 0 );
358
362
tft->println (" Advertising ..." );
359
363
#endif
360
364
}
0 commit comments