-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got descriptors for a characteristic we don't know about #397
Comments
Seeing the following sequence of events: Still trying to work out what the uuid conversions are here. I should also mention I'm on the latest macOS 15.1 developer beta. Not sure if that has some bluetooth bugs or mb the uuid conversion scheme has changed in the latest os? |
It seems that: set_characteristics will overwrite all the prior characteristics of the service which may not be the right behavior here. If not overwriting all prior characteristics is the desired behavior, then there is a race condition between the characteristic storage and descriptor storage. |
I ended up doing this for both the set_characteristics and set_characteristic_descriptors because it seemed like both had the same style of overwrite behavior. pub fn set_characteristics(
&mut self,
service_uuid: Uuid,
characteristics: HashMap<Uuid, StrongPtr>,
) {
let service = self
.services
.get_mut(&service_uuid)
.expect("Got characteristics for a service we don't know about");
for (characteristic_uuid, characteristic) in characteristics {
service.characteristics.insert(characteristic_uuid, CBCharacteristic::new(characteristic));
}
if service.characteristics.is_empty() {
service.discovered = true;
self.check_discovered();
}
}
pub fn set_characteristic_descriptors(
&mut self,
service_uuid: Uuid,
characteristic_uuid: Uuid,
new_descriptors: HashMap<Uuid, StrongPtr>,
) {
let service = self
.services
.get_mut(&service_uuid)
.expect("Got descriptors for a service we don't know about");
let characteristic = service
.characteristics
.get_mut(&characteristic_uuid)
.expect("Got descriptors for a characteristic we don't know about");
for (descriptor_uuid, descriptor) in new_descriptors {
characteristic
.descriptors
.entry(descriptor_uuid)
.or_insert_with(|| CBDescriptor::new(descriptor));
}
characteristic.discovered = true;
if !service
.characteristics
.values()
.any(|characteristic| !characteristic.discovered)
{
service.discovered = true;
self.check_discovered()
}
} |
Describe the bug
"Got descriptors for a characteristic we don't know" about while connecting to an iRobot Create 3.
Expected behavior
able to connect to peripheral
Actual behavior
the connect fails with error: "Got descriptors for a characteristic we don't know"
Additional context
error is coming from:
pub fn set_characteristic_descriptors(
&mut self,
service_uuid: Uuid,
characteristic_uuid: Uuid,
descriptors: HashMap<Uuid, StrongPtr>,
) {
in corebluetooth internal
The text was updated successfully, but these errors were encountered: