mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-22 02:00:40 +00:00
Fixed connection timing issue
This commit is contained in:
parent
0fde327830
commit
e1f5c41c6d
3 changed files with 5 additions and 3 deletions
|
@ -262,8 +262,9 @@ void startActiveScanning() {
|
||||||
unsigned int p = BleScanInterval / BleScanDivisor;
|
unsigned int p = BleScanInterval / BleScanDivisor;
|
||||||
unsigned int q = BleScanWindow / BleScanDivisor;
|
unsigned int q = BleScanWindow / BleScanDivisor;
|
||||||
|
|
||||||
setLEwhitelist();
|
//setLEwhitelist();
|
||||||
setLEscanparameters(LL_SCAN_ACTIVE, lo(p), hi(p), lo(q), hi(q), 0, 1);
|
//setLEscanparameters(LL_SCAN_ACTIVE, lo(p), hi(p), lo(q), hi(q), 0, 1);
|
||||||
|
setLEscanparameters(LL_SCAN_ACTIVE, lo(p), hi(p), lo(q), hi(q), 0, 0);
|
||||||
setLEscanenable(1, 0);
|
setLEscanenable(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@ void startActiveScanning();
|
||||||
void stopScanning();
|
void stopScanning();
|
||||||
void startActiveAdvertising();
|
void startActiveAdvertising();
|
||||||
void connect(unsigned char *addr);
|
void connect(unsigned char *addr);
|
||||||
|
void bt_flushrx();
|
||||||
|
|
|
@ -171,9 +171,9 @@ void main()
|
||||||
startActiveScanning();
|
startActiveScanning();
|
||||||
uart_writeText("Waiting for echo: ");
|
uart_writeText("Waiting for echo: ");
|
||||||
while (!(got_echo_sid && got_echo_name)) bt_search();
|
while (!(got_echo_sid && got_echo_name)) bt_search();
|
||||||
|
stopScanning();
|
||||||
for (int c=0;c<=5;c++) uart_byte(echo_addr[c]);
|
for (int c=0;c<=5;c++) uart_byte(echo_addr[c]);
|
||||||
uart_writeText("\n");
|
uart_writeText("\n");
|
||||||
stopScanning();
|
|
||||||
|
|
||||||
// Ask to connect to the echo
|
// Ask to connect to the echo
|
||||||
uart_writeText("Connecting to echo: ");
|
uart_writeText("Connecting to echo: ");
|
||||||
|
|
Loading…
Reference in a new issue