Commit Graph
20 Commits
Author SHA1 Message Date
hai007 734014a841 Add build flag to switch between C++ and rust implemented parser
- Both implementations implement `AdvertisementDecoder` interface and provide the
   concrete implementation for AdvertisementDecoderImpl
 - cleanup missing includes as complained about by clang-tidy

PiperOrigin-RevId: 621187625
2024-04-02 08:43:31 -07:00
hai007 112da5e64a Refactor, remove scan_request dependency from AdvertisementDecoder
- Removes banned_data_types_, PUBLIC identity advertisements will never have
   any corresponding credentials anyways, so decryption will always be skipped
   and this is now guarenteed by asserts in UpdatePublicCredentials
 - Filtering adv based on identity is moved into advertisement Filter which
   already contains the requested identity info from scan_request
 - LegacyPresenceScanFilter is no longer used by AdvertisementDecoder since
   this is not being used anywhere at the moment
 - Cleanup miscellaneous clang-tidy lints about missing or unused includes

PiperOrigin-RevId: 620086399
2024-03-28 16:15:37 -07:00
hai007 b224eb7bf8 Internal change
PiperOrigin-RevId: 619658526
2024-03-27 17:31:38 -07:00
hai007 5bc1c83472 Pure Refactor: move filtering logic into AdvertisementFilter class
- this decouples filtering logic from advertisement decoding logic
   in preparation for introducing a Rust backed impl of
   AdvertisementDecoder
 - this change is only a refactor and does not change functionality
   in any way

PiperOrigin-RevId: 618978564
2024-03-25 15:33:20 -07:00
Anthony Rueda 96750db706 [Presence] Renamemetadata_encryption_key_tag fields in shared credential proto to differentiate between V0/V1 unsigned adv key tags
PiperOrigin-RevId: 558919544
2023-08-21 15:39:35 -07:00
Anthony Rueda 72b249474d Extend local and shared credential protos to included duplicated metadata_encryption_key and metadata_encryption_key_tag for all protocol version
PiperOrigin-RevId: 538612138
2023-06-07 15:43:30 -07:00
Anay Wadhera 9dff873424 Convert LDT Rust to a normal define
PiperOrigin-RevId: 531318262
2023-05-11 15:09:04 -07:00
Anay Wadhera 813a07116e Update action bits to match spec
PiperOrigin-RevId: 531266917
2023-05-11 11:56:26 -07:00
Janusz Sobczak 0200a92978 Separate TX and Action fields.
PiperOrigin-RevId: 529767591
2023-05-05 11:21:59 -07:00
Hai Shang 574b88d7ef add unit test for NP v0 advertisement parsing
PiperOrigin-RevId: 523153029
2023-04-10 10:41:05 -07:00
Janusz Sobczak 5f4144cd0b Update SharedCredential definition
PiperOrigin-RevId: 507568902
2023-02-06 13:33:23 -08:00
Anay Wadhera c58b45eb50 Rename PublicCredential to SharedCredential and PrivateCredential to LocalCredential
PiperOrigin-RevId: 503221477
2023-01-24 12:09:21 -08:00
Suet-Fei Li 084f7ebd88 Remove location namespace in third_party/nearby.
PiperOrigin-RevId: 500023196
2023-01-06 02:53:57 -08:00
Janusz Sobczak a92abac83a Update advertisement encoder/decoder
1. Update the API to accept the credentials on input instead of credential manager.
2. Update the test with values using the LDT encryption.

These changes allow us to have a more asynchronous implementaion.
When broadcasting we can:
1. Fetch the private credentials asynchronously.
2. Create the advertisement and start broadcasting when the credentials have been fetched.

When scanning we can:
1. Fetch public credentials asynchronously.
2. Start scanning for advertisements.
3. Update the decoder when new credentials are fetched.

PiperOrigin-RevId: 493998041
2022-12-08 14:36:44 -08:00
Janusz Sobczak 5d742558a4 Add advertisement filtering
PiperOrigin-RevId: 484616133
2022-10-28 14:07:29 -07:00
Janusz Sobczak bc9a6ec55b Use LDT for advertisement decryption.
We are still missing the real LDT implementation, so the code is linked with a
placeholder code that doesn't do the actual encryption.

PiperOrigin-RevId: 484596294
2022-10-28 12:37:48 -07:00
Janusz Sobczak 4bd0337c10 Update to match revised BLE 4.2 specification
PiperOrigin-RevId: 479615854
2022-10-07 10:33:38 -07:00
Suet-Fei Li 55f20775d2 Fix internal flow
PiperOrigin-RevId: 466426960
2022-08-09 12:02:16 -07:00
Janusz Sobczak 6e6ae3ebd7 Decode the action in Base NP advertisements back into a list of Data Elements
PiperOrigin-RevId: 466204445
2022-08-08 19:39:05 -07:00
jsobczak 319e5abea4 Add advertisement decoder
The decoder allows us to parse incoming Nearby Presence advertisements.

PiperOrigin-RevId: 465146528
2022-08-03 14:18:12 -07:00