diff --git a/connections/implementation/mediums/ble_v2.cc b/connections/implementation/mediums/ble_v2.cc index d3d2dd8c..7ca9d2da 100644 --- a/connections/implementation/mediums/ble_v2.cc +++ b/connections/implementation/mediums/ble_v2.cc @@ -961,9 +961,7 @@ bool BleV2::StartRegularAdvertisingLocked( // Begin building the regular BLE advertisement. BleAdvertisementData advertising_data; ByteArray medium_advertisement_bytes = - medium_.IsExtendedAdvertisementsAvailable() - ? medium_advertisement.ByteArrayWithExtraField() - : ByteArray(medium_advertisement); + medium_advertisement.ByteArrayWithExtraField(); // Start extended advertisement first if available. bool extended_regular_advertisement_success = false; diff --git a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEGATTServer.m b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEGATTServer.m index 9ab8dfe1..89b85990 100644 --- a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEGATTServer.m +++ b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEGATTServer.m @@ -327,7 +327,8 @@ static char *const kGNCBLEGATTServerQueueLabel = "com.nearby.GNCBLEGATTServer"; [_peripheralManager respondToRequest:request withResult:CBATTErrorAttributeNotFound]; return; } - request.value = value; + request.value = + [value subdataWithRange:NSMakeRange(request.offset, value.length - request.offset)]; [_peripheralManager respondToRequest:request withResult:CBATTErrorSuccess]; }