Solution for Bluetooth SIG hands-on training course

Dependencies:   BLE_API mbed-dev-bin nRF51822-bluetooth-mdw

Dependents:   microbit

Fork of microbit-dal-bluetooth-mdw_starter by Martin Woolley

Files at this revision

API Documentation at this revision

Comitter:
LancasterUniversity
Date:
Wed Jul 13 12:17:50 2016 +0100
Parent:
18:e2f92ac26450
Child:
20:ad2a5c7debf4
Commit message:
Synchronized with git rev 82ed22d1
Author: Joe Finney
microbit: MicroBitRadio group ID now persists enable/disable operations

MicroBitradio::enable() would reset the group ID of the radio to the default
value on each call. Updated to do this only once at object initialisation time.

Changed in this revision

source/drivers/MicroBitRadio.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/drivers/MicroBitRadio.cpp	Wed Jul 13 12:17:48 2016 +0100
+++ b/source/drivers/MicroBitRadio.cpp	Wed Jul 13 12:17:50 2016 +0100
@@ -99,7 +99,7 @@
 {
     this->id = id;
     this->status = 0;
-	this->group = 0;
+	this->group = MICROBIT_RADIO_DEFAULT_GROUP;
 	this->queueDepth = 0;
     this->rssi = 0;
     this->rxQueue = NULL;
@@ -279,7 +279,7 @@
     NRF_RADIO->BASE0 = MICROBIT_RADIO_BASE_ADDRESS;
 
     // Join the default group. This will configure the remaining byte in the RADIO hardware module.
-    setGroup(MICROBIT_RADIO_DEFAULT_GROUP);
+    setGroup(this->group);
 
     // The RADIO hardware module supports the use of multiple addresses, but as we're running anonymously, we only need one.
     // Configure the RADIO module to use the default address (address 0) for both send and receive operations.