adapter-api.txt 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. BlueZ D-Bus Adapter API description
  2. ***********************************
  3. Adapter hierarchy
  4. =================
  5. Service org.bluez
  6. Interface org.bluez.Adapter1
  7. Object path [variable prefix]/{hci0,hci1,...}
  8. Methods void StartDiscovery()
  9. This method starts the device discovery session. This
  10. includes an inquiry procedure and remote device name
  11. resolving. Use StopDiscovery to release the sessions
  12. acquired.
  13. This process will start creating Device objects as
  14. new devices are discovered.
  15. During discovery RSSI delta-threshold is imposed.
  16. Possible errors: org.bluez.Error.NotReady
  17. org.bluez.Error.Failed
  18. org.bluez.Error.InProgress
  19. void StopDiscovery()
  20. This method will cancel any previous StartDiscovery
  21. transaction.
  22. Note that a discovery procedure is shared between all
  23. discovery sessions thus calling StopDiscovery will only
  24. release a single session.
  25. Possible errors: org.bluez.Error.NotReady
  26. org.bluez.Error.Failed
  27. org.bluez.Error.NotAuthorized
  28. void RemoveDevice(object device)
  29. This removes the remote device object at the given
  30. path. It will remove also the pairing information.
  31. Possible errors: org.bluez.Error.InvalidArguments
  32. org.bluez.Error.Failed
  33. void SetDiscoveryFilter(dict filter)
  34. This method sets the device discovery filter for the
  35. caller. When this method is called with no filter
  36. parameter, filter is removed.
  37. Parameters that may be set in the filter dictionary
  38. include the following:
  39. array{string} UUIDs
  40. Filter by service UUIDs, empty means match
  41. _any_ UUID.
  42. When a remote device is found that advertises
  43. any UUID from UUIDs, it will be reported if:
  44. - Pathloss and RSSI are both empty.
  45. - only Pathloss param is set, device advertise
  46. TX pwer, and computed pathloss is less than
  47. Pathloss param.
  48. - only RSSI param is set, and received RSSI is
  49. higher than RSSI param.
  50. int16 RSSI
  51. RSSI threshold value.
  52. PropertiesChanged signals will be emitted
  53. for already existing Device objects, with
  54. updated RSSI value. If one or more discovery
  55. filters have been set, the RSSI delta-threshold,
  56. that is imposed by StartDiscovery by default,
  57. will not be applied.
  58. uint16 Pathloss
  59. Pathloss threshold value.
  60. PropertiesChanged signals will be emitted
  61. for already existing Device objects, with
  62. updated Pathloss value.
  63. string Transport (Default "auto")
  64. Transport parameter determines the type of
  65. scan.
  66. Possible values:
  67. "auto" - interleaved scan
  68. "bredr" - BR/EDR inquiry
  69. "le" - LE scan only
  70. If "le" or "bredr" Transport is requested,
  71. and the controller doesn't support it,
  72. org.bluez.Error.Failed error will be returned.
  73. If "auto" transport is requested, scan will use
  74. LE, BREDR, or both, depending on what's
  75. currently enabled on the controller.
  76. bool DuplicateData (Default: true)
  77. Disables duplicate detection of advertisement
  78. data.
  79. When enabled PropertiesChanged signals will be
  80. generated for either ManufacturerData and
  81. ServiceData everytime they are discovered.
  82. bool Discoverable (Default: false)
  83. Make adapter discoverable while discovering,
  84. if the adapter is already discoverable setting
  85. this filter won't do anything.
  86. string Pattern (Default: none)
  87. Discover devices where the pattern matches
  88. either the prefix of the address or
  89. device name which is convenient way to limited
  90. the number of device objects created during a
  91. discovery.
  92. When set disregards device discoverable flags.
  93. Note: The pattern matching is ignored if there
  94. are other client that don't set any pattern as
  95. it work as a logical OR, also setting empty
  96. string "" pattern will match any device found.
  97. When discovery filter is set, Device objects will be
  98. created as new devices with matching criteria are
  99. discovered regardless of they are connectable or
  100. discoverable which enables listening to
  101. non-connectable and non-discoverable devices.
  102. When multiple clients call SetDiscoveryFilter, their
  103. filters are internally merged, and notifications about
  104. new devices are sent to all clients. Therefore, each
  105. client must check that device updates actually match
  106. its filter.
  107. When SetDiscoveryFilter is called multiple times by the
  108. same client, last filter passed will be active for
  109. given client.
  110. SetDiscoveryFilter can be called before StartDiscovery.
  111. It is useful when client will create first discovery
  112. session, to ensure that proper scan will be started
  113. right after call to StartDiscovery.
  114. Possible errors: org.bluez.Error.NotReady
  115. org.bluez.Error.NotSupported
  116. org.bluez.Error.Failed
  117. array{string} GetDiscoveryFilters()
  118. Return available filters that can be given to
  119. SetDiscoveryFilter.
  120. Possible errors: None
  121. object ConnectDevice(dict properties) [experimental]
  122. This method connects to device without need of
  123. performing General Discovery. Connection mechanism is
  124. similar to Connect method from Device1 interface with
  125. exception that this method returns success when physical
  126. connection is established. After this method returns,
  127. services discovery will continue and any supported
  128. profile will be connected. There is no need for calling
  129. Connect on Device1 after this call. If connection was
  130. successful this method returns object path to created
  131. device object.
  132. Parameters that may be set in the filter dictionary
  133. include the following:
  134. string Address
  135. The Bluetooth device address of the remote
  136. device. This parameter is mandatory.
  137. string AddressType
  138. The Bluetooth device Address Type. This is
  139. address type that should be used for initial
  140. connection. If this parameter is not present
  141. BR/EDR device is created.
  142. Possible values:
  143. "public" - Public address
  144. "random" - Random address
  145. Possible errors: org.bluez.Error.InvalidArguments
  146. org.bluez.Error.AlreadyExists
  147. org.bluez.Error.NotSupported
  148. org.bluez.Error.NotReady
  149. org.bluez.Error.Failed
  150. Properties string Address [readonly]
  151. The Bluetooth device address.
  152. string AddressType [readonly]
  153. The Bluetooth Address Type. For dual-mode and BR/EDR
  154. only adapter this defaults to "public". Single mode LE
  155. adapters may have either value. With privacy enabled
  156. this contains type of Identity Address and not type of
  157. address used for connection.
  158. Possible values:
  159. "public" - Public address
  160. "random" - Random address
  161. string Name [readonly]
  162. The Bluetooth system name (pretty hostname).
  163. This property is either a static system default
  164. or controlled by an external daemon providing
  165. access to the pretty hostname configuration.
  166. string Alias [readwrite]
  167. The Bluetooth friendly name. This value can be
  168. changed.
  169. In case no alias is set, it will return the system
  170. provided name. Setting an empty string as alias will
  171. convert it back to the system provided name.
  172. When resetting the alias with an empty string, the
  173. property will default back to system name.
  174. On a well configured system, this property never
  175. needs to be changed since it defaults to the system
  176. name and provides the pretty hostname. Only if the
  177. local name needs to be different from the pretty
  178. hostname, this property should be used as last
  179. resort.
  180. uint32 Class [readonly]
  181. The Bluetooth class of device.
  182. This property represents the value that is either
  183. automatically configured by DMI/ACPI information
  184. or provided as static configuration.
  185. boolean Powered [readwrite]
  186. Switch an adapter on or off. This will also set the
  187. appropriate connectable state of the controller.
  188. The value of this property is not persistent. After
  189. restart or unplugging of the adapter it will reset
  190. back to false.
  191. boolean Discoverable [readwrite]
  192. Switch an adapter to discoverable or non-discoverable
  193. to either make it visible or hide it. This is a global
  194. setting and should only be used by the settings
  195. application.
  196. If the DiscoverableTimeout is set to a non-zero
  197. value then the system will set this value back to
  198. false after the timer expired.
  199. In case the adapter is switched off, setting this
  200. value will fail.
  201. When changing the Powered property the new state of
  202. this property will be updated via a PropertiesChanged
  203. signal.
  204. For any new adapter this settings defaults to false.
  205. boolean Pairable [readwrite]
  206. Switch an adapter to pairable or non-pairable. This is
  207. a global setting and should only be used by the
  208. settings application.
  209. Note that this property only affects incoming pairing
  210. requests.
  211. For any new adapter this settings defaults to true.
  212. uint32 PairableTimeout [readwrite]
  213. The pairable timeout in seconds. A value of zero
  214. means that the timeout is disabled and it will stay in
  215. pairable mode forever.
  216. The default value for pairable timeout should be
  217. disabled (value 0).
  218. uint32 DiscoverableTimeout [readwrite]
  219. The discoverable timeout in seconds. A value of zero
  220. means that the timeout is disabled and it will stay in
  221. discoverable/limited mode forever.
  222. The default value for the discoverable timeout should
  223. be 180 seconds (3 minutes).
  224. boolean Discovering [readonly]
  225. Indicates that a device discovery procedure is active.
  226. array{string} UUIDs [readonly]
  227. List of 128-bit UUIDs that represents the available
  228. local services.
  229. string Modalias [readonly, optional]
  230. Local Device ID information in modalias format
  231. used by the kernel and udev.
  232. array{string} Roles [readonly]
  233. List of supported roles. Possible values:
  234. "central": Supports the central role.
  235. "peripheral": Supports the peripheral role.
  236. "central-peripheral": Supports both roles
  237. concurrently.
  238. array{string} ExperimentalFeatures [readonly, optional]
  239. List of 128-bit UUIDs that represents the experimental
  240. features currently enabled.