syntax = "proto3"; package dev.yanshouwang.bluetooth_low_energy; message Message { MessageCategory category = 1; oneof value { bool state = 2; Discovery discovery = 3; bool scanning = 4; ConnectionLost connectionLost = 5; GattCharacteristicValue characteristicValue = 6; } } message StartDiscoveryArguments { repeated string services = 1; } message Discovery { string address = 1; sint32 rssi = 2; bytes advertisements = 3; } message ConnectArguments { string address = 1; } message GATT { int32 id = 1; int32 mtu = 2; repeated GattService services = 3; } message GattDisconnectArguments{ string address = 1; int32 id = 2; } message GattService { int32 id = 1; string uuid = 2; repeated GattCharacteristic characteristics = 3; } message GattCharacteristic { int32 id = 1; string uuid = 2; repeated GattDescriptor descriptors = 3; bool canRead = 4; bool canWrite = 5; bool canWriteWithoutResponse = 6; bool canNotify = 7; } message GattDescriptor { int32 id = 1; string uuid = 2; } message ConnectionLost { int32 id = 1; int32 error_code = 2; } message GattCharacteristicReadArguments { string address = 1; string service_uuid = 2; string uuid = 3; int32 id = 4; } message GattCharacteristicWriteArguments { string address = 1; string service_uuid = 2; string uuid = 3; int32 id = 4; bytes value = 5; bool withoutResponse = 6; } message GattCharacteristicNotifyArguments{ string address = 1; string service_uuid = 2; string uuid = 3; int32 id = 4; bool state = 5; } message GattCharacteristicValue { int32 id = 3; bytes value = 4; } message GattDescriptorReadArguments { string address = 1; string service_uuid = 2; string characteristic_uuid = 3; string uuid = 4; int32 id = 5; } message GattDescriptorWriteArguments { string address = 1; string service_uuid = 2; string characteristic_uuid = 3; string uuid = 4; int32 id = 5; bytes value = 6; } enum MessageCategory { BLUETOOTH_AVAILABLE =0; BLUETOOTH_STATE = 1; CENTRAL_START_DISCOVERY = 2; CENTRAL_STOP_DISCOVERY = 3; CENTRAL_DISCOVERED = 4; CENTRAL_CONNECT = 5; GATT_DISCONNECT = 6; GATT_CONNECTION_LOST = 7; GATT_CHARACTERISTIC_READ = 8; GATT_CHARACTERISTIC_WRITE = 9; GATT_CHARACTERISTIC_NOTIFY = 10; GATT_DESCRIPTOR_READ = 11; GATT_DESCRIPTOR_WRITE = 12; }