Commit Graph
17 Commits
Author SHA1 Message Date
Janusz Sobczak 5393daf9f1 Merge logging and types build targets
Both "types" and "logging" build targets included "logging.h"
Merging them together avoids circular dependencies.

PiperOrigin-RevId: 555262816
2023-08-09 19:13:12 -07:00
Janusz Sobczak 7a99b5e0a3 Specialize ExceptionOr<bool>
ExceptionOr<T>::ok() returns true if the value is set. This can be misleading
for boolean types.
ExceptionOr<bool> result = SomeFunction();
if (result.ok()) {
 if (result.result() {
  // Case 1: SomeFunction returned true
 } else {
  // Case 2: SomeFunction returned false
} else {
  // Case 3: SomeFunction returned an exception
}
It's easy to overlook case 2.
The specialized ExceptionOr<bool>::ok() returns false in Case 2, which allows
us to write:
if (result) {
 // SomeFunction returned true
} else {
 // SomeFunction returned false or an exception
 // result.GetException() can be used if we need to handle different exceptions
 // differenty
}

PiperOrigin-RevId: 544715641
2023-06-30 11:59:43 -07:00
Janusz Sobczak e00bdfb3e3 Add retro pairing in scalable seeker
Listen for manual pairing events and notify plugins.
Add retroactive pairing flow in the scalable seeker.
Actually upload the account key to the provider.
Missing bits:
- Notify the user and get their permission,
- Upload the new Account Key to user's account.

PiperOrigin-RevId: 544616348
2023-06-30 04:06:43 -07:00
Janusz Sobczak 20acd4eeb9 Add initial pairing in scalable seeker
PiperOrigin-RevId: 541034178
2023-06-16 16:14:14 -07:00
Janusz Sobczak 82b5e10d5b Implement StartFastPairScan
PiperOrigin-RevId: 536487662
2023-05-30 13:08:31 -07:00
Qin Wang 55750a0843 Write Accountkey to remote device via GATT connection
PiperOrigin-RevId: 534992810
2023-05-24 14:59:40 -07:00
Qin Wang 363d2a819e Pure refactor set/get functions in FastPairDevice
PiperOrigin-RevId: 533218929
2023-05-18 12:45:55 -07:00
Janusz Sobczak 1c9dd093f1 Fix retroactive pairing test
PiperOrigin-RevId: 532853830
2023-05-17 11:35:48 -07:00
Janusz Sobczak 013bf1f420 Add retroactive pairing
PiperOrigin-RevId: 531637311
2023-05-12 16:56:55 -07:00
Janusz Sobczak f1f15bd967 Use canonical MAC address in tests.
PiperOrigin-RevId: 531601021
2023-05-12 14:12:25 -07:00
Qin Wang 69f4feaf55 Add g3 implementation for BluetoothPairing
PiperOrigin-RevId: 530965844
2023-05-10 11:47:00 -07:00
Janusz Sobczak 4bd7da967a Add MessageStream fuzzing test
PiperOrigin-RevId: 518920458
2023-03-23 11:41:39 -07:00
Janusz Sobczak dbd31508fa Add medium fuzzing tests
PiperOrigin-RevId: 518722768
2023-03-22 18:08:09 -07:00
Janusz Sobczak 1a78b33a89 Add InputStream::ReadExactly
Read() can return fewer bytes than requested.
ReadExactly() will call Read() repeatedly until we
have read as many bytes as we need.

PiperOrigin-RevId: 518719418
2023-03-22 17:45:50 -07:00
Janusz Sobczak b2da1efbbf Parse events from message stream.
Adds parsing for standard events, everything except audio switch.

PiperOrigin-RevId: 518425430
2023-03-21 17:23:42 -07:00
Janusz Sobczak 2096795496 Use ExceptionOr::result()
ExceptionOr::result() returns a reference, unlike GetResult(), which returns a
copy of the value.
PiperOrigin-RevId: 517238836
2023-03-16 15:09:05 -07:00
Janusz Sobczak 02ffb5d45e Add Message Stream
Define MessageStream class for exchanging messages betweek the seeker and the
provider over rfcomm.

PiperOrigin-RevId: 516986541
2023-03-15 18:42:39 -07:00