[NearbyConnections] Fix IOS incorrect endpoint info from GATT server

1. Put the entire regular advertisement onto the gatt server
2. Provide the gatt read characterestics with offset.

PiperOrigin-RevId: 731102862
This commit is contained in:
hai007
2025-02-25 18:17:05 -08:00
committed by Copybara-Service
parent 90d687e120
commit fb8bfe05b2
2 changed files with 3 additions and 4 deletions
+1 -3
View File
@@ -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;
@@ -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];
}