Masterarbeit Richard Stern. Flutter App, sich mit einem Bluetooth-Gerät verbindet und Berührungen auf einem Sensor visualisiert.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flutterblue.proto 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // Copyright 2017, Paul DeMarco.
  2. // All rights reserved. Use of this source code is governed by a
  3. // BSD-style license that can be found in the LICENSE file.
  4. syntax = "proto3";
  5. option java_package = "com.pauldemarco.flutterblue";
  6. option java_outer_classname = "Protos";
  7. option objc_class_prefix = "Protos";
  8. // Wrapper message for `int32`.
  9. //
  10. // Allows for nullability of fields in messages
  11. message Int32Value {
  12. // The int32 value.
  13. int32 value = 1;
  14. }
  15. message BluetoothState {
  16. enum State {
  17. UNKNOWN = 0;
  18. UNAVAILABLE = 1;
  19. UNAUTHORIZED = 2;
  20. TURNING_ON = 3;
  21. ON = 4;
  22. TURNING_OFF = 5;
  23. OFF = 6;
  24. };
  25. State state = 1;
  26. }
  27. message AdvertisementData {
  28. string local_name = 1;
  29. Int32Value tx_power_level = 2;
  30. bool connectable = 3;
  31. map<int32, bytes> manufacturer_data = 4; // Map of manufacturers to their data
  32. map<string, bytes> service_data = 5; // Map of service UUIDs to their data.
  33. repeated string service_uuids = 6;
  34. }
  35. message ScanSettings {
  36. int32 android_scan_mode = 1;
  37. repeated string service_uuids = 2;
  38. }
  39. message ScanResult {
  40. BluetoothDevice device = 1; // The received peer's ID.
  41. AdvertisementData advertisement_data = 2;
  42. int32 rssi = 3;
  43. }
  44. message ConnectRequest {
  45. string remote_id = 1;
  46. bool android_auto_connect = 2;
  47. }
  48. message BluetoothDevice {
  49. enum Type {
  50. UNKNOWN = 0;
  51. CLASSIC = 1;
  52. LE = 2;
  53. DUAL = 3;
  54. };
  55. string remote_id = 1;
  56. string name = 2;
  57. Type type = 3;
  58. }
  59. message BluetoothService {
  60. string uuid = 1;
  61. string remote_id = 2;
  62. bool is_primary = 3; // Indicates whether the type of service is primary or secondary.
  63. repeated BluetoothCharacteristic characteristics = 4; // A list of characteristics that have been discovered in this service.
  64. repeated BluetoothService included_services = 5; // A list of included services that have been discovered in this service.
  65. }
  66. message BluetoothCharacteristic {
  67. string uuid = 1;
  68. string serviceUuid = 2; // The service that this characteristic belongs to.
  69. string secondaryServiceUuid = 3; // The secondary service if nested
  70. repeated BluetoothDescriptor descriptors = 4; // A list of descriptors that have been discovered in this characteristic.
  71. CharacteristicProperties properties = 5; // The properties of the characteristic.
  72. bytes value = 6;
  73. }
  74. message BluetoothDescriptor {
  75. string uuid = 1;
  76. string serviceUuid = 2; // The service that this descriptor belongs to.
  77. string characteristicUuid = 3; // The characteristic that this descriptor belongs to.
  78. bytes value = 4;
  79. }
  80. message CharacteristicProperties {
  81. bool broadcast = 1;
  82. bool read = 2;
  83. bool write_without_response = 3;
  84. bool write = 4;
  85. bool notify = 5;
  86. bool indicate = 6;
  87. bool authenticated_signed_writes = 7;
  88. bool extended_properties = 8;
  89. bool notify_encryption_required = 9;
  90. bool indicate_encryption_required = 10;
  91. }
  92. message DiscoverServicesResult {
  93. string remote_id = 1;
  94. repeated BluetoothService services = 2;
  95. }
  96. message ReadCharacteristicRequest {
  97. string remote_id = 1;
  98. string characteristic_uuid = 2;
  99. string service_uuid = 3;
  100. string secondary_service_uuid = 4;
  101. }
  102. message ReadCharacteristicResponse {
  103. string remote_id = 1;
  104. BluetoothCharacteristic characteristic = 2;
  105. }
  106. message ReadDescriptorRequest {
  107. string remote_id = 1;
  108. string descriptor_uuid = 2;
  109. string service_uuid = 3;
  110. string secondary_service_uuid = 4;
  111. string characteristic_uuid = 5;
  112. }
  113. message ReadDescriptorResponse {
  114. ReadDescriptorRequest request = 1;
  115. bytes value = 2;
  116. }
  117. message WriteCharacteristicRequest {
  118. enum WriteType {
  119. WITH_RESPONSE = 0;
  120. WITHOUT_RESPONSE = 1;
  121. }
  122. string remote_id = 1;
  123. string characteristic_uuid = 2;
  124. string service_uuid = 3;
  125. string secondary_service_uuid = 4;
  126. WriteType write_type = 5;
  127. bytes value = 6;
  128. }
  129. message WriteCharacteristicResponse {
  130. WriteCharacteristicRequest request = 1;
  131. bool success = 2;
  132. }
  133. message WriteDescriptorRequest {
  134. string remote_id = 1;
  135. string descriptor_uuid = 2;
  136. string service_uuid = 3;
  137. string secondary_service_uuid = 4;
  138. string characteristic_uuid = 5;
  139. bytes value = 6;
  140. }
  141. message WriteDescriptorResponse {
  142. WriteDescriptorRequest request = 1;
  143. bool success = 2;
  144. }
  145. message SetNotificationRequest {
  146. string remote_id = 1;
  147. string service_uuid = 2;
  148. string secondary_service_uuid = 3;
  149. string characteristic_uuid = 4;
  150. bool enable = 5;
  151. }
  152. message SetNotificationResponse {
  153. string remote_id = 1;
  154. BluetoothCharacteristic characteristic = 2;
  155. bool success = 3;
  156. }
  157. message OnNotificationResponse {
  158. string remote_id = 1;
  159. BluetoothCharacteristic characteristic = 2;
  160. }
  161. message DeviceStateResponse {
  162. enum BluetoothDeviceState {
  163. DISCONNECTED = 0;
  164. CONNECTING = 1;
  165. CONNECTED = 2;
  166. DISCONNECTING = 3;
  167. }
  168. string remote_id = 1;
  169. BluetoothDeviceState state = 2;
  170. }