Janusz Sobczak a7a3eb8a92 Use consistent return value in Pipe read.
Previously reading from an empty, closed Pipe returned:
* IO exception if there were no writes to the pipe,
* Empty byte array if there were writes to the pipe.
With this change, we return an empty byte array on both paths.

This also fixes a subtle race condition in the following flow:
1. Pipe is empty
2. Thread A is reading from the pipe (blocking call).
3. Thread B writes to the pipe and immediately closes it.
4. Thread A is unblocked and returns IO error. The data written by thread B is
   ignored!

The new test in bluetooth_classic_test triggered that defect consistently.

PiperOrigin-RevId: 518107700
2023-03-20 16:26:52 -07:00
2022-08-10 20:33:01 -07:00
2023-02-14 14:41:04 +08:00
2022-12-21 18:00:54 -08:00
2023-03-20 14:27:22 -07:00
2023-03-02 11:20:57 -08:00
2022-12-20 11:42:49 -08:00
2022-03-31 16:03:11 -07:00
2022-12-20 11:42:49 -08:00
2023-03-14 00:11:18 -07:00
2023-03-20 10:50:10 -07:00
2023-03-20 11:24:20 -07:00

Nearby

Nearby is a collection of projects focused on connectivity that enable building cross-device experiences.

This is not an officially supported Google product.

Projects

Nearby Connection

A peer-to-peer networking API that allows apps to easily discover, connect to, and exchange data with nearby devices in real-time, regardless of network connectivity.

Fast Pair

Utilizes Bluetooth Low Energy (BLE) to discover nearby Bluetooth devices without using significant phone battery, enabling "magical" scenarios based on device proximity.

Nearby Presence

An extension to Nearby Connections that features an extensible identity model for authentication and restricted visibility, resource management for system health, and proximity detection through sensor fusion.

Nearby for Embedded Systems

A lightweight implementation of Fast Pair intended for embedded systems.

Contributing

We encourage you to contribute to Nearby! Please check out the Contributing to Nearby guide for guidelines about how to proceed.

License

Nearby is released under the Apache License 2.0

Languages
C++ 97.6%
Objective-C 1.1%
Objective-C++ 0.6%
Starlark 0.3%
C 0.2%
Other 0.1%