advertising-api.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. BlueZ D-Bus LE Advertising API Description
  2. ******************************************
  3. Advertising packets are structured data which is broadcast on the LE Advertising
  4. channels and available for all devices in range. Because of the limited space
  5. available in LE Advertising packets (31 bytes), each packet's contents must be
  6. carefully controlled.
  7. BlueZ acts as a store for the Advertisement Data which is meant to be sent.
  8. It constructs the correct Advertisement Data from the structured
  9. data and configured the kernel to send the correct advertisement.
  10. Advertisement Data objects are registered freely and then referenced by BlueZ
  11. when constructing the data sent to the kernel.
  12. LE Advertisement Data hierarchy
  13. ===============================
  14. Specifies the Advertisement Data to be broadcast and some advertising
  15. parameters. Properties which are not present will not be included in the
  16. data. Required advertisement data types will always be included.
  17. All UUIDs are 128-bit versions in the API, and 16 or 32-bit
  18. versions of the same UUID will be used in the advertising data as appropriate.
  19. Service org.bluez
  20. Interface org.bluez.LEAdvertisement1
  21. Object path freely definable
  22. Methods void Release() [noreply]
  23. This method gets called when the service daemon
  24. removes the Advertisement. A client can use it to do
  25. cleanup tasks. There is no need to call
  26. UnregisterAdvertisement because when this method gets
  27. called it has already been unregistered.
  28. Properties string Type
  29. Determines the type of advertising packet requested.
  30. Possible values: "broadcast" or "peripheral"
  31. array{string} ServiceUUIDs
  32. List of UUIDs to include in the "Service UUID" field of
  33. the Advertising Data.
  34. dict ManufacturerData
  35. Manufactuer Data fields to include in
  36. the Advertising Data. Keys are the Manufacturer ID
  37. to associate with the data.
  38. array{string} SolicitUUIDs
  39. Array of UUIDs to include in "Service Solicitation"
  40. Advertisement Data.
  41. dict ServiceData
  42. Service Data elements to include. The keys are the
  43. UUID to associate with the data.
  44. dict Data [Experimental]
  45. Advertising Type to include in the Advertising
  46. Data. Key is the advertising type and value is the
  47. data as byte array.
  48. Note: Types already handled by other properties shall
  49. not be used.
  50. Possible values:
  51. <type> <byte array>
  52. ...
  53. Example:
  54. <Transport Discovery> <Organization Flags...>
  55. 0x26 0x01 0x01...
  56. bool Discoverable [Experimental]
  57. Advertise as general discoverable. When present this
  58. will override adapter Discoverable property.
  59. Note: This property shall not be set when Type is set
  60. to broadcast.
  61. uint16 DiscoverableTimeout [Experimental]
  62. The discoverable timeout in seconds. A value of zero
  63. means that the timeout is disabled and it will stay in
  64. discoverable/limited mode forever.
  65. Note: This property shall not be set when Type is set
  66. to broadcast.
  67. array{string} Includes
  68. List of features to be included in the advertising
  69. packet.
  70. Possible values: as found on
  71. LEAdvertisingManager.SupportedIncludes
  72. string LocalName
  73. Local name to be used in the advertising report. If the
  74. string is too big to fit into the packet it will be
  75. truncated.
  76. If this property is available 'local-name' cannot be
  77. present in the Includes.
  78. uint16 Appearance
  79. Appearance to be used in the advertising report.
  80. Possible values: as found on GAP Service.
  81. uint16_t Duration
  82. Duration of the advertisement in seconds. If there are
  83. other applications advertising no duration is set the
  84. default is 2 seconds.
  85. uint16_t Timeout
  86. Timeout of the advertisement in seconds. This defines
  87. the lifetime of the advertisement.
  88. string SecondaryChannel [Experimental]
  89. Secondary channel to be used. Primary channel is
  90. always set to "1M" except when "Coded" is set.
  91. Possible value: "1M" (default)
  92. "2M"
  93. "Coded"
  94. uint32 MinInterval [Experimental]
  95. Minimum advertising interval to be used by the
  96. advertising set, in milliseconds. Acceptable values
  97. are in the range [20ms, 10,485s]. If the provided
  98. MinInterval is larger than the provided MaxInterval,
  99. the registration will return failure.
  100. uint32 MaxInterval [Experimental]
  101. Maximum advertising interval to be used by the
  102. advertising set, in milliseconds. Acceptable values
  103. are in the range [20ms, 10,485s]. If the provided
  104. MinInterval is larger than the provided MaxInterval,
  105. the registration will return failure.
  106. int16 TxPower [Experimental]
  107. Requested transmission power of this advertising set.
  108. The provided value is used only if the "CanSetTxPower"
  109. feature is enabled on the Advertising Manager. The
  110. provided value must be in range [-127 to +20], where
  111. units are in dBm.
  112. LE Advertising Manager hierarchy
  113. ================================
  114. The Advertising Manager allows external applications to register Advertisement
  115. Data which should be broadcast to devices. Advertisement Data elements must
  116. follow the API for LE Advertisement Data described above.
  117. Service org.bluez
  118. Interface org.bluez.LEAdvertisingManager1
  119. Object path /org/bluez/{hci0,hci1,...}
  120. Methods RegisterAdvertisement(object advertisement, dict options)
  121. Registers an advertisement object to be sent over the LE
  122. Advertising channel. The service must be exported
  123. under interface LEAdvertisement1.
  124. InvalidArguments error indicates that the object has
  125. invalid or conflicting properties.
  126. InvalidLength error indicates that the data
  127. provided generates a data packet which is too long.
  128. The properties of this object are parsed when it is
  129. registered, and any changes are ignored.
  130. If the same object is registered twice it will result in
  131. an AlreadyExists error.
  132. If the maximum number of advertisement instances is
  133. reached it will result in NotPermitted error.
  134. Possible errors: org.bluez.Error.InvalidArguments
  135. org.bluez.Error.AlreadyExists
  136. org.bluez.Error.InvalidLength
  137. org.bluez.Error.NotPermitted
  138. UnregisterAdvertisement(object advertisement)
  139. This unregisters an advertisement that has been
  140. previously registered. The object path parameter must
  141. match the same value that has been used on registration.
  142. Possible errors: org.bluez.Error.InvalidArguments
  143. org.bluez.Error.DoesNotExist
  144. Properties byte ActiveInstances
  145. Number of active advertising instances.
  146. byte SupportedInstances
  147. Number of available advertising instances.
  148. array{string} SupportedIncludes
  149. List of supported system includes.
  150. Possible values: "tx-power"
  151. "appearance"
  152. "local-name"
  153. array{string} SupportedSecondaryChannels [Experimental]
  154. List of supported Secondary channels. Secondary
  155. channels can be used to advertise with the
  156. corresponding PHY.
  157. Possible values: "1M"
  158. "2M"
  159. "Coded"
  160. dict SupportedCapabilities [Experimental]
  161. Enumerates Advertising-related controller capabilities
  162. useful to the client.
  163. Possible Values:
  164. byte MaxAdvLen
  165. Max advertising data length
  166. byte MaxScnRspLen
  167. Max advertising scan response length
  168. int16 MinTxPower
  169. Min advertising tx power (dBm)
  170. int16 MaxTxPower
  171. Max advertising tx power (dBm)
  172. array{string} SupportedFeatures [readonly,optional,Experimental]
  173. List of supported platform features. If no features
  174. are available on the platform, the SupportedFeatures
  175. array will be empty.
  176. Possible values: "CanSetTxPower"
  177. Indicates whether platform can
  178. specify tx power on each
  179. advertising instance.
  180. "HardwareOffload"
  181. Indicates whether multiple
  182. advertising will be offloaded
  183. to the controller.