Make _gapInstance non-static in nRF5xn

master
Andres Amaya Garcia 2015-12-15 13:16:05 +00:00
parent 786cd0b9bf
commit 252ef3cfbd
2 changed files with 5 additions and 10 deletions

View File

@ -31,12 +31,6 @@ extern "C" {
*/
static nRF5xn deviceInstance;
/**
* The singleton for nRF5xGap. This has been kept static because it is
* always needed for any application that uses BLE.
*/
nRF5xGap nRF5xn::_gapInstance;
/**
* BLE-API requires an implementation of the following function in order to
* obtain its transport handle.
@ -55,6 +49,7 @@ nRF5xn& nRF5xn::Instance(BLE::InstanceID_t instanceId)
nRF5xn::nRF5xn(void) :
initialized(false),
instanceID(BLE::DEFAULT_INSTANCE),
_gapInstance(),
gapInstance(NULL),
gattServerInstance(NULL),
gattClientInstance(NULL),

View File

@ -166,10 +166,10 @@ private:
BLE::InstanceID_t instanceID;
private:
static nRF5xGap _gapInstance; /**< Gap instance whose reference is returned from a call to
* getGap(). Unlike the GattClient, GattServer and
* SecurityManager, Gap is always needed in a BLE application.
* Therefore it is allocated statically. */
mutable nRF5xGap _gapInstance; /**< Gap instance whose reference is returned from a call to
* getGap(). Unlike the GattClient, GattServer and
* SecurityManager, Gap is always needed in a BLE application.
* Therefore it is allocated statically. */
private:
mutable nRF5xGap *gapInstance; /**< Pointer to the Gap object instance.