Fixed some typos

This commit is contained in:
Adam Greenwood-Byrne 2020-08-10 16:00:28 +01:00
parent dfbe5d5375
commit 2a2a48d1a7
2 changed files with 22 additions and 22 deletions

View file

@ -255,7 +255,7 @@ void stopAdvertising() {
} }
void startActiveScanning() { void startActiveScanning() {
float BleScanInterval = 60; float BleScanInterval = 60; // every 60ms
float BleScanWindow = 60; float BleScanWindow = 60;
float BleScanDivisor = 0.625; float BleScanDivisor = 0.625;
@ -269,25 +269,6 @@ void startActiveScanning() {
wait_msec(0x100000); wait_msec(0x100000);
} }
void connect()
{
float BleScanInterval = 60;
float BleScanWindow = 60;
float BleScanDivisor = 0.625;
float connMinFreq = 30; // every 100ms
float connMaxFreq = 50; // every 100ms
float BleGranularity = 1.25;
unsigned int p = BleScanInterval / BleScanDivisor;
unsigned int q = BleScanWindow / BleScanDivisor;
unsigned int min_interval = connMinFreq / BleGranularity;
unsigned int max_interval = connMaxFreq / BleGranularity;
createLEconnection(lo(p), hi(p), lo(q), hi(q), 0, 0, lo(min_interval), hi(min_interval), lo(max_interval), hi(max_interval));
}
void startActiveAdvertising() { void startActiveAdvertising() {
float advertMinFreq = 100; // every 100ms float advertMinFreq = 100; // every 100ms
float advertMaxFreq = 100; // every 100ms float advertMaxFreq = 100; // every 100ms
@ -300,3 +281,22 @@ void startActiveAdvertising() {
setLEadvertdata(); setLEadvertdata();
setLEadvertenable(1); setLEadvertenable(1);
} }
void connect()
{
float BleScanInterval = 60; // every 60ms
float BleScanWindow = 60;
float BleScanDivisor = 0.625;
float connMinFreq = 30; // every 30ms
float connMaxFreq = 50; // every 50ms
float BleGranularity = 1.25;
unsigned int p = BleScanInterval / BleScanDivisor;
unsigned int q = BleScanWindow / BleScanDivisor;
unsigned int min_interval = connMinFreq / BleGranularity;
unsigned int max_interval = connMaxFreq / BleGranularity;
createLEconnection(lo(p), hi(p), lo(q), hi(q), 0, 0, lo(min_interval), hi(min_interval), lo(max_interval), hi(max_interval));
}

View file

@ -146,8 +146,8 @@ void main()
for (int c=5;c>=0;c--) uart_byte(local_addr[c]); for (int c=5;c>=0;c--) uart_byte(local_addr[c]);
uart_writeText("\n"); uart_writeText("\n");
// Start scanning for devices around us
/* /*
// Start scanning for devices around us
uart_writeText("startActiveScanning()\n"); uart_writeText("startActiveScanning()\n");
setLEeventmask(0xff); setLEeventmask(0xff);
startActiveScanning(); startActiveScanning();
@ -156,8 +156,8 @@ void main()
uart_writeText("connect()\n"); uart_writeText("connect()\n");
connect(); connect();
// Get the Eddystone beacon going
/* /*
// Get the Eddystone beacon going
uart_writeText("startActiveAdvertising()\n"); uart_writeText("startActiveAdvertising()\n");
startActiveAdvertising(); startActiveAdvertising();
*/ */