Skip to content

Commit 9c38ad7

Browse files
author
Antti Kauppila
authored
Merge pull request #7 from donatieng/fixes-9210
BLE fixes for ARMmbed#9210
2 parents b53bedb + 9dae672 commit 9c38ad7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

features/FEATURE_BLE/ble/services/EddystoneConfigService.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
#include "ble/BLE.h"
2323
#include "ble/services/EddystoneService.h"
24+
#include "Timer.h"
25+
#include "Ticker.h"
2426

2527
#define UUID_URI_BEACON(FIRST, SECOND) { \
2628
0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \
@@ -496,8 +498,8 @@ class EddystoneConfigService
496498

497499
BLEDevice &ble;
498500
Params_t &params;
499-
Ticker timeSinceBootTick;
500-
Timeout switchFrame;
501+
mbed::Ticker timeSinceBootTick;
502+
mbed::Timeout switchFrame;
501503
// Default value that is restored on reset.
502504
PowerLevels_t &defaultAdvPowerLevels; // This goes into the advertising frames (radio power measured at 1m from device).
503505
PowerLevels_t &radioPowerLevels; // This configures the power levels of the radio.

features/FEATURE_BLE/ble/services/EddystoneService.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#include "ble/BLE.h"
2323
#include "CircularBuffer.h"
24+
#include "Timer.h"
25+
#include "Ticker.h"
26+
#include "Timeout.h"
27+
2428
static const uint8_t BEACON_EDDYSTONE[] = {0xAA, 0xFE};
2529

2630
//Debug is disabled by default
@@ -75,7 +79,7 @@ class EddystoneService
7579
void (*frames[EDDYSTONE_MAX_FRAMETYPE])(uint8_t *, uint32_t);
7680
static const int URI_DATA_MAX = 18;
7781
typedef uint8_t UriData_t[URI_DATA_MAX];
78-
CircularBuffer<FrameTypes, EDDYSTONE_MAX_FRAMETYPE> overflow;
82+
mbed::CircularBuffer<FrameTypes, EDDYSTONE_MAX_FRAMETYPE> overflow;
7983

8084
// UID Frame Type subfields
8185
static const int UID_NAMESPACEID_SIZE = 10;
@@ -542,11 +546,11 @@ class EddystoneService
542546
BLEDevice &ble;
543547
uint16_t advPeriodus;
544548
uint8_t txPower;
545-
Timer timeSinceBootTimer;
549+
mbed::Timer timeSinceBootTimer;
546550
volatile uint32_t lastBootTimerRead;
547551
volatile bool advLock;
548552
volatile FrameTypes frameIndex;
549-
Timeout stopAdv;
553+
mbed::Timeout stopAdv;
550554

551555

552556
// URI Frame Variables
@@ -555,7 +559,7 @@ class EddystoneService
555559
int8_t defaultUrlPower;
556560
bool urlIsSet; // flag that enables / disable URI Frames
557561
float urlAdvPeriod; // how long the url frame will be advertised for
558-
Ticker urlTicker;
562+
mbed::Ticker urlTicker;
559563

560564
// UID Frame Variables
561565
UIDNamespaceID_t defaultUidNamespaceID;
@@ -564,7 +568,7 @@ class EddystoneService
564568
uint16_t uidRFU;
565569
bool uidIsSet; // flag that enables / disable UID Frames
566570
float uidAdvPeriod; // how long the uid frame will be advertised for
567-
Ticker uidTicker;
571+
mbed::Ticker uidTicker;
568572

569573
// TLM Frame Variables
570574
uint8_t TlmVersion;
@@ -574,7 +578,7 @@ class EddystoneService
574578
volatile uint32_t TlmTimeSinceBoot;
575579
bool tlmIsSet; // flag that enables / disables TLM frames
576580
float TlmAdvPeriod; // number of minutes between adv frames
577-
Ticker tlmTicker;
581+
mbed::Ticker tlmTicker;
578582

579583
public:
580584
/*

0 commit comments

Comments
 (0)