Commit Graph
196 Commits
Author SHA1 Message Date
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
edwinwu d1b2437b0d [BLE Refactor] Implements BleExtraField in mediums::BleAdvertisement for Extended advertisement.
PiperOrigin-RevId: 441665698
2022-04-13 22:06:57 -07:00
edwinwu 3050f9432c [BLE Refactor] Implements DiscoveredPeripheralTracker.
PiperOrigin-RevId: 441524475
2022-04-13 10:56:16 -07:00
edwinwu fcb3b27314 BEGIN_PUBLIC
[iOS] Fixes the file_path is empty when "CreateIncomingInternalPayload" in internal_payload_factory. If empty then use the payload_id for the file_name.
END_PUBLIC

- This is for the way iOS -> Android file transfer.
- CC_MD5 is deprecated in iOS13, change to CC_SHA256
- UIImageWriteToSavedPhotosAlbum, the UIImage* is nil after completion callback to the selector "didFinishSavingWithError". Changes to show image by "showReceivedImage" after write to Photo album.
- "NSDownloadsDirectory" seems have
<<Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “Downloads” in the folder>>. Changes to use "NSTempDirectory".

PiperOrigin-RevId: 440808267
2022-04-11 00:18:05 -07:00
hai007 68ede1db20 WIFI Hotspot implementation (2)
Part 2: Connection common code for WIFI Hotspot

PiperOrigin-RevId: 440537272
2022-04-09 01:24:14 -07:00
jfcarroll 4c13db0c2d This is a fix for incoming payloads not having a file_name set.
PiperOrigin-RevId: 440438936
2022-04-08 13:25:42 -07:00
edwinwu 59ea8e8005 [BLE Refactor] Add Psm value to BleAdvertisement and BleAdvertisementHeader.
PiperOrigin-RevId: 440410863
2022-04-08 11:20:59 -07:00
suetfei 82cd2d5e6c Delete offline_wire_formats.pb.h 2022-04-05 09:50:27 -07:00
suetfei 983f5e0c61 Delete offline_wire_formats.pb.cc 2022-04-05 09:50:09 -07:00
edwinwu 0747c0a349 [BLE Refactor] Tune BleAdvertisement, BleAdvertisementHeader, BlePeripheral, AdvertisementReadResult, BleUtils.
PiperOrigin-RevId: 439365106
2022-04-04 11:19:24 -07:00
suetfei c010c0e681 Create offline_wire_formats.pb.h 2022-04-04 00:37:48 -07:00
suetfei d898aaf752 Delete test_proto.pb.h 2022-04-04 00:35:39 -07:00
suetfei 87a55ad400 Create offline_wire_formats.pb.cc 2022-04-04 00:35:30 -07:00
suetfei 032315de18 Create test_proto.pb.h 2022-04-02 00:10:08 -07:00
suetfei 3c539103a9 Fix broken internal flow.
PiperOrigin-RevId: 438953015
2022-04-01 18:27:45 -07:00
suetfei 6124b34df1 Create offline_wire_formats.pb.cc 2022-04-01 18:13:15 -07:00
suetfei 6fd243cb6e Fix internal flow
PiperOrigin-RevId: 438887677
2022-04-01 12:46:30 -07:00
suetfei 9bf9617184 Create offline_wire_formats.pb.h 2022-04-01 12:10:54 -07:00
suetfei e6752f3348 Update README for iOS & macOS Build.
PiperOrigin-RevId: 438758043
2022-04-01 00:43:03 -07:00
deling-google 1f7ad3b553 Add protos and headers 2022-03-31 12:44:50 -07:00
bourdakos a4feafd4f8 Fix a few struct initializers that are not compatible with c++14
PiperOrigin-RevId: 438565404
2022-03-31 07:44:24 -07:00
edwinwu 190d3ebafc [BLE Refactor] Impl Start/Stop Scanning and DiscoveredPeripheral callback function in medium layer and ScanCallback in platform layer.
PiperOrigin-RevId: 438293171
2022-03-30 07:08:05 -07:00
jfcarroll f4b80ccb59 These are the changes for Payload::Type => PayloadType for the flattening CL
PiperOrigin-RevId: 436767666
2022-03-23 10:11:15 -07:00
edwinwu c3d4ffba65 [BLE Refactor] Fixed BloomFilterBase base member _bits is not initialized when construct from a non-empty ByteArray.
PiperOrigin-RevId: 436229874
2022-03-21 09:37:53 -07:00
jfcarroll 517d77f5aa This adds parent path and file name to the Payload constructor. This will affect chrome.
PiperOrigin-RevId: 435223740
2022-03-16 19:18:13 -07:00
edwinwu 0702409047 [BLE Refactor] Modify to allow zero numSlots for AdvertisementHeader.
PiperOrigin-RevId: 434634152
2022-03-14 19:39:50 -07:00
edwinwu 66b425dc4e [BLE Refactor] Impl Start/Stop AdvertisementGattServer
PiperOrigin-RevId: 432657453
2022-03-05 08:33:01 -08:00
hai007 eadc972af3 Fix BWU crash problem because WIFI_LAN create socket based on IPV6.
PiperOrigin-RevId: 432222945
2022-03-03 10:16:22 -08:00
edwinwu 91dfdefb9f [BLE Refactor] Impl Start/Stop Advertising function in medium layer.
PiperOrigin-RevId: 432185275
2022-03-03 07:04:32 -08:00
edwinwu 433d9d84f8 BEGIN_PUBLIC
Fix the format of offline_wire_formats.proto
END_PUBLIC.

-- error caused by copybara-presubmit =>

```
Migration resulted in error 'PERMANENT_ERROR'
Non reversible transformations:

diff --git a/origin/google3/third_party/nearby/connections/implementation/proto/offline_wire_formats.proto b/reverse/google3/third_party/nearby/connections/implementation/proto/offline_wire_formats.proto
index de0aed4..5d4bb08 100644
--- a/origin/google3/third_party/nearby/connections/implementation/proto/offline_wire_formats.proto
+++ b/reverse/google3/third_party/nearby/connections/implementation/proto/offline_wire_formats.proto
@@ -143,7 +143,9 @@ message PayloadTransferFrame {

   // Accompanies DATA packets.
   message PayloadChunk {
-    enum Flags { LAST_CHUNK = 0x1; }
+    enum Flags {
+      LAST_CHUNK = 0x1;
+    }
     optional int32 flags = 1;
     optional int64 offset = 2;
     optional bytes body = 3;

Workflow 'presubmit_piper_to_github' is not reversible
Configuration errorErrors happened during the migration
```

PiperOrigin-RevId: 430878757
2022-02-25 14:53:56 -08:00
johnsonlu 81bdb7adc9 Create a Bluetooth endpoint for Device inject connections. Will implement connection lifecycle callback for the inject connections in the following CL.
PiperOrigin-RevId: 430573921
2022-02-25 14:53:56 -08:00
hai007 1f00687330 Make IsPreferred() comparator irreflexive.
PiperOrigin-RevId: 429993786
2022-02-21 02:02:10 -08:00
edwinwu 8326aeef38 [BLE Refactor] Implement CreateAdvertisementHeader in BleV2 medium.
PiperOrigin-RevId: 429550598
2022-02-18 06:30:09 -08:00
suetfei 3c8a279829 Add WORKSPACE and .bazelrc and make other changes for bazel build.
PiperOrigin-RevId: 428343135
2022-02-13 08:50:47 -08:00
suetfei 0e6620c970 Internal refactor to fix missing includes.
PiperOrigin-RevId: 427669790
2022-02-09 23:53:37 -08:00
suetfei efdd4c0f6a Internal refactor to replace unsupported dependencies.
PiperOrigin-RevId: 427474223
2022-02-09 08:10:08 -08:00
suetfei 7dbe976c51 Internal cleaup for protos.
PiperOrigin-RevId: 427170889
2022-02-08 06:01:50 -08:00
suetfei 37f8b4487e Internal flow change phase 2.
PiperOrigin-RevId: 427059704
2022-02-07 17:17:20 -08:00
suetfei 42059a624b Internal Fix Flow 2-4
PiperOrigin-RevId: 426518593
2022-02-04 16:35:25 -08:00
jfcarroll 9abc9a59b9 Combine InputFile and OutputFile into a single class.
PiperOrigin-RevId: 426172033
2022-02-03 09:57:50 -08:00
hais a5086f3878 Modify copybara rules
PiperOrigin-RevId: 426029875
2022-02-02 19:09:34 -08:00
hais f5fcd35ced nearby sdk refactor
PiperOrigin-RevId: 425434260
2022-02-02 11:56:39 -08:00
suetfei 287f0d7174 Internal Flow change for BUILD.
PiperOrigin-RevId: 424991730
2022-02-02 11:51:37 -08:00
suetfei 5e845655bb [Nearby Directory Refactoring] Move nearby/proto codes into the appropriate directories.
PiperOrigin-RevId: 421636973
2022-01-13 12:48:51 -08:00