bledata.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. syntax = "proto3";
  2. option java_package = "com.signify.hue.flutterreactiveble";
  3. option java_outer_classname = "ProtobufModel";
  4. message ScanForDevicesRequest {
  5. repeated Uuid serviceUuids = 1;
  6. int32 scanMode = 2;
  7. bool requireLocationServicesEnabled = 3;
  8. }
  9. message DeviceScanInfo {
  10. string id = 1;
  11. string name = 2;
  12. GenericFailure failure = 3;
  13. repeated ServiceDataEntry serviceData = 4;
  14. bytes manufacturerData = 6;
  15. repeated Uuid serviceUuids = 7;
  16. int32 rssi = 5;
  17. }
  18. message ConnectToDeviceRequest {
  19. string deviceId = 1;
  20. ServicesWithCharacteristics servicesWithCharacteristicsToDiscover = 2;
  21. int32 timeoutInMs = 3;
  22. }
  23. message DeviceInfo {
  24. string id = 1;
  25. int32 connectionState = 2;
  26. GenericFailure failure = 3;
  27. }
  28. message DisconnectFromDeviceRequest {
  29. string deviceId = 1;
  30. }
  31. message ClearGattCacheRequest {
  32. string deviceId = 1;
  33. }
  34. message ClearGattCacheInfo {
  35. GenericFailure failure = 1;
  36. }
  37. message NotifyCharacteristicRequest {
  38. CharacteristicAddress characteristic = 1;
  39. }
  40. message NotifyNoMoreCharacteristicRequest {
  41. CharacteristicAddress characteristic = 1;
  42. }
  43. message ReadCharacteristicRequest {
  44. CharacteristicAddress characteristic = 1;
  45. }
  46. message CharacteristicValueInfo {
  47. CharacteristicAddress characteristic = 1;
  48. bytes value = 2;
  49. GenericFailure failure = 3;
  50. }
  51. message WriteCharacteristicRequest {
  52. CharacteristicAddress characteristic = 1;
  53. bytes value = 2;
  54. }
  55. message WriteCharacteristicInfo {
  56. CharacteristicAddress characteristic = 1;
  57. GenericFailure failure = 3;
  58. }
  59. message NegotiateMtuRequest {
  60. string deviceId = 1;
  61. int32 mtuSize = 2;
  62. }
  63. message NegotiateMtuInfo {
  64. string deviceId = 1;
  65. int32 mtuSize = 2;
  66. GenericFailure failure = 3;
  67. }
  68. message BleStatusInfo {
  69. int32 status = 1;
  70. }
  71. message ChangeConnectionPriorityRequest {
  72. string deviceId = 1;
  73. int32 priority = 2;
  74. }
  75. message ChangeConnectionPriorityInfo {
  76. string deviceId = 1;
  77. GenericFailure failure = 2;
  78. }
  79. message CharacteristicAddress {
  80. string deviceId = 1;
  81. Uuid serviceUuid = 2;
  82. Uuid characteristicUuid = 3;
  83. }
  84. message ServiceDataEntry {
  85. Uuid serviceUuid = 1;
  86. bytes data = 2;
  87. }
  88. message ServicesWithCharacteristics {
  89. repeated ServiceWithCharacteristics items = 1;
  90. }
  91. message ServiceWithCharacteristics {
  92. Uuid serviceId = 1;
  93. repeated Uuid characteristics = 2;
  94. }
  95. message DiscoverServicesRequest {
  96. string deviceId = 1;
  97. }
  98. message DiscoverServicesInfo {
  99. string deviceId = 1;
  100. repeated DiscoveredService services = 2;
  101. }
  102. message DiscoveredService {
  103. Uuid serviceUuid = 1;
  104. repeated Uuid characteristicUuids = 2;
  105. repeated DiscoveredService includedServices = 3;
  106. repeated DiscoveredCharacteristic characteristics = 4;
  107. }
  108. message DiscoveredCharacteristic {
  109. Uuid characteristicId = 1;
  110. Uuid serviceId = 2;
  111. bool isReadable = 3;
  112. bool isWritableWithResponse = 4;
  113. bool isWritableWithoutResponse = 5;
  114. bool isNotifiable = 6;
  115. bool isIndicatable = 7;
  116. }
  117. message Uuid {
  118. bytes data = 1;
  119. }
  120. message GenericFailure {
  121. int32 code = 1;
  122. string message = 2;
  123. }