Commit Graph
82 Commits
Author SHA1 Message Date
Edwin Wu 78505e91f7 Add the privacy manifests for swift NC-SDK.
PiperOrigin-RevId: 623676227
2024-04-10 19:19:11 -07:00
Guogang Li 387a51b260 internal update
PiperOrigin-RevId: 619595164
2024-03-27 11:25:55 -07:00
Francis Tsui 1072030be8 Copy sharing/internal, sharing/common and sharing/scheduling to github.
- Move Abseil pin to same as that used in Chromium.
- Disabled layering_check due to build failure in absl.

PiperOrigin-RevId: 596631921
2024-01-08 10:20:37 -08:00
Francis Tsui aea7a09a24 Switch DeviceInfo to use UTF-8 strings.
- Move conversion from native to UTF-8 into platform impl.

PiperOrigin-RevId: 592912664
2023-12-21 11:35:20 -08:00
Nick Bourdakos 197d3f8476 Fix weave bug for payloads that exceed the maximum write length
PiperOrigin-RevId: 563185164
2023-09-06 12:39:47 -07:00
Nick Bourdakos aa0c06257f Add macOS as an OS type
PiperOrigin-RevId: 561959449
2023-09-01 08:19:11 -07:00
Nick Bourdakos 16c6ef924b Fix iOS BLE bugs and crashes
PiperOrigin-RevId: 561695661
2023-08-31 10:37:46 -07:00
Nick Bourdakos 965cc0ecbc Add implementation for async BLE start scan/advertise
PiperOrigin-RevId: 559863656
2023-08-24 14:07:46 -07:00
Nick Bourdakos 91fb4a9a3e Add stop advertising and stop scanning BLE implementation for Apple platforms
PiperOrigin-RevId: 559838443
2023-08-24 12:45:23 -07:00
Nick Bourdakos 387393f1d6 Delete old BLE code for Apple platforms
PiperOrigin-RevId: 559515626
2023-08-23 12:54:15 -07:00
Nick Bourdakos 034865481a Sanitize incoming file names
PiperOrigin-RevId: 559175545
2023-08-22 11:37:02 -07:00
Nick Bourdakos 9998093366 Add Objective-C++ BLE Medium wrapper
PiperOrigin-RevId: 558278732
2023-08-18 16:37:09 -07:00
Nick Bourdakos 7933842c29 Add BLE Medium
PiperOrigin-RevId: 557933813
2023-08-17 14:17:28 -07:00
Nick Bourdakos 07a94a950d Add Objective-C++ GATT client wrapper
PiperOrigin-RevId: 557925490
2023-08-17 13:48:48 -07:00
Nick Bourdakos 4aa52b45f9 Add GATT client
PiperOrigin-RevId: 557919250
2023-08-17 13:27:39 -07:00
Guogang Li fabeff0d57 Added APIs to control device sleep
These APIs can be used to prevent device into sleep when sending supper big files.

PiperOrigin-RevId: 556809236
2023-08-14 09:05:11 -07:00
Nick Bourdakos 9d2cfc19c9 Add Objective-C++ GATT server wrapper
PiperOrigin-RevId: 552636264
2023-07-31 17:20:14 -07:00
Nick Bourdakos c1d74120a0 Add initial BLEv2 Bluetooth Adapter
PiperOrigin-RevId: 551922301
2023-07-28 12:32:27 -07:00
Nick Bourdakos 0a13ce51f4 Make GNCBLEGATTServer thread safe
Fixes an issue where if a characteristic is created and then updated with a non-nil value, and a new characteristic under the same service is added, then when the service is re-added the old characteristic will be permanently cached and the dynamic reads will stop working.

This also eliminates the issue when characteristics are created concurrently, since service additions are batched, if the service addition fails then only one of the characteristics will know that it failed to get added.

This change also introduces the nuance of "success" does not mean the CoreBluetooth method has completed successfully, but instead means that the intended state has been recorded and the class will do its best to maintain that state. For example, a successful "start advertising" call means that we have the advertisement cached and we will start advertising as soon as we can (like BT transitions from off to on) and will do our best to keep advertising (like BT transitions from on to off to on again).

PiperOrigin-RevId: 551660634
2023-07-27 15:40:30 -07:00
Nick Bourdakos a42cdc7346 Move Server Socket and its dependencies to their own files
PiperOrigin-RevId: 551330682
2023-07-26 15:21:46 -07:00
Thomas Van Lenten 7e1f286d93 Don't compile utils.mm twice.
PiperOrigin-RevId: 551315072
2023-07-26 14:25:24 -07:00
Nick Bourdakos de3f638129 Extract BLE code into its own target
PiperOrigin-RevId: 551074383
2023-07-25 20:23:59 -07:00
Nick Bourdakos 0f8e5283a4 Add GATT server
PiperOrigin-RevId: 549080231
2023-07-18 12:37:23 -07:00
Nick Bourdakos 96348b6ba7 Add BLE conversion utils
PiperOrigin-RevId: 547958170
2023-07-13 16:20:04 -07:00
Nick Bourdakos e0b2e176c8 Add Objective-C GATT characteristic container.
PiperOrigin-RevId: 547954006
2023-07-13 16:05:18 -07:00
Guogang Li 4a71c4d2d0 Move NS implementation to third party folder
PiperOrigin-RevId: 546966492
2023-07-10 13:39:42 -07:00
Nick Bourdakos 12f9512a19 Use IOS_LATEST for the test runner to prevent Xcode 14.3 issues
PiperOrigin-RevId: 541053739
2023-06-16 17:37:39 -07:00
Nick Bourdakos 8fc0d93ce1 Fix potential deadlock by running timer callback in another thread
PiperOrigin-RevId: 538469916
2023-06-07 06:37:21 -07:00
Dave MacLachlan 1d68d2fe10 Remove unneeded noRetainObjectArgs
PiperOrigin-RevId: 537896949
2023-06-05 09:25:58 -07:00
Nick Bourdakos 3c72e4f40c Fix EXC_BAD_ACCESS crash when calling payload delegate methods.
Objective-C objects cannot be captured by reference in C++ lambdas and must always be captured by value.

This also takes a copy of the data returned from the Wi-Fi LAN reader, to prevent potential intermittent empty packet issues.

Fixes: #1702
PiperOrigin-RevId: 533925980
2023-05-21 19:19:18 -07:00
Nick Bourdakos 17ba32c68b Fix a macOS bug with web request when decoding data
PiperOrigin-RevId: 532940555
2023-05-17 16:07:38 -07:00
Crisrael Lucero 01c8e1ed05 Convert absl::string_view to const std::string&
PiperOrigin-RevId: 531634295
2023-05-12 16:40:50 -07:00
Chun Zhang b07700629d Replace std::string with absl::string_view
PiperOrigin-RevId: 531607615
2023-05-12 14:39:48 -07:00
Nick Bourdakos 6958edb8cc Fix Wi-Fi LAN bug where frames with all zero bytes were being sent
This was causing the receiving device to consistently (~9/10 times) get stuck in the "waiting for other device to accept" state.

PiperOrigin-RevId: 531295543
2023-05-11 13:45:48 -07:00
Janusz Sobczak b5938c0d17 Add G3 gatt server
PiperOrigin-RevId: 531287485
2023-05-11 13:15:40 -07:00
Nick Bourdakos 8886b99dde Refactor the preferences repository to be a Windows implementation detail of the preferences manager
PiperOrigin-RevId: 531086202
2023-05-10 21:26:32 -07:00
Janusz Sobczak 0901aec6e2 Add BleMedium::GetRemotePeripheral
Added:
nearby::api::ble_v2::BlePeripheral::GetUniqueId()
nearby::api::ble_v2::BleMedium::GetRemotePeripheral(...)

Moved BlePeripheral implementation from bluetooth_adapter_* to ble_v2.*
Added G3 (test) implementation for the new methods.

PiperOrigin-RevId: 531023568
2023-05-10 15:40:38 -07:00
Anay Wadhera f21b1e7089 internal change
PiperOrigin-RevId: 529179617
2023-05-03 13:32:34 -07:00
hai007 6b25d430d9 copybara update
PiperOrigin-RevId: 528861897
2023-05-02 12:48:09 -07:00
Nick Bourdakos 84f480fdd1 Fix IP address bug where 4 byte version wasn't converted to dotted decimal form
Introduces a tested `GNCIPAddress` class to make it more explicit of which IP address format is being used at call sites to prevent similar issues in the future.

PiperOrigin-RevId: 528572993
2023-05-01 14:20:12 -07:00
Eiden Kim aea5b223d3 Create min iOS and test runner under third_party/nearby for common test target.
PiperOrigin-RevId: 527754820
2023-04-27 19:52:01 -07:00
hai007 5dfe7094c3 Update unit test minimum IOS version to 13.7
PiperOrigin-RevId: 527738714
2023-04-27 18:09:15 -07:00
Eiden Kim b0985c70b4 Update iOS unit test min version to have IOS_MINIMUM_OS
PiperOrigin-RevId: 527675057
2023-04-27 13:56:15 -07:00
Chun Zhang 2e7f7a7d90 Migrate PreferencesManager from location/nearby to third_party/nearby
PiperOrigin-RevId: 524900136
2023-04-17 11:23:01 -07:00
Chun Zhang 00bba36219 Migrate PreferencesRepository from location/nearby to third_party/nearby
PiperOrigin-RevId: 524185819
2023-04-13 21:19:12 -07:00
Nick Bourdakos 472a1d847b Fix logging bug
PiperOrigin-RevId: 523910721
2023-04-12 23:40:50 -07:00
Nick Bourdakos c919ed73a9 Update custom save path logic to include parent folder and prevent duplicate names from overwriting other files.
PiperOrigin-RevId: 522123924
2023-04-05 12:31:06 -07:00
Nick Bourdakos 1d2b0272d3 Fix crash when closing Wi-Fi LAN server socket
PiperOrigin-RevId: 521883606
2023-04-04 15:36:43 -07:00
Nick Bourdakos f7edb0c858 Add Apple implementation for device info
PiperOrigin-RevId: 521834323
2023-04-04 12:27:43 -07:00
Nick Bourdakos d6f66237b0 Update Apple implementation to cancel the timer before calling the callback
This fixes a crash where the Timer is destroyed as soon as the callback is called, so Timer::Stop can't be safely called.

PiperOrigin-RevId: 521760888
2023-04-04 07:47:14 -07:00