device-api.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. BlueZ D-Bus Device API description
  2. **********************************
  3. Device hierarchy
  4. ================
  5. Service org.bluez
  6. Interface org.bluez.Device1
  7. Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
  8. Methods void Connect()
  9. This is a generic method to connect any profiles
  10. the remote device supports that can be connected
  11. to and have been flagged as auto-connectable on
  12. our side. If only subset of profiles is already
  13. connected it will try to connect currently disconnected
  14. ones.
  15. If at least one profile was connected successfully this
  16. method will indicate success.
  17. For dual-mode devices only one bearer is connected at
  18. time, the conditions are in the following order:
  19. 1. Connect the disconnected bearer if already
  20. connected.
  21. 2. Connect first the bonded bearer. If no
  22. bearers are bonded or both are skip and check
  23. latest seen bearer.
  24. 3. Connect last seen bearer, in case the
  25. timestamps are the same BR/EDR takes
  26. precedence.
  27. Possible errors: org.bluez.Error.NotReady
  28. org.bluez.Error.Failed
  29. org.bluez.Error.InProgress
  30. org.bluez.Error.AlreadyConnected
  31. void Disconnect()
  32. This method gracefully disconnects all connected
  33. profiles and then terminates low-level ACL connection.
  34. ACL connection will be terminated even if some profiles
  35. were not disconnected properly e.g. due to misbehaving
  36. device.
  37. This method can be also used to cancel a preceding
  38. Connect call before a reply to it has been received.
  39. For non-trusted devices connected over LE bearer calling
  40. this method will disable incoming connections until
  41. Connect method is called again.
  42. Possible errors: org.bluez.Error.NotConnected
  43. void ConnectProfile(string uuid)
  44. This method connects a specific profile of this
  45. device. The UUID provided is the remote service
  46. UUID for the profile.
  47. Possible errors: org.bluez.Error.Failed
  48. org.bluez.Error.InProgress
  49. org.bluez.Error.InvalidArguments
  50. org.bluez.Error.NotAvailable
  51. org.bluez.Error.NotReady
  52. void DisconnectProfile(string uuid)
  53. This method disconnects a specific profile of
  54. this device. The profile needs to be registered
  55. client profile.
  56. There is no connection tracking for a profile, so
  57. as long as the profile is registered this will always
  58. succeed.
  59. Possible errors: org.bluez.Error.Failed
  60. org.bluez.Error.InProgress
  61. org.bluez.Error.InvalidArguments
  62. org.bluez.Error.NotSupported
  63. void Pair()
  64. This method will connect to the remote device,
  65. initiate pairing and then retrieve all SDP records
  66. (or GATT primary services).
  67. If the application has registered its own agent,
  68. then that specific agent will be used. Otherwise
  69. it will use the default agent.
  70. Only for applications like a pairing wizard it
  71. would make sense to have its own agent. In almost
  72. all other cases the default agent will handle
  73. this just fine.
  74. In case there is no application agent and also
  75. no default agent present, this method will fail.
  76. Possible errors: org.bluez.Error.InvalidArguments
  77. org.bluez.Error.Failed
  78. org.bluez.Error.AlreadyExists
  79. org.bluez.Error.AuthenticationCanceled
  80. org.bluez.Error.AuthenticationFailed
  81. org.bluez.Error.AuthenticationRejected
  82. org.bluez.Error.AuthenticationTimeout
  83. org.bluez.Error.ConnectionAttemptFailed
  84. void CancelPairing()
  85. This method can be used to cancel a pairing
  86. operation initiated by the Pair method.
  87. Possible errors: org.bluez.Error.DoesNotExist
  88. org.bluez.Error.Failed
  89. Properties string Address [readonly]
  90. The Bluetooth device address of the remote device.
  91. string AddressType [readonly]
  92. The Bluetooth device Address Type. For dual-mode and
  93. BR/EDR only devices this defaults to "public". Single
  94. mode LE devices may have either value. If remote device
  95. uses privacy than before pairing this represents address
  96. type used for connection and Identity Address after
  97. pairing.
  98. Possible values:
  99. "public" - Public address
  100. "random" - Random address
  101. string Name [readonly, optional]
  102. The Bluetooth remote name. This value can not be
  103. changed. Use the Alias property instead.
  104. This value is only present for completeness. It is
  105. better to always use the Alias property when
  106. displaying the devices name.
  107. If the Alias property is unset, it will reflect
  108. this value which makes it more convenient.
  109. string Icon [readonly, optional]
  110. Proposed icon name according to the freedesktop.org
  111. icon naming specification.
  112. uint32 Class [readonly, optional]
  113. The Bluetooth class of device of the remote device.
  114. uint16 Appearance [readonly, optional]
  115. External appearance of device, as found on GAP service.
  116. array{string} UUIDs [readonly, optional]
  117. List of 128-bit UUIDs that represents the available
  118. remote services.
  119. boolean Paired [readonly]
  120. Indicates if the remote device is paired.
  121. boolean Connected [readonly]
  122. Indicates if the remote device is currently connected.
  123. A PropertiesChanged signal indicate changes to this
  124. status.
  125. boolean Trusted [readwrite]
  126. Indicates if the remote is seen as trusted. This
  127. setting can be changed by the application.
  128. boolean Blocked [readwrite]
  129. If set to true any incoming connections from the
  130. device will be immediately rejected. Any device
  131. drivers will also be removed and no new ones will
  132. be probed as long as the device is blocked.
  133. boolean WakeAllowed [readwrite]
  134. If set to true this device will be allowed to wake the
  135. host from system suspend.
  136. string Alias [readwrite]
  137. The name alias for the remote device. The alias can
  138. be used to have a different friendly name for the
  139. remote device.
  140. In case no alias is set, it will return the remote
  141. device name. Setting an empty string as alias will
  142. convert it back to the remote device name.
  143. When resetting the alias with an empty string, the
  144. property will default back to the remote name.
  145. object Adapter [readonly]
  146. The object path of the adapter the device belongs to.
  147. boolean LegacyPairing [readonly]
  148. Set to true if the device only supports the pre-2.1
  149. pairing mechanism. This property is useful during
  150. device discovery to anticipate whether legacy or
  151. simple pairing will occur if pairing is initiated.
  152. Note that this property can exhibit false-positives
  153. in the case of Bluetooth 2.1 (or newer) devices that
  154. have disabled Extended Inquiry Response support.
  155. string Modalias [readonly, optional]
  156. Remote Device ID information in modalias format
  157. used by the kernel and udev.
  158. int16 RSSI [readonly, optional]
  159. Received Signal Strength Indicator of the remote
  160. device (inquiry or advertising).
  161. int16 TxPower [readonly, optional]
  162. Advertised transmitted power level (inquiry or
  163. advertising).
  164. dict ManufacturerData [readonly, optional]
  165. Manufacturer specific advertisement data. Keys are
  166. 16 bits Manufacturer ID followed by its byte array
  167. value.
  168. dict ServiceData [readonly, optional]
  169. Service advertisement data. Keys are the UUIDs in
  170. string format followed by its byte array value.
  171. bool ServicesResolved [readonly]
  172. Indicate whether or not service discovery has been
  173. resolved.
  174. array{byte} AdvertisingFlags [readonly, experimental]
  175. The Advertising Data Flags of the remote device.
  176. dict AdvertisingData [readonly, experimental]
  177. The Advertising Data of the remote device. Keys are
  178. are 8 bits AD Type followed by data as byte array.
  179. Note: Only types considered safe to be handled by
  180. application are exposed.
  181. Possible values:
  182. <type> <byte array>
  183. ...
  184. Example:
  185. <Transport Discovery> <Organization Flags...>
  186. 0x26 0x01 0x01...