-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Chip-tool wrongly handle discovery via BLE with manual pairing code #21160
Comments
@doublemis1 Which chip-tool are you running? Linux or Mac? The Mac one tries to handle this, in The Linux version ( |
Yes, I used the Linux version. |
A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes project-chip#21160
A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes project-chip#21160
A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes project-chip#21160
A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes project-chip#21160
* Fix handling of short discriminator in Linux BLE scan. A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes #21160 * Address review comment.
* Fix handling of short discriminator in Linux BLE scan. A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes #21160 * Address review comment.
* Fix handling of short discriminator in Linux BLE scan. A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes #21160 * Address review comment. Co-authored-by: Boris Zbarsky <[email protected]>
…21187) * Fix handling of short discriminator in Linux BLE scan. A few changes here: 1. Implement a SetupDiscriminator class that commons up logic like "does this discriminator, which might be short or long, match the given long discriminator?" and "extract short discriminator from long discriminator". 2. Change SetupPayload to more clearly indicate whether it's storing a short or long discriminator, instead of storing a short discriminator the same way as a long discriminator with the low bits all 0 and hoping consumers check isShortDiscriminator. 3. Update BLE scanning APIs to take SetupDiscriminator. 4. Fix the Linux and Tizen BLE code to properly handle short discriminators (which used to not match if the long discriminator happened to have the low 8 bits nonzero). 5. Fix the Darwin BLE code to properly handle long discriminators that have 0 low bits. Before this change they used to incorrectly match a long discriminator which had the same 4 high bits but different 8 low bits. Fixes project-chip#21160 * Address review comment.
Problem
The Manual Pairing code contains the information about 4 most significant bits of discriminator.
The current implementation of chip-tool commissioning via BLE wrongly handles the discovery of devices that have set the discriminator to e.g. E64 (3684). The commissioning failed at BLE discovery since the manual paring code contains the E (E00 = 3584).
Parsed device manual pairing code:
Parsed device QR code payload:
Proposed Solution
The chip-tool during commissioning by manual pairing code shall connect the device based only on 4 most significant bits rather than the whole discriminator.
The text was updated successfully, but these errors were encountered: