1syntax = "proto3";
2
3package blueberry.facade.hci;
4
5import "google/protobuf/empty.proto";
6
7service LeScanningManagerFacade {
8  rpc RegisterScanner(RegisterScannerRequest) returns (google.protobuf.Empty) {}
9  rpc Unregister(UnregisterRequest) returns (google.protobuf.Empty) {}
10  rpc Scan(ScanRequest) returns (google.protobuf.Empty) {}
11  rpc SetScanParameters(SetScanParametersRequest) returns (google.protobuf.Empty) {}
12  rpc FetchCallbackEvents(google.protobuf.Empty) returns (stream ScanningCallbackMsg) {}
13  rpc FetchAdvertisingReports(google.protobuf.Empty) returns (stream AdvertisingReportMsg) {}
14}
15
16enum LeScanType {
17  PASSIVE = 0x0;
18  ACTIVE = 0x1;
19}
20
21enum ScanningCallbackMsgType {
22  SCANNER_REGISTERED = 0;
23  SET_SCANNER_PARAMETER_COMPLETE = 1;
24  SCAN_RESULT = 2;
25  TRACK_ADV_FOUND_LOST = 3;
26  BATCH_SCAN_REPORTS = 4;
27  BATCH_SCAN_THRESHOLD_CROSSED = 5;
28  TIMEOUT = 6;
29  FILTER_ENABLE = 7;
30  FILTER_PARAMETER_SETUP = 8;
31  FILTER_CONFIG = 9;
32}
33
34enum ScanningStatus {
35  SCAN_SUCCESS = 0x00;
36  SCAN_NO_RESOURCES = 0x80;
37  SCAN_INTERNAL_ERROR = 0x85;
38  SCAN_ILLEGAL_PARAMETER = 0x87;
39};
40
41message RegisterScannerRequest {
42  uint32 uuid = 1;
43}
44
45message UnregisterRequest {
46  uint32 scanner_id = 1;
47}
48
49message ScanRequest {
50  bool start = 1;
51}
52
53message SetScanParametersRequest {
54  uint32 scanner_id = 1;
55  LeScanType scan_type = 2;
56  uint32 scan_interval = 3;
57  uint32 scan_window = 4;
58  uint32 scan_phy = 5;
59}
60
61message AdvertisingReportMsg {
62  bytes event = 1;
63}
64
65message ScanningCallbackMsg {
66  ScanningCallbackMsgType message_type = 1;
67  ScanningStatus status = 2;
68  uint32 data = 3;
69}
70