Commit Graph
833 Commits
Author SHA1 Message Date
aaronyujiaze cb8fef7875 Add fix to check the availability of BluetoothAdapter
This change makes sure BluetoothClassic and BLE medium can only be added to the CONNECTION_REQUEST frame if BluetoothAdapter is valid and enabled.

PiperOrigin-RevId: 450777716
2022-05-24 15:05:45 -07:00
hai007 28acece858 C++20 fixes.
Structs with user-declared constructors are no longer aggregates.
Remove the user-declared constructors.

Bug: chromium:1284275
PiperOrigin-RevId: 450762391
2022-05-24 13:58:08 -07:00
edwinwu a1e84f0597 [BLE Refactor] Implements BleV2Socket and BleV2ServerSocket.
PiperOrigin-RevId: 450586535
2022-05-23 20:22:10 -07:00
aaronyujiaze 0be161e3bb Add Copresence Service UUID to BLE Advertisement 0x16 Service Data
The medium abstraction layer does not prepopulate the advertisement_bytes ByteArray with Copresence Service UUID. This adds it at the platform impl layer.

PiperOrigin-RevId: 450054877
2022-05-20 13:47:29 -07:00
aaronyujiaze 48a91eec73 Add BLE V1 windows platform implementation
This CL implements the BLE V1 Medium and its corresponding unit tests:
- Start/Stop Advertising
- Start/Stop Scanning
- Receive BLE Advertisement callbacks handler
- BLE Advertisement Publisher/Watcher status callbacks handler

PiperOrigin-RevId: 449824666
2022-05-19 13:48:56 -07:00
johnsonlu 58d14a36bf Add comments of MediumMetadata
PiperOrigin-RevId: 449641256
2022-05-18 20:17:56 -07:00
edwinwu 01f439b9ad [BLE Refactor] Add Extended advertisement support.
PiperOrigin-RevId: 449619994
2022-05-18 17:45:04 -07:00
aaronyujiaze 8f1623d293 Fix minor bluetooth adapter crash bug
If bluetooth adapter is not present on the Windows device, Nearby Connection will crash. This change resolves the issue by adding null checkers.

PiperOrigin-RevId: 449578225
2022-05-18 14:32:47 -07:00
jfcarroll d0a83cee39 This correctly exports the dll functions needed by the flutter app (and any other app).
PiperOrigin-RevId: 449402726
2022-05-17 23:21:55 -07:00
guogang 4aee0b681c Applied thread pool implementation from Windows platform
PiperOrigin-RevId: 449385710
2022-05-17 21:02:00 -07:00
edwinwu 412f9e0752 [BLE Refactor] Connects BleV2 mediums to PCP handler.
PiperOrigin-RevId: 449196646
2022-05-17 05:42:05 -07:00
edwinwu eddf53ec29 [BLE Refactor] Removes fast advertisement uuid in StartAdvertising and StartScanning.
PiperOrigin-RevId: 448426759
2022-05-13 00:19:16 -07:00
edwinwu 080e964a4c [BLE Refactor] Implements GattClient for sender's device to fetch Gatt advertisement.
PiperOrigin-RevId: 448400837
2022-05-12 20:29:30 -07:00
hai007 73c0ce9c76 Remove deprecated usage of CreateDataChannel()
CreateDataChannelOrError() should be used instead.
If the code referencing the function allows it, error handling has been modified
to match the new function.

PiperOrigin-RevId: 448168890
2022-05-11 23:27:09 -07:00
hai007 e9c4225443 Fix typo in the Nearby Sharing Windows Bluetooth classic socket logging.
PiperOrigin-RevId: 448113611
2022-05-11 16:42:58 -07:00
edwinwu 12cef58420 [BLE Refactor] Refactor BlePeripheral class.
PiperOrigin-RevId: 447638179
2022-05-09 21:27:58 -07:00
hai007 6347f80a11 [Sharing][Analytics] Add Auto dismiss fast initialization event log
PiperOrigin-RevId: 447614715
2022-05-09 18:48:32 -07:00
hai007 487d272e24 Fix go/MSAN and coverage failure in:
https://critique.corp.google.com/cl/445437919

PiperOrigin-RevId: 447592532
2022-05-09 16:38:44 -07:00
hai007 cb2672de03 Fix go/tsan failure in:
https://critique.corp.google.com/cl/444788086

PiperOrigin-RevId: 447591426
2022-05-09 16:33:52 -07:00
edwinwu 771ce23fa3 [BLE Refactor] Implements advertisement tracking in Ble medium with DiscoveredPeripheralTracker class.
PiperOrigin-RevId: 447397658
2022-05-09 00:36:33 -07:00
aaronyujiaze 6b88d326df Add BLE V2 windows platform implementation (Phase 1)
This CL implements the scanning and advertising of Nearby BLE Medium Fast Advertisement with hardcoded advertisement data

PiperOrigin-RevId: 446806137
2022-05-05 13:45:35 -07:00
hai007 8f4edf3c89 Delete use of implicit conversion from rtc::scoped_refptr<T> --> T*.
Intended to unblock landing of webrtc cl https://webrtc-review.googlesource.com/c/src/+/260325

PiperOrigin-RevId: 446091008
2022-05-02 19:39:40 -07:00
hai007 d09f53a40b Unit test for WIFI Hotspot in BWU layer
PiperOrigin-RevId: 445437919
2022-04-29 09:29:59 -07:00
hai007 aeff3a9683 Change build target visibility for testing.
PiperOrigin-RevId: 445051381
2022-04-27 21:28:29 -07:00
hai007 8e80ee097a Unit test for WIFI Hotspot in Connection Medium layer
Fix 230126796: go/tsan error (data_race) found while running //third_party/nearby/internal/platform:public_test

PiperOrigin-RevId: 444788086
2022-04-27 01:21:23 -07:00
bourdakos f5860da8f1 Fix README markdown typos
PiperOrigin-RevId: 444316326
2022-04-25 11:00:02 -07:00
suetfei cf85f26583 Merge pull request #612 from bourdakos1/github-actions
Add GitHub action for testing swift package
2022-04-25 10:29:52 -07:00
Nick Bourdakos c15fba9631 Checkout with submodules 2022-04-22 16:41:07 -04:00
Nick Bourdakos 8227416d73 Add GitHub action for testing swift package 2022-04-22 16:41:07 -04:00
bourdakos 9a362bb9ae Exclude tests from swift build
PiperOrigin-RevId: 443746991
2022-04-22 13:39:46 -07:00
bourdakos ff7a662bf6 Add SPM build test
PiperOrigin-RevId: 443726660
2022-04-22 12:13:01 -07:00
bourdakos da13735484 Update Package.swift and stub webrtc
PiperOrigin-RevId: 443722630
2022-04-22 11:57:15 -07:00
hai007 ec2d3ae1aa WIFI Hotspot implementation (4)
Part 4: BWU and client interface part

PiperOrigin-RevId: 443700883
2022-04-22 10:32:12 -07:00
hai007 60e896ad37 Implementation g3 medium/Environment/platform layer unit test for WIFI Hotspot
PiperOrigin-RevId: 443304661
2022-04-21 01:09:38 -07:00
jfcarroll 6fc5b64605 Flattening payload and listeners
PiperOrigin-RevId: 443168939
2022-04-20 12:55:23 -07:00
hai007 86911dc5a9 Internal comment.
PiperOrigin-RevId: 442646111
2022-04-18 15:25:10 -07:00
nohle 53a1d13496 [NC] Remove spammy AnalyticsRecorder log
If the platform (e.g., ChromeOS) doesn't provide an EventLogger, this WARNING is logged for nearly every Nearby Connections method.

PiperOrigin-RevId: 442539723
2022-04-18 07:42:45 -07:00
nohle 0c19f3f279 [NC] Track bandwidth upgrade mediums for each endpoint (fix)
Rename RevertInitiatedBwuMediumForEndpointIfNecessary to RevertBwuMediumForEndpoint because this method can be called by RESPONDERs of the bandwidth upgrade request. Also, make sure to remove the endpoint from the endpoint-to-medium map.

PiperOrigin-RevId: 442055611
2022-04-15 11:13:27 -07:00
nohle 98a5b9d0ee [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (4/4 unit tests)
Add unit tests for BaseBwuHandler and BwuManager (BWU initiation only). Add fake classes and helper methods needed for testing. Refine comments and logs.

PiperOrigin-RevId: 442021842
2022-04-15 08:33:21 -07:00
nohle e5fb3a8f11 [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (3/4)
* Fix bandwidth upgrade service ID usage. For instance, no longer use the inaccurate service ID from ClientProxy.
* Add more fine-grained upgraded endpoint tracking using both service IDs and endpoint IDs
* Only "revert" bandwidth-upgrade mediums--for example, stop accepting connections on a server socket--for a service when the last endpoint for that service is finished.

These changes are necessary to support multiple services (e.g., Nearby Share and Phone Hub) and multiple mediums (e.g., WebRTC and WLAN).

PiperOrigin-RevId: 442021257
2022-04-15 08:29:41 -07:00
nohle dee3e9cfb4 [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (2/4)
Consolidate BWU service ID bookkeeping into the BaseBwuHandler class. This eliminates duplicated code in per-medium BWU handlers and allows us to easily augment the bookkeeping with endpoint IDs in a subsequent CL.

Also, localize all service ID wrapping to the BaseBwuHandler class. A postfix is appended to the service ID during bandwidth upgrade, e.g., "NearbyShare_INITIATOR_BWU"; this is done to distinguish a medium's use for advertising/discovery vs. its use for device-to-device connections.

This CL should theoretically be a no-op, but per-medium BWU handlers were inconsistent in their implementations.

PiperOrigin-RevId: 442019603
2022-04-15 08:19:19 -07:00
nohle 463d391fcd [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (1/4)
This CL should be a no-op.

Provide better access to the service ID during bandwidth upgrade handling. Notably, 1) have the endpoint channel store its associated service ID, and 2) send the service ID on a connect/disconnect.

The service ID identifies the application, for example, "NearbySharing". In future CLs, we will use the service IDs to better handle bandwidth-upgrade bookkeeping when multiple services are running simultaneously. Specifically, we will better handle reverting a bandwidth-upgrade medium without interfering with other services.

PiperOrigin-RevId: 442019209
2022-04-15 08:15:53 -07:00
jgsobczak 940dba6568 Merge pull request #600 from google/embedded
Add embedded SDK
2022-04-14 13:14:48 -07:00
hai007 93f203dc0b WIFI Hotspot implementation (3)
Part 3: WIFI Hotspot platform code for Windows

PiperOrigin-RevId: 441826092
2022-04-14 12:31:07 -07:00
Janusz Sobczak daac1e01c8 Add embedded SDK
The first release, v1.0.0-embedded, of Nearby SDK for embedded devices.
2022-04-14 11:57:25 -07:00
hai007 bc01739580 Add test to exclude list
PiperOrigin-RevId: 441810605
2022-04-14 11:24:54 -07:00
hai007 8d8876249d BUILD configuration change
PiperOrigin-RevId: 441796698
2022-04-14 10:32:16 -07:00
jgsobczak 0ffd8ec9b6 Merge pull request #596 from google/revert-593-embedded
Revert "Add gtest submodule"
2022-04-14 10:14:12 -07:00
jgsobczak 3a58f7facd Revert "Add gtest submodule" 2022-04-14 10:13:53 -07:00
eidenkim 3f81504dc1 Nearby Connections - Fixed crash when starting the app on devices with no Bluetooth adapter
PiperOrigin-RevId: 441773811
2022-04-14 08:59:23 -07:00