Skip to content

Commit f649712

Browse files
committed
clean up
1 parent a07004a commit f649712

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

libraries/Bluefruit52Lib/examples/Central/central_bleuart/central_bleuart.ino

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
BLEClientDis clientDis;
2222
BLEClientUart clientUart;
2323

24-
void setup()
24+
void setup()
2525
{
2626
Serial.begin(115200);
2727

2828
Serial.println("Bluefruit52 Central BLEUART Example");
2929
Serial.println("-----------------------------------");
3030

31-
// up to 1 peripheral conn and 1 central conn
31+
// Enable both peripheral and central
3232
Bluefruit.begin(true, true);
3333
Bluefruit.setName("Bluefruit52");
3434

@@ -39,7 +39,7 @@ void setup()
3939
clientUart.begin();
4040
clientUart.setRxCallback(uart_rx_callback);
4141

42-
// Increase BLink rate to different from PrPh advertising mode
42+
// Increase Blink rate to different from PrPh advertising mode
4343
Bluefruit.setConnLedInterval(250);
4444

4545
// Callbacks for Central
@@ -51,6 +51,10 @@ void setup()
5151
Bluefruit.Central.startScanning();
5252
}
5353

54+
/**
55+
* Callback invoked when scanner pick up an advertising data
56+
* @param report Structural advertising data
57+
*/
5458
void scan_callback(ble_gap_evt_adv_report_t* report)
5559
{
5660
// Check if advertising contain BleUart service
@@ -65,6 +69,10 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
6569
}
6670
}
6771

72+
/**
73+
* Callback invoked when an connection is established
74+
* @param conn_handle
75+
*/
6876
void connect_callback(uint16_t conn_handle)
6977
{
7078
Serial.println("Connected");
@@ -110,6 +118,11 @@ void connect_callback(uint16_t conn_handle)
110118
}
111119
}
112120

121+
/**
122+
* Callback invoked when a connection is dropped
123+
* @param conn_handle
124+
* @param reason
125+
*/
113126
void disconnect_callback(uint16_t conn_handle, uint8_t reason)
114127
{
115128
(void) conn_handle;

0 commit comments

Comments
 (0)