mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Implement Bluetooth Multiplex.
PiperOrigin-RevId: 651921709
This commit is contained in:
@@ -314,12 +314,27 @@ class ClientProxy final {
|
||||
// Sets the multiplex socket supports status for remote device.
|
||||
void SetRemoteMultiplexSocketBitmask(absl::string_view endpoint_id,
|
||||
int remote_multiplex_socket_bitmask);
|
||||
// Returns true if the multiplex socket is supported for the given medium.
|
||||
bool IsLocalMultiplexSocketSupported(Medium medium);
|
||||
|
||||
// Gets the multiplex socket supports status for remote device.
|
||||
std::optional<std::int32_t> GetRemoteMultiplexSocketBitmask(
|
||||
absl::string_view endpoint_id) const;
|
||||
// Returns true if the multiplex socket is supported for the given medium.
|
||||
bool IsMultiplexSocketSupported(absl::string_view endpoint_id, Medium medium);
|
||||
|
||||
/** Bitmask for bt multiplex connection support. */
|
||||
// Note. Deprecates the first and second bit of BT_MULTIPLEX_ENABLED and
|
||||
// WIFI_LAN_MULTIPLEX_ENABLED and shift them to the third and the forth bit.
|
||||
// The reason is we need to escape the (0, 1) bit which has been set in some
|
||||
// devices without salt enabled. If accompany with the devices with salted
|
||||
// enabled, the frames passed cannot be decrypted and the connection shall be
|
||||
// failed. Please refer to b/295925531#comment#14 for the details.
|
||||
enum MultiplexSocketBitmask : uint32_t {
|
||||
kBtMultiplexEnabled = 1 << 2,
|
||||
kWifiLanMultiplexEnabled = 1 << 3,
|
||||
};
|
||||
|
||||
private:
|
||||
struct Connection {
|
||||
// Status: may be either:
|
||||
@@ -487,18 +502,6 @@ class ClientProxy final {
|
||||
bool supports_safe_to_disconnect_;
|
||||
bool support_auto_reconnect_;
|
||||
std::int32_t local_safe_to_disconnect_version_;
|
||||
|
||||
/** Bitmask for bt multiplex connection support. */
|
||||
// Note. Deprecates the first and second bit of BT_MULTIPLEX_ENABLED and
|
||||
// WIFI_LAN_MULTIPLEX_ENABLED and shift them to the third and the forth bit.
|
||||
// The reason is we need to escape the (0, 1) bit which has been set in some
|
||||
// devices without salt enabled. If accompany with the devices with salted
|
||||
// enabled, the frames passed cannot be decrypted and the connection shall be
|
||||
// failed. Please refer to b/295925531#comment#14 for the details.
|
||||
enum MultiplexSocketBitmask : uint32_t {
|
||||
kBtMultiplexEnabled = 1 << 2,
|
||||
kWifiLanMultiplexEnabled = 1 << 3,
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace connections
|
||||
|
||||
Reference in New Issue
Block a user