test1
Diff: source/BlueNRGGap.cpp
- Branch:
- sync_with_github
- Revision:
- 254:f4d217cadbde
- Parent:
- 253:9665a6f8bbdb
- Child:
- 255:97adb68decd4
- Child:
- 265:46333d70cf81
--- a/source/BlueNRGGap.cpp Thu Sep 15 10:49:39 2016 +0100 +++ b/source/BlueNRGGap.cpp Thu Sep 15 10:51:17 2016 +0100 @@ -102,6 +102,7 @@ PRINTF("Exceeded the advertising payload length\n\r"); return BLE_ERROR_BUFFER_OVERFLOW; } + // Reset the length of the ADV payload each time // since we get fields of argument 'advData' iteratively AdvLen = 0; @@ -122,6 +123,8 @@ */ STORE_LE_16(deviceAppearance, advData.getAppearance()); setAppearance((GapAdvertisingData::Appearance)(deviceAppearance[1]<<8|deviceAppearance[0])); + + for(uint8_t index=0; index<loadPtr.getPayloadUnitCount(); index++) { loadPtr.getUnitAtIndex(index); @@ -269,6 +272,7 @@ setAppearance(appearanceP); break; } + case GapAdvertisingData::ADVERTISING_INTERVAL: /**< Advertising Interval */ { printf("Advertising type: ADVERTISING_INTERVAL\n\r"); @@ -840,8 +844,8 @@ uint8_t bdaddr[BDADDR_SIZE]; uint8_t data_len_out; - if (type == BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE || - type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) { + if (addr_type == BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE || + addr_type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) { return BLE_ERROR_OPERATION_NOT_PERMITTED; } @@ -1535,4 +1539,3 @@ return BLE_ERROR_NONE; } -