1syntax = "proto3";
2
3package bluetooth.neighbor;
4
5import "google/protobuf/empty.proto";
6
7service NeighborFacade {
8  rpc SetConnectability(EnableMsg) returns (google.protobuf.Empty) {}
9  rpc SetDiscoverability(DiscoverabilitiyMsg) returns (google.protobuf.Empty) {}
10  rpc SetInquiryMode(InquiryMsg) returns (stream InquiryResultMsg) {
11    // Sets inquiry mode and fetches inquiry result HCI packet
12  }
13  rpc ReadRemoteName(RemoteNameRequestMsg) returns (google.protobuf.Empty) {}
14  rpc GetRemoteNameEvents(google.protobuf.Empty) returns (stream RemoteNameResponseMsg) {}
15  // TODO: Should we use a blocking call for ReadRemoteName instead? (Note: blocking model may not work for GD stack)
16  rpc EnableInquiryScan(EnableMsg) returns (google.protobuf.Empty) {}
17  rpc EnablePageScan(EnableMsg) returns (google.protobuf.Empty) {}
18}
19
20message EnableMsg {
21  bool enabled = 1;
22}
23
24enum DiscoverabilityMode {
25  OFF = 0;
26  LIMITED = 1;
27  GENERAL = 2;
28}
29
30message DiscoverabilitiyMsg {
31  DiscoverabilityMode mode = 1;
32}
33
34enum ResultMode {
35  STANDARD = 0;
36  RSSI = 1;
37  EXTENDED = 2;
38}
39
40message InquiryMsg {
41  DiscoverabilityMode inquiry_mode = 1;
42  ResultMode result_mode = 2;
43  uint32 length_1_28s = 3;
44  uint32 max_results = 4;  // 0 is unlimited
45}
46
47message InquiryResultMsg {
48  bytes packet = 1;
49}
50
51message RemoteNameRequestMsg {
52  bytes address = 1;
53  uint32 page_scan_repetition_mode = 2;  // r0, r1, r2
54  uint32 clock_offset = 3;
55}
56
57message RemoteNameResponseMsg {
58  uint32 status = 1;
59  bytes address = 2;
60  bytes name = 3;
61}
62