Release 0.4.5
============= Enhancements ~~~~~~~~~~~~ * Update module.json to depend on mbed-drivers instead of mbed-core. * GapADVParams::get/setInterval() are now counterparts in terms of their units. Bugfixes ~~~~~~~~ none.
This commit is contained in:
commit
5333f3691a
3 changed files with 27 additions and 9 deletions
|
@ -465,7 +465,7 @@ public:
|
|||
} else if (interval < getMinAdvertisingInterval()) {
|
||||
interval = getMinAdvertisingInterval();
|
||||
}
|
||||
_advParams.setInterval(GapAdvertisingParams::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(interval));
|
||||
_advParams.setInterval(interval);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,18 +94,36 @@ public:
|
|||
return (gapUnits * UNIT_0_625_MS) / 1000;
|
||||
}
|
||||
|
||||
AdvertisingType_t getAdvertisingType(void) const {return _advType; }
|
||||
uint16_t getInterval(void) const {return ADVERTISEMENT_DURATION_UNITS_TO_MS(_interval);}
|
||||
uint16_t getTimeout(void) const {return _timeout; }
|
||||
AdvertisingType_t getAdvertisingType(void) const {
|
||||
return _advType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the advertisement interval (in milliseconds)
|
||||
*/
|
||||
uint16_t getInterval(void) const {
|
||||
return ADVERTISEMENT_DURATION_UNITS_TO_MS(_interval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the advertisement interval in units advertisement duration units--i.e. 0.625ms units.
|
||||
*/
|
||||
uint16_t getIntervalInADVUnits(void) const {
|
||||
return _interval;
|
||||
}
|
||||
|
||||
uint16_t getTimeout(void) const {
|
||||
return _timeout;
|
||||
}
|
||||
|
||||
void setAdvertisingType(AdvertisingType_t newAdvType) {_advType = newAdvType; }
|
||||
void setInterval(uint16_t newInterval) {_interval = newInterval;}
|
||||
void setInterval(uint16_t newInterval) {_interval = MSEC_TO_ADVERTISEMENT_DURATION_UNITS(newInterval);}
|
||||
void setTimeout(uint16_t newTimeout) {_timeout = newTimeout; }
|
||||
|
||||
private:
|
||||
AdvertisingType_t _advType;
|
||||
uint16_t _interval;
|
||||
uint16_t _timeout;
|
||||
uint16_t _interval; /* in ADV duration units (i.e. 0.625ms) */
|
||||
uint16_t _timeout; /* in seconds */
|
||||
};
|
||||
|
||||
#endif // ifndef __GAP_ADVERTISING_PARAMS_H__
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ble",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"description": "The BLE module offers a high level abstraction for using Bluetooth Low Energy on multiple platforms.",
|
||||
"keywords": [
|
||||
"Bluetooth",
|
||||
|
@ -27,7 +27,7 @@
|
|||
"mbed-classic": "~0.0.1"
|
||||
},
|
||||
"mbed": {
|
||||
"mbed-core": "*"
|
||||
"mbed-drivers": "*"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue