Skip to content

Commit

Permalink
Gap.proto: Add documentation for link layer states
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzcanoguz committed Feb 7, 2025
1 parent 51dca2d commit a611285
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions services/ble/Gap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ message Address
bytes address = 1 [(bytes_size) = 6];
}

// Link layer states of a device in a Peripheral or Central role
// Peripheral role states are standby, connected and advertising.
// Central role states are standby, scanning, connected and initiating.
// Allowed transitions are as follows.
// 1. Every state can go to standby.
// 2. Every state can be entered from standby except the connected state.
// 3. Connected state can only be entered from advertising and initiating states.
// For further details refer to Section 1.1, BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 6, Part B
message State
{
enum Event
Expand Down Expand Up @@ -167,27 +175,45 @@ service GapPeripheral
{
option (service_id) = 32;

// Allowed states: standby
rpc Advertise(AdvertisementMode) returns (Nothing) { option (method_id) = 1; }

// Allowed states: advertising, connected
rpc Standby(Nothing) returns (Nothing) { option (method_id) = 2; }

rpc SetAdvertisementData(AdvertisementData) returns (Nothing) { option (method_id) = 3; }
rpc SetScanResponseData(AdvertisementData) returns (Nothing) { option (method_id) = 4; }
rpc SetAllowPairing(BoolValue) returns (Nothing) { option (method_id) = 5; }
rpc SetSecurityMode(SecurityModeAndLevel) returns (Nothing) { option (method_id) = 6; }
rpc SetIoCapabilities(IoCapabilities) returns (Nothing) { option (method_id) = 7; }
rpc RemoveAllBonds(Nothing) returns (Nothing) { option (method_id) = 8; }

// Allowed states: advertising
rpc GetResolvableAddress(Nothing) returns (Nothing) { option (method_id) = 9; }
}

service GapCentral
{
option (service_id) = 33;

// Allowed states: standby
rpc StartDeviceDiscovery(Nothing) returns (Nothing) { option (method_id) = 1; }

// Allowed states: standby
rpc StopDeviceDiscovery(Nothing) returns (Nothing) { option (method_id) = 2; }

// Allowed states: standby
rpc Connect(ConnectionParameters) returns (Nothing) { option (method_id) = 3; }

// Allowed states: initiating???
rpc CancelConnect(Nothing) returns (Nothing) { option (method_id) = 4; }

// Allowed states: connected
rpc Disconnect(Nothing) returns (Nothing) { option (method_id) = 5; }

// Allowed states: connected
rpc Pair(Nothing) returns (Nothing) { option (method_id) = 6; }

rpc SetSecurityMode(SecurityModeAndLevel) returns (Nothing) { option (method_id) = 7; }
rpc SetIoCapabilities(IoCapabilities) returns (Nothing) { option (method_id) = 8; }
rpc AuthenticateWithPasskey(UInt32Value) returns (Nothing) { option (method_id) = 9; }
Expand Down

0 comments on commit a611285

Please sign in to comment.