Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ARMmbed/ble-nrf51822
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.4
Choose a base ref
...
head repository: ARMmbed/ble-nrf51822
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.5
Choose a head ref
  • 6 commits
  • 2 files changed
  • 2 contributors

Commits on Aug 10, 2015

  1. changed getInterval to getIntervalInAdvUnits to support changes in Ga…

    …pAdvertisingParams.h
    jslater8 authored and Rohit Grover committed Aug 10, 2015

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    781dcbd View commit details
  2. rename to getIntervalInADVUnits()

    Rohit Grover committed Aug 10, 2015
    Copy the full SHA
    bf25a5a View commit details
  3. getAppearance now checks for correct success code from sd_ble_gap_app…

    …earance_get
    jslater8 authored and Rohit Grover committed Aug 10, 2015
    Copy the full SHA
    8830c07 View commit details
  4. https://github.com/ARMmbed/ble-nrf51822/pull/36

    * renamed to GapAdvertisementParams::getIntervalInADVUnits()
    * fix getAppearance() to checks for correct success code from sd_ble_gap_appearance_get().
    Rohit Grover committed Aug 10, 2015
    Copy the full SHA
    7e6bd9a View commit details
  5. require ble-0.4.5 because of API changes

    Rohit Grover committed Aug 10, 2015
    Copy the full SHA
    dae7886 View commit details
  6. version v0.4.5

    Rohit Grover committed Aug 10, 2015
    Copy the full SHA
    ab1f765 View commit details
Showing with 9 additions and 9 deletions.
  1. +2 −2 module.json
  2. +7 −7 source/nRF5xGap.cpp
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ble-nrf51822",
"version": "0.4.4",
"version": "0.4.5",
"description": "Nordic stack and drivers for the mbed BLE API.",
"keywords": [
"Bluetooth",
@@ -19,7 +19,7 @@
}
],
"dependencies": {
"ble": "~0.4.4"
"ble": "~0.4.5"
},
"extraIncludes": [
"source/btle",
14 changes: 7 additions & 7 deletions source/nRF5xGap.cpp
Original file line number Diff line number Diff line change
@@ -143,13 +143,13 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
/* Check interval range */
if (params.getAdvertisingType() == GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED) {
/* Min delay is slightly longer for unconnectable devices */
if ((params.getInterval() < GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MIN_NONCON) ||
(params.getInterval() > GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MAX)) {
if ((params.getIntervalInADVUnits() < GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MIN_NONCON) ||
(params.getIntervalInADVUnits() > GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MAX)) {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
} else {
if ((params.getInterval() < GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MIN) ||
(params.getInterval() > GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MAX)) {
if ((params.getIntervalInADVUnits() < GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MIN) ||
(params.getIntervalInADVUnits() > GapAdvertisingParams::GAP_ADV_PARAMS_INTERVAL_MAX)) {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
}
@@ -171,10 +171,10 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
ble_gap_adv_params_t adv_para = {0};

adv_para.type = params.getAdvertisingType();
adv_para.p_peer_addr = NULL; // Undirected advertisement
adv_para.p_peer_addr = NULL; // Undirected advertisement
adv_para.fp = BLE_GAP_ADV_FP_ANY;
adv_para.p_whitelist = NULL;
adv_para.interval = params.getInterval(); // advertising interval (in units of 0.625 ms)
adv_para.interval = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms)
adv_para.timeout = params.getTimeout();

ASSERT(ERROR_NONE == sd_ble_gap_adv_start(&adv_para), BLE_ERROR_PARAM_OUT_OF_RANGE);
@@ -434,7 +434,7 @@ ble_error_t nRF5xGap::setAppearance(GapAdvertisingData::Appearance appearance)

ble_error_t nRF5xGap::getAppearance(GapAdvertisingData::Appearance *appearanceP)
{
if (sd_ble_gap_appearance_get(reinterpret_cast<uint16_t *>(appearanceP))) {
if ((sd_ble_gap_appearance_get(reinterpret_cast<uint16_t *>(appearanceP)) == NRF_SUCCESS)) {
return BLE_ERROR_NONE;
} else {
return BLE_ERROR_PARAM_OUT_OF_RANGE;