xref: /aosp_15_r20/system/nfc/tools/casimir/src/proto/casimir.proto (revision 7eba2f3b06c51ae21384f6a4f14577b668a869b3)
1syntax = "proto2";
2
3package casimir;
4
5/// Description of the Casimir gRPC service.
6service Casimir {
7    /// Returns the list of devices currently connected to,
8    /// or existing within Casimir. Listed devices may be of three
9    /// different types:
10    ///   - NCI device (Host connected through the NCI port)
11    ///   - RF device (device emulated through the RF port)
12    ///   - Tag device (device fully emulated by Casimir)
13    rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse);
14
15    /// Query information about a created device.
16    rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse);
17
18    /// Change the relative position of the selected device.
19    rpc MoveDevice(MoveDeviceRequest) returns (MoveDeviceResponse);
20}
21
22/// Information about a connected device that can be queried
23/// from ListDevices or GetDevice.
24message Device {
25    message Nci {}
26    message Rf {}
27
28    optional uint32 device_id = 1;
29    optional uint32 position = 2;
30
31    oneof type {
32        Nci nci = 3;
33        Rf rf = 4;
34    }
35}
36
37/// Parameters for the ListDevices command.
38message ListDevicesRequest {
39}
40
41/// Result of the ListDevices command.
42message ListDevicesResponse {
43    repeated Device device = 1;
44}
45
46/// Parameters for the GetDevice command.
47message GetDeviceRequest {
48    optional uint32 device_id = 1;
49}
50
51/// Result of the GetDevice command.
52message GetDeviceResponse {
53    optional Device device = 1;
54}
55
56/// Parameters for the MoveDevice command.
57/// The device ID uniquely identifies the device; the position
58/// is interpreted on a linear range (the only information pertinent for
59/// NFC is contact / no-contact).
60message MoveDeviceRequest {
61    optional uint32 device_id = 1;
62    optional uint32 position = 2;
63}
64
65/// Result of the MoveDevice command.
66message MoveDeviceResponse {
67}
68