Skip to content

Change singleton definition. #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/local/BLELocalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,5 @@ void BLELocalDevice::noDebug()
HCI.noDebug();
}

BLELocalDevice BLE;
BLELocalDevice BLEObj;
BLELocalDevice& BLE = BLEObj;
2 changes: 1 addition & 1 deletion src/local/BLELocalDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ class BLELocalDevice {
private:
};

extern BLELocalDevice BLE;
extern BLELocalDevice& BLE;

#endif
3 changes: 2 additions & 1 deletion src/utility/ATT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,4 +1687,5 @@ void ATTClass::writeCmd(uint16_t connectionHandle, uint16_t handle, const uint8_
sendReq(connectionHandle, &writeReq, 3 + dataLen, NULL);
}

ATTClass ATT;
ATTClass ATTObj;
ATTClass& ATT = ATTObj;
2 changes: 1 addition & 1 deletion src/utility/ATT.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ class ATTClass {
BLEDeviceEventHandler _eventHandlers[2];
};

extern ATTClass ATT;
extern ATTClass& ATT;

#endif
3 changes: 2 additions & 1 deletion src/utility/GAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,5 @@ bool GAPClass::matchesScanFilter(const BLEDevice& device)
return true;
}

GAPClass GAP;
GAPClass GAPObj;
GAPClass& GAP = GAPObj;
2 changes: 1 addition & 1 deletion src/utility/GAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ class GAPClass {
String _scanAddressFilter;
};

extern GAPClass GAP;
extern GAPClass& GAP;

#endif
3 changes: 2 additions & 1 deletion src/utility/GATT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@ void GATTClass::clearAttributes()
_attributes.clear();
}

GATTClass GATT;
GATTClass GATTObj;
GATTClass& GATT = GATTObj;
2 changes: 1 addition & 1 deletion src/utility/GATT.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ class GATTClass {
BLELocalCharacteristic* _servicesChangedCharacteristic;
};

extern GATTClass GATT;
extern GATTClass& GATT;

#endif
3 changes: 2 additions & 1 deletion src/utility/HCI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,4 +686,5 @@ void HCIClass::dumpPkt(const char* prefix, uint8_t plen, uint8_t pdata[])
}
}

HCIClass HCI;
HCIClass HCIObj;
HCIClass& HCI = HCIObj;
2 changes: 1 addition & 1 deletion src/utility/HCI.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ class HCIClass {
uint8_t _aclPktBuffer[255];
};

extern HCIClass HCI;
extern HCIClass& HCI;

#endif
3 changes: 2 additions & 1 deletion src/utility/L2CAPSignaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ void L2CAPSignalingClass::connectionParameterUpdateResponse(uint16_t /*handle*/,
{
}

L2CAPSignalingClass L2CAPSignaling;
L2CAPSignalingClass L2CAPSignalingObj;
L2CAPSignalingClass& L2CAPSignaling = L2CAPSignalingObj;
2 changes: 1 addition & 1 deletion src/utility/L2CAPSignaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ class L2CAPSignalingClass {
uint16_t _maxInterval;
};

extern L2CAPSignalingClass L2CAPSignaling;
extern L2CAPSignalingClass& L2CAPSignaling;

#endif