Skip to content

Commit

Permalink
Add Host.ConnectLEWithUpdates rpc
Browse files Browse the repository at this point in the history
Add Host.ConnectLEWithUpdates rpc that will be used to receive
connection parameter updates in Pandora tests. A stream is used
so that no updates are missed, especially right after connecting.
The stream can also be used in the future for connection updates
like encryption being enabled.
  • Loading branch information
BenjaminLawson committed Dec 13, 2023
1 parent 71dbcfc commit 940b0e5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pandora/host.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ service Host {
// Unlike BR/EDR `Connect`, this must not trigger or wait any
// pairing/encryption and return as soon as the connection is complete.
rpc ConnectLE(ConnectLERequest) returns (ConnectLEResponse);
// Like `ConnectLE`, but streams updates about the connection after the
// initial ConnectLEResponse. Currently the only update supported is
// connection parameter updates.
rpc ConnectLEWithUpdates(ConnectLERequest) returns (stream ConnectLEWithUpdatesResponse);
// Disconnect an ACL connection.
// The related Connection must not be reused afterwards.
rpc Disconnect(DisconnectRequest) returns (google.protobuf.Empty);
Expand Down Expand Up @@ -257,6 +261,34 @@ message ConnectLEResponse {
}
}

// Response of the `ConnectLEWithUpdates` method.
message ConnectLEWithUpdatesResponse {
oneof update {
// The first message sent on the stream. Contains the Connection on success
// or an error on failure.
ConnectLEResponse connect_response = 1;
// Sent when the connection parameters are updated.
ConnectionParameters connection_parameter_update = 2;
}
}

message ConnectionParameters {
// Connection interval used on this connection.
// Range: 0x0006 to 0x0C80
// Time = N × 1.25 ms
// Time Range: 7.5 ms to 4000 ms.
uint16 connection_interval = 1;
// Peripheral latency for the connection in number of subrated connection
// events.
// Range: 0x0000 to 0x01F3
uint16 peripheral_latency = 2;
// Supervision timeout for this connection.
// Range: 0x000A to 0x0C80
// Time = N × 10 ms
// Time Range: 100 ms to 32000 ms
uint16 supervision_timeout = 3;
}

// Request of the `Disconnect` method.
message DisconnectRequest {
// Connection that should be disconnected.
Expand Down

0 comments on commit 940b0e5

Please sign in to comment.