@microbit/microbit-connection 0.9.0-apps.alpha.16 → 0.9.0-apps.alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/build/{esm/bluetooth.d.ts → cjs/bluetooth/connection.d.ts} +30 -26
  2. package/build/cjs/{bluetooth.js → bluetooth/connection.js} +147 -104
  3. package/build/cjs/bluetooth/connection.js.map +1 -0
  4. package/build/cjs/{bluetooth.test.js → bluetooth/connection.test.js} +9 -9
  5. package/build/cjs/bluetooth/connection.test.js.map +1 -0
  6. package/build/cjs/bluetooth/device-bond-state.js.map +1 -0
  7. package/build/cjs/{bluetooth-device-wrapper.d.ts → bluetooth/device-wrapper.d.ts} +11 -11
  8. package/build/cjs/{bluetooth-device-wrapper.js → bluetooth/device-wrapper.js} +35 -35
  9. package/build/cjs/bluetooth/device-wrapper.js.map +1 -0
  10. package/build/cjs/{flashing → bluetooth/flashing}/flashing-full.d.ts +2 -2
  11. package/build/cjs/{flashing → bluetooth/flashing}/flashing-full.js +4 -4
  12. package/build/cjs/bluetooth/flashing/flashing-full.js.map +1 -0
  13. package/build/cjs/{flashing → bluetooth/flashing}/flashing-makecode.d.ts +1 -1
  14. package/build/cjs/bluetooth/flashing/flashing-makecode.js.map +1 -0
  15. package/build/cjs/{flashing → bluetooth/flashing}/flashing-makecode.test.js +3 -3
  16. package/build/cjs/bluetooth/flashing/flashing-makecode.test.js.map +1 -0
  17. package/build/cjs/{flashing → bluetooth/flashing}/flashing-partial.d.ts +2 -2
  18. package/build/cjs/{flashing → bluetooth/flashing}/flashing-partial.js +5 -5
  19. package/build/cjs/bluetooth/flashing/flashing-partial.js.map +1 -0
  20. package/build/cjs/bluetooth/flashing/flashing-v1.js.map +1 -0
  21. package/build/cjs/{flashing → bluetooth/flashing}/nordic-dfu.d.ts +2 -2
  22. package/build/cjs/{flashing → bluetooth/flashing}/nordic-dfu.js +11 -8
  23. package/build/cjs/bluetooth/flashing/nordic-dfu.js.map +1 -0
  24. package/build/cjs/bluetooth/flashing/zip.js.map +1 -0
  25. package/build/cjs/bluetooth/flashing/zip.test.js.map +1 -0
  26. package/build/cjs/bluetooth/index.d.ts +5 -0
  27. package/build/cjs/bluetooth/index.js +9 -0
  28. package/build/cjs/bluetooth/index.js.map +1 -0
  29. package/build/cjs/{bluetooth-profile.js → bluetooth/profile.js} +1 -1
  30. package/build/cjs/bluetooth/profile.js.map +1 -0
  31. package/build/cjs/{accelerometer-service.d.ts → bluetooth/services/accelerometer-service.d.ts} +2 -3
  32. package/build/cjs/{accelerometer-service.js → bluetooth/services/accelerometer-service.js} +16 -12
  33. package/build/cjs/bluetooth/services/accelerometer-service.js.map +1 -0
  34. package/build/{esm → cjs/bluetooth/services}/button-service.d.ts +2 -3
  35. package/build/cjs/{button-service.js → bluetooth/services/button-service.js} +15 -14
  36. package/build/cjs/bluetooth/services/button-service.js.map +1 -0
  37. package/build/{esm → cjs/bluetooth/services}/device-information-service.d.ts +1 -1
  38. package/build/cjs/{device-information-service.js → bluetooth/services/device-information-service.js} +2 -2
  39. package/build/cjs/bluetooth/services/device-information-service.js.map +1 -0
  40. package/build/cjs/{dfu-service.js → bluetooth/services/dfu-service.js} +2 -2
  41. package/build/cjs/bluetooth/services/dfu-service.js.map +1 -0
  42. package/build/{esm → cjs/bluetooth/services}/led-service.d.ts +2 -3
  43. package/build/cjs/{led-service.js → bluetooth/services/led-service.js} +7 -7
  44. package/build/cjs/bluetooth/services/led-service.js.map +1 -0
  45. package/build/cjs/{magnetometer-service.d.ts → bluetooth/services/magnetometer-service.d.ts} +2 -3
  46. package/build/cjs/{magnetometer-service.js → bluetooth/services/magnetometer-service.js} +18 -14
  47. package/build/cjs/bluetooth/services/magnetometer-service.js.map +1 -0
  48. package/build/{esm → cjs/bluetooth/services}/partial-flashing-service.d.ts +1 -1
  49. package/build/cjs/{partial-flashing-service.js → bluetooth/services/partial-flashing-service.js} +8 -8
  50. package/build/cjs/bluetooth/services/partial-flashing-service.js.map +1 -0
  51. package/build/cjs/{uart-service.d.ts → bluetooth/services/uart-service.d.ts} +2 -2
  52. package/build/cjs/{uart-service.js → bluetooth/services/uart-service.js} +12 -9
  53. package/build/cjs/bluetooth/services/uart-service.js.map +1 -0
  54. package/build/cjs/board-id.d.ts +1 -1
  55. package/build/cjs/board-id.js.map +1 -1
  56. package/build/cjs/device.d.ts +82 -75
  57. package/build/cjs/device.js +40 -126
  58. package/build/cjs/device.js.map +1 -1
  59. package/build/cjs/events.d.ts +9 -108
  60. package/build/cjs/events.js +27 -88
  61. package/build/cjs/events.js.map +1 -1
  62. package/build/cjs/events.test.js +54 -48
  63. package/build/cjs/events.test.js.map +1 -1
  64. package/build/cjs/hex-util.d.ts +1 -0
  65. package/build/cjs/hex-util.js +15 -0
  66. package/build/cjs/hex-util.js.map +1 -0
  67. package/build/cjs/index.d.ts +7 -16
  68. package/build/cjs/index.js +6 -26
  69. package/build/cjs/index.js.map +1 -1
  70. package/build/cjs/radio-bridge/connection.d.ts +39 -0
  71. package/build/cjs/{usb-radio-bridge.js → radio-bridge/connection.js} +39 -25
  72. package/build/cjs/radio-bridge/connection.js.map +1 -0
  73. package/build/cjs/radio-bridge/index.d.ts +4 -0
  74. package/build/cjs/radio-bridge/index.js +9 -0
  75. package/build/cjs/radio-bridge/index.js.map +1 -0
  76. package/build/cjs/{usb-serial-protocol.js → radio-bridge/serial-protocol.js} +1 -1
  77. package/build/cjs/radio-bridge/serial-protocol.js.map +1 -0
  78. package/build/cjs/service-events.d.ts +42 -14
  79. package/build/cjs/service-events.js +6 -36
  80. package/build/cjs/service-events.js.map +1 -1
  81. package/build/{esm/hex-flash-data-source.d.ts → cjs/universal-hex/flash-data-source.d.ts} +1 -2
  82. package/build/cjs/{hex-flash-data-source.js → universal-hex/flash-data-source.js} +7 -15
  83. package/build/cjs/universal-hex/flash-data-source.js.map +1 -0
  84. package/build/cjs/universal-hex/index.d.ts +4 -0
  85. package/build/cjs/universal-hex/index.js +9 -0
  86. package/build/cjs/universal-hex/index.js.map +1 -0
  87. package/build/cjs/usb/arm-debug.d.ts +137 -0
  88. package/build/cjs/usb/arm-debug.js +414 -0
  89. package/build/cjs/usb/arm-debug.js.map +1 -0
  90. package/build/cjs/usb/arm-debug.test.js +333 -0
  91. package/build/cjs/usb/arm-debug.test.js.map +1 -0
  92. package/build/{esm → cjs/usb}/board-serial-info.d.ts +2 -1
  93. package/build/cjs/{board-serial-info.js → usb/board-serial-info.js} +10 -7
  94. package/build/cjs/usb/board-serial-info.js.map +1 -0
  95. package/build/cjs/{board-serial-info.test.js → usb/board-serial-info.test.js} +2 -4
  96. package/build/cjs/usb/board-serial-info.test.js.map +1 -0
  97. package/build/cjs/usb/cdc-saturation.d.ts +36 -0
  98. package/build/cjs/usb/cdc-saturation.js +151 -0
  99. package/build/cjs/usb/cdc-saturation.js.map +1 -0
  100. package/build/cjs/usb/cmsis-dap.d.ts +113 -0
  101. package/build/cjs/usb/cmsis-dap.js +349 -0
  102. package/build/cjs/usb/cmsis-dap.js.map +1 -0
  103. package/build/cjs/usb/cmsis-dap.test.js +350 -0
  104. package/build/cjs/usb/cmsis-dap.test.js.map +1 -0
  105. package/build/cjs/usb/connection.d.ts +81 -0
  106. package/build/cjs/{usb.js → usb/connection.js} +243 -166
  107. package/build/cjs/usb/connection.js.map +1 -0
  108. package/build/cjs/{usb.test.js → usb/connection.test.js} +52 -42
  109. package/build/cjs/usb/connection.test.js.map +1 -0
  110. package/build/cjs/usb/cortex-m.d.ts +72 -0
  111. package/build/cjs/usb/cortex-m.js +165 -0
  112. package/build/cjs/usb/cortex-m.js.map +1 -0
  113. package/build/cjs/usb/cortex-m.test.js +217 -0
  114. package/build/cjs/usb/cortex-m.test.js.map +1 -0
  115. package/build/cjs/usb/daplink.d.ts +69 -0
  116. package/build/cjs/usb/daplink.js +238 -0
  117. package/build/cjs/usb/daplink.js.map +1 -0
  118. package/build/cjs/usb/daplink.test.js +290 -0
  119. package/build/cjs/usb/daplink.test.js.map +1 -0
  120. package/build/cjs/usb/device-wrapper.d.ts +34 -0
  121. package/build/cjs/usb/device-wrapper.js +102 -0
  122. package/build/cjs/usb/device-wrapper.js.map +1 -0
  123. package/build/cjs/usb/index.d.ts +5 -0
  124. package/build/cjs/usb/index.js +10 -0
  125. package/build/cjs/usb/index.js.map +1 -0
  126. package/build/{esm/usb-partial-flashing-utils.d.ts → cjs/usb/partial-flashing-utils.d.ts} +6 -9
  127. package/build/cjs/{usb-partial-flashing-utils.js → usb/partial-flashing-utils.js} +6 -49
  128. package/build/cjs/usb/partial-flashing-utils.js.map +1 -0
  129. package/build/{esm/usb-partial-flashing.d.ts → cjs/usb/partial-flashing.d.ts} +15 -7
  130. package/build/cjs/{usb-partial-flashing.js → usb/partial-flashing.js} +64 -119
  131. package/build/cjs/usb/partial-flashing.js.map +1 -0
  132. package/build/cjs/usb/promise-queue.js.map +1 -0
  133. package/build/cjs/usb/promise-queue.test.js.map +1 -0
  134. package/build/cjs/usb/serial-events.d.ts +21 -0
  135. package/build/cjs/{led.js → usb/serial-events.js} +1 -1
  136. package/build/cjs/usb/serial-events.js.map +1 -0
  137. package/build/cjs/usb/transport.d.ts +42 -0
  138. package/build/cjs/usb/transport.js +155 -0
  139. package/build/cjs/usb/transport.js.map +1 -0
  140. package/build/{cjs/bluetooth.d.ts → esm/bluetooth/connection.d.ts} +30 -26
  141. package/build/esm/{bluetooth.js → bluetooth/connection.js} +141 -98
  142. package/build/esm/bluetooth/connection.js.map +1 -0
  143. package/build/esm/{bluetooth.test.js → bluetooth/connection.test.js} +9 -9
  144. package/build/esm/bluetooth/connection.test.js.map +1 -0
  145. package/build/esm/bluetooth/device-bond-state.js.map +1 -0
  146. package/build/esm/{bluetooth-device-wrapper.d.ts → bluetooth/device-wrapper.d.ts} +11 -11
  147. package/build/esm/{bluetooth-device-wrapper.js → bluetooth/device-wrapper.js} +32 -32
  148. package/build/esm/bluetooth/device-wrapper.js.map +1 -0
  149. package/build/esm/{flashing → bluetooth/flashing}/flashing-full.d.ts +2 -2
  150. package/build/esm/{flashing → bluetooth/flashing}/flashing-full.js +4 -4
  151. package/build/esm/bluetooth/flashing/flashing-full.js.map +1 -0
  152. package/build/esm/{flashing → bluetooth/flashing}/flashing-makecode.d.ts +1 -1
  153. package/build/esm/bluetooth/flashing/flashing-makecode.js.map +1 -0
  154. package/build/esm/{flashing → bluetooth/flashing}/flashing-makecode.test.js +2 -2
  155. package/build/esm/bluetooth/flashing/flashing-makecode.test.js.map +1 -0
  156. package/build/esm/{flashing → bluetooth/flashing}/flashing-partial.d.ts +2 -2
  157. package/build/esm/{flashing → bluetooth/flashing}/flashing-partial.js +4 -4
  158. package/build/esm/bluetooth/flashing/flashing-partial.js.map +1 -0
  159. package/build/esm/bluetooth/flashing/flashing-v1.js.map +1 -0
  160. package/build/esm/{flashing → bluetooth/flashing}/nordic-dfu.d.ts +2 -2
  161. package/build/esm/{flashing → bluetooth/flashing}/nordic-dfu.js +11 -8
  162. package/build/esm/bluetooth/flashing/nordic-dfu.js.map +1 -0
  163. package/build/esm/bluetooth/flashing/zip.js.map +1 -0
  164. package/build/esm/bluetooth/flashing/zip.test.d.ts +1 -0
  165. package/build/esm/bluetooth/flashing/zip.test.js.map +1 -0
  166. package/build/esm/bluetooth/index.d.ts +5 -0
  167. package/build/esm/bluetooth/index.js +5 -0
  168. package/build/esm/bluetooth/index.js.map +1 -0
  169. package/build/esm/{bluetooth-profile.js → bluetooth/profile.js} +1 -1
  170. package/build/{cjs/bluetooth-profile.js.map → esm/bluetooth/profile.js.map} +1 -1
  171. package/build/esm/{accelerometer-service.d.ts → bluetooth/services/accelerometer-service.d.ts} +2 -3
  172. package/build/esm/{accelerometer-service.js → bluetooth/services/accelerometer-service.js} +10 -6
  173. package/build/esm/bluetooth/services/accelerometer-service.js.map +1 -0
  174. package/build/{cjs → esm/bluetooth/services}/button-service.d.ts +2 -3
  175. package/build/esm/{button-service.js → bluetooth/services/button-service.js} +10 -9
  176. package/build/esm/bluetooth/services/button-service.js.map +1 -0
  177. package/build/{cjs → esm/bluetooth/services}/device-information-service.d.ts +1 -1
  178. package/build/esm/{device-information-service.js → bluetooth/services/device-information-service.js} +1 -1
  179. package/build/esm/bluetooth/services/device-information-service.js.map +1 -0
  180. package/build/esm/{dfu-service.js → bluetooth/services/dfu-service.js} +1 -1
  181. package/build/esm/bluetooth/services/dfu-service.js.map +1 -0
  182. package/build/{cjs → esm/bluetooth/services}/led-service.d.ts +2 -3
  183. package/build/esm/{led-service.js → bluetooth/services/led-service.js} +1 -1
  184. package/build/esm/bluetooth/services/led-service.js.map +1 -0
  185. package/build/esm/{magnetometer-service.d.ts → bluetooth/services/magnetometer-service.d.ts} +2 -3
  186. package/build/esm/{magnetometer-service.js → bluetooth/services/magnetometer-service.js} +10 -6
  187. package/build/esm/bluetooth/services/magnetometer-service.js.map +1 -0
  188. package/build/{cjs → esm/bluetooth/services}/partial-flashing-service.d.ts +1 -1
  189. package/build/esm/{partial-flashing-service.js → bluetooth/services/partial-flashing-service.js} +4 -4
  190. package/build/esm/bluetooth/services/partial-flashing-service.js.map +1 -0
  191. package/build/esm/{uart-service.d.ts → bluetooth/services/uart-service.d.ts} +2 -2
  192. package/build/esm/{uart-service.js → bluetooth/services/uart-service.js} +8 -5
  193. package/build/esm/bluetooth/services/uart-service.js.map +1 -0
  194. package/build/esm/board-id.d.ts +1 -1
  195. package/build/esm/board-id.js.map +1 -1
  196. package/build/esm/device.d.ts +82 -75
  197. package/build/esm/device.js +38 -120
  198. package/build/esm/device.js.map +1 -1
  199. package/build/esm/events.d.ts +9 -108
  200. package/build/esm/events.js +26 -86
  201. package/build/esm/events.js.map +1 -1
  202. package/build/esm/events.test.js +55 -49
  203. package/build/esm/events.test.js.map +1 -1
  204. package/build/esm/hex-util.d.ts +1 -0
  205. package/build/esm/hex-util.js +11 -0
  206. package/build/esm/hex-util.js.map +1 -0
  207. package/build/esm/index.d.ts +7 -16
  208. package/build/esm/index.js +6 -10
  209. package/build/esm/index.js.map +1 -1
  210. package/build/esm/radio-bridge/connection.d.ts +39 -0
  211. package/build/esm/{usb-radio-bridge.js → radio-bridge/connection.js} +39 -25
  212. package/build/esm/radio-bridge/connection.js.map +1 -0
  213. package/build/esm/radio-bridge/index.d.ts +4 -0
  214. package/build/esm/radio-bridge/index.js +5 -0
  215. package/build/esm/radio-bridge/index.js.map +1 -0
  216. package/build/esm/{usb-serial-protocol.js → radio-bridge/serial-protocol.js} +1 -1
  217. package/build/esm/radio-bridge/serial-protocol.js.map +1 -0
  218. package/build/esm/service-events.d.ts +42 -14
  219. package/build/esm/service-events.js +5 -34
  220. package/build/esm/service-events.js.map +1 -1
  221. package/build/{cjs/hex-flash-data-source.d.ts → esm/universal-hex/flash-data-source.d.ts} +1 -2
  222. package/build/esm/{hex-flash-data-source.js → universal-hex/flash-data-source.js} +6 -13
  223. package/build/esm/universal-hex/flash-data-source.js.map +1 -0
  224. package/build/esm/universal-hex/index.d.ts +4 -0
  225. package/build/esm/universal-hex/index.js +5 -0
  226. package/build/esm/universal-hex/index.js.map +1 -0
  227. package/build/esm/usb/arm-debug.d.ts +137 -0
  228. package/build/esm/usb/arm-debug.js +409 -0
  229. package/build/esm/usb/arm-debug.js.map +1 -0
  230. package/build/esm/usb/arm-debug.test.d.ts +1 -0
  231. package/build/esm/usb/arm-debug.test.js +331 -0
  232. package/build/esm/usb/arm-debug.test.js.map +1 -0
  233. package/build/{cjs → esm/usb}/board-serial-info.d.ts +2 -1
  234. package/build/esm/{board-serial-info.js → usb/board-serial-info.js} +10 -7
  235. package/build/esm/usb/board-serial-info.js.map +1 -0
  236. package/build/esm/usb/board-serial-info.test.d.ts +1 -0
  237. package/build/esm/{board-serial-info.test.js → usb/board-serial-info.test.js} +2 -4
  238. package/build/esm/usb/board-serial-info.test.js.map +1 -0
  239. package/build/esm/usb/cdc-saturation.d.ts +36 -0
  240. package/build/esm/usb/cdc-saturation.js +148 -0
  241. package/build/esm/usb/cdc-saturation.js.map +1 -0
  242. package/build/esm/usb/cmsis-dap.d.ts +113 -0
  243. package/build/esm/usb/cmsis-dap.js +342 -0
  244. package/build/esm/usb/cmsis-dap.js.map +1 -0
  245. package/build/esm/usb/cmsis-dap.test.d.ts +1 -0
  246. package/build/esm/usb/cmsis-dap.test.js +348 -0
  247. package/build/esm/usb/cmsis-dap.test.js.map +1 -0
  248. package/build/esm/usb/connection.d.ts +81 -0
  249. package/build/esm/{usb.js → usb/connection.js} +239 -161
  250. package/build/esm/usb/connection.js.map +1 -0
  251. package/build/esm/usb/connection.test.d.ts +1 -0
  252. package/build/esm/{usb.test.js → usb/connection.test.js} +47 -37
  253. package/build/esm/usb/connection.test.js.map +1 -0
  254. package/build/esm/usb/cortex-m.d.ts +72 -0
  255. package/build/esm/usb/cortex-m.js +161 -0
  256. package/build/esm/usb/cortex-m.js.map +1 -0
  257. package/build/esm/usb/cortex-m.test.d.ts +1 -0
  258. package/build/esm/usb/cortex-m.test.js +215 -0
  259. package/build/esm/usb/cortex-m.test.js.map +1 -0
  260. package/build/esm/usb/daplink.d.ts +69 -0
  261. package/build/esm/usb/daplink.js +231 -0
  262. package/build/esm/usb/daplink.js.map +1 -0
  263. package/build/esm/usb/daplink.test.d.ts +1 -0
  264. package/build/esm/usb/daplink.test.js +288 -0
  265. package/build/esm/usb/daplink.test.js.map +1 -0
  266. package/build/esm/usb/device-wrapper.d.ts +34 -0
  267. package/build/esm/usb/device-wrapper.js +98 -0
  268. package/build/esm/usb/device-wrapper.js.map +1 -0
  269. package/build/esm/usb/index.d.ts +5 -0
  270. package/build/esm/usb/index.js +5 -0
  271. package/build/esm/usb/index.js.map +1 -0
  272. package/build/{cjs/usb-partial-flashing-utils.d.ts → esm/usb/partial-flashing-utils.d.ts} +6 -9
  273. package/build/esm/{usb-partial-flashing-utils.js → usb/partial-flashing-utils.js} +4 -44
  274. package/build/esm/usb/partial-flashing-utils.js.map +1 -0
  275. package/build/{cjs/usb-partial-flashing.d.ts → esm/usb/partial-flashing.d.ts} +15 -7
  276. package/build/esm/{usb-partial-flashing.js → usb/partial-flashing.js} +62 -94
  277. package/build/esm/usb/partial-flashing.js.map +1 -0
  278. package/build/esm/usb/promise-queue.js.map +1 -0
  279. package/build/esm/usb/promise-queue.test.d.ts +1 -0
  280. package/build/esm/usb/promise-queue.test.js.map +1 -0
  281. package/build/esm/usb/serial-events.d.ts +21 -0
  282. package/build/esm/usb/serial-events.js +2 -0
  283. package/build/esm/usb/serial-events.js.map +1 -0
  284. package/build/esm/usb/transport.d.ts +42 -0
  285. package/build/esm/usb/transport.js +151 -0
  286. package/build/esm/usb/transport.js.map +1 -0
  287. package/package.json +43 -2
  288. package/build/cjs/accelerometer-service.js.map +0 -1
  289. package/build/cjs/accelerometer.d.ts +0 -9
  290. package/build/cjs/accelerometer.js +0 -16
  291. package/build/cjs/accelerometer.js.map +0 -1
  292. package/build/cjs/bluetooth-device-wrapper.js.map +0 -1
  293. package/build/cjs/bluetooth.js.map +0 -1
  294. package/build/cjs/bluetooth.test.js.map +0 -1
  295. package/build/cjs/board-serial-info.js.map +0 -1
  296. package/build/cjs/board-serial-info.test.js.map +0 -1
  297. package/build/cjs/button-service.js.map +0 -1
  298. package/build/cjs/buttons.d.ts +0 -10
  299. package/build/cjs/buttons.js +0 -22
  300. package/build/cjs/buttons.js.map +0 -1
  301. package/build/cjs/constants.d.ts +0 -48
  302. package/build/cjs/constants.js +0 -73
  303. package/build/cjs/constants.js.map +0 -1
  304. package/build/cjs/device-bond-state.js.map +0 -1
  305. package/build/cjs/device-information-service.js.map +0 -1
  306. package/build/cjs/dfu-service.js.map +0 -1
  307. package/build/cjs/flashing/flashing-full.js.map +0 -1
  308. package/build/cjs/flashing/flashing-makecode.js.map +0 -1
  309. package/build/cjs/flashing/flashing-makecode.test.js.map +0 -1
  310. package/build/cjs/flashing/flashing-partial.js.map +0 -1
  311. package/build/cjs/flashing/flashing-v1.js.map +0 -1
  312. package/build/cjs/flashing/nordic-dfu.js.map +0 -1
  313. package/build/cjs/flashing/zip.js.map +0 -1
  314. package/build/cjs/flashing/zip.test.js.map +0 -1
  315. package/build/cjs/hex-flash-data-source.js.map +0 -1
  316. package/build/cjs/led-service.js.map +0 -1
  317. package/build/cjs/led.d.ts +0 -6
  318. package/build/cjs/led.js.map +0 -1
  319. package/build/cjs/magnetometer-service.js.map +0 -1
  320. package/build/cjs/magnetometer.d.ts +0 -9
  321. package/build/cjs/magnetometer.js +0 -16
  322. package/build/cjs/magnetometer.js.map +0 -1
  323. package/build/cjs/partial-flashing-service.js.map +0 -1
  324. package/build/cjs/promise-queue.js.map +0 -1
  325. package/build/cjs/promise-queue.test.js.map +0 -1
  326. package/build/cjs/serial-events.d.ts +0 -20
  327. package/build/cjs/serial-events.js +0 -69
  328. package/build/cjs/serial-events.js.map +0 -1
  329. package/build/cjs/uart-service.js.map +0 -1
  330. package/build/cjs/uart.d.ts +0 -4
  331. package/build/cjs/uart.js +0 -16
  332. package/build/cjs/uart.js.map +0 -1
  333. package/build/cjs/usb-device-wrapper.d.ts +0 -47
  334. package/build/cjs/usb-device-wrapper.js +0 -437
  335. package/build/cjs/usb-device-wrapper.js.map +0 -1
  336. package/build/cjs/usb-partial-flashing-utils.js.map +0 -1
  337. package/build/cjs/usb-partial-flashing.js.map +0 -1
  338. package/build/cjs/usb-radio-bridge.d.ts +0 -24
  339. package/build/cjs/usb-radio-bridge.js.map +0 -1
  340. package/build/cjs/usb-serial-protocol.js.map +0 -1
  341. package/build/cjs/usb.d.ts +0 -66
  342. package/build/cjs/usb.js.map +0 -1
  343. package/build/cjs/usb.test.js.map +0 -1
  344. package/build/esm/accelerometer-service.js.map +0 -1
  345. package/build/esm/accelerometer.d.ts +0 -9
  346. package/build/esm/accelerometer.js +0 -12
  347. package/build/esm/accelerometer.js.map +0 -1
  348. package/build/esm/bluetooth-device-wrapper.js.map +0 -1
  349. package/build/esm/bluetooth-profile.js.map +0 -1
  350. package/build/esm/bluetooth.js.map +0 -1
  351. package/build/esm/bluetooth.test.js.map +0 -1
  352. package/build/esm/board-serial-info.js.map +0 -1
  353. package/build/esm/board-serial-info.test.js.map +0 -1
  354. package/build/esm/button-service.js.map +0 -1
  355. package/build/esm/buttons.d.ts +0 -10
  356. package/build/esm/buttons.js +0 -18
  357. package/build/esm/buttons.js.map +0 -1
  358. package/build/esm/constants.d.ts +0 -48
  359. package/build/esm/constants.js +0 -70
  360. package/build/esm/constants.js.map +0 -1
  361. package/build/esm/device-bond-state.js.map +0 -1
  362. package/build/esm/device-information-service.js.map +0 -1
  363. package/build/esm/dfu-service.js.map +0 -1
  364. package/build/esm/flashing/flashing-full.js.map +0 -1
  365. package/build/esm/flashing/flashing-makecode.js.map +0 -1
  366. package/build/esm/flashing/flashing-makecode.test.js.map +0 -1
  367. package/build/esm/flashing/flashing-partial.js.map +0 -1
  368. package/build/esm/flashing/flashing-v1.js.map +0 -1
  369. package/build/esm/flashing/nordic-dfu.js.map +0 -1
  370. package/build/esm/flashing/zip.js.map +0 -1
  371. package/build/esm/flashing/zip.test.js.map +0 -1
  372. package/build/esm/hex-flash-data-source.js.map +0 -1
  373. package/build/esm/led-service.js.map +0 -1
  374. package/build/esm/led.d.ts +0 -6
  375. package/build/esm/led.js +0 -2
  376. package/build/esm/led.js.map +0 -1
  377. package/build/esm/magnetometer-service.js.map +0 -1
  378. package/build/esm/magnetometer.d.ts +0 -9
  379. package/build/esm/magnetometer.js +0 -12
  380. package/build/esm/magnetometer.js.map +0 -1
  381. package/build/esm/partial-flashing-service.js.map +0 -1
  382. package/build/esm/promise-queue.js.map +0 -1
  383. package/build/esm/promise-queue.test.js.map +0 -1
  384. package/build/esm/serial-events.d.ts +0 -20
  385. package/build/esm/serial-events.js +0 -61
  386. package/build/esm/serial-events.js.map +0 -1
  387. package/build/esm/uart-service.js.map +0 -1
  388. package/build/esm/uart.d.ts +0 -4
  389. package/build/esm/uart.js +0 -12
  390. package/build/esm/uart.js.map +0 -1
  391. package/build/esm/usb-device-wrapper.d.ts +0 -47
  392. package/build/esm/usb-device-wrapper.js +0 -410
  393. package/build/esm/usb-device-wrapper.js.map +0 -1
  394. package/build/esm/usb-partial-flashing-utils.js.map +0 -1
  395. package/build/esm/usb-partial-flashing.js.map +0 -1
  396. package/build/esm/usb-radio-bridge.d.ts +0 -24
  397. package/build/esm/usb-radio-bridge.js.map +0 -1
  398. package/build/esm/usb-serial-protocol.js.map +0 -1
  399. package/build/esm/usb.d.ts +0 -66
  400. package/build/esm/usb.js.map +0 -1
  401. package/build/esm/usb.test.js.map +0 -1
  402. /package/build/cjs/{bluetooth.test.d.ts → bluetooth/connection.test.d.ts} +0 -0
  403. /package/build/cjs/{device-bond-state.d.ts → bluetooth/device-bond-state.d.ts} +0 -0
  404. /package/build/cjs/{device-bond-state.js → bluetooth/device-bond-state.js} +0 -0
  405. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-makecode.js +0 -0
  406. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-makecode.test.d.ts +0 -0
  407. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-v1.d.ts +0 -0
  408. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-v1.js +0 -0
  409. /package/build/cjs/{flashing → bluetooth/flashing}/zip.d.ts +0 -0
  410. /package/build/cjs/{flashing → bluetooth/flashing}/zip.js +0 -0
  411. /package/build/cjs/{flashing → bluetooth/flashing}/zip.test.d.ts +0 -0
  412. /package/build/cjs/{flashing → bluetooth/flashing}/zip.test.js +0 -0
  413. /package/build/cjs/{bluetooth-profile.d.ts → bluetooth/profile.d.ts} +0 -0
  414. /package/build/cjs/{dfu-service.d.ts → bluetooth/services/dfu-service.d.ts} +0 -0
  415. /package/build/cjs/{usb-serial-protocol.d.ts → radio-bridge/serial-protocol.d.ts} +0 -0
  416. /package/build/cjs/{board-serial-info.test.d.ts → usb/arm-debug.test.d.ts} +0 -0
  417. /package/build/{esm → cjs/usb}/board-serial-info.test.d.ts +0 -0
  418. /package/build/cjs/{promise-queue.test.d.ts → usb/cmsis-dap.test.d.ts} +0 -0
  419. /package/build/cjs/{usb.test.d.ts → usb/connection.test.d.ts} +0 -0
  420. /package/build/{esm/bluetooth.test.d.ts → cjs/usb/cortex-m.test.d.ts} +0 -0
  421. /package/build/{esm/flashing/flashing-makecode.test.d.ts → cjs/usb/daplink.test.d.ts} +0 -0
  422. /package/build/cjs/{promise-queue.d.ts → usb/promise-queue.d.ts} +0 -0
  423. /package/build/cjs/{promise-queue.js → usb/promise-queue.js} +0 -0
  424. /package/build/{esm → cjs/usb}/promise-queue.test.d.ts +0 -0
  425. /package/build/cjs/{promise-queue.test.js → usb/promise-queue.test.js} +0 -0
  426. /package/build/esm/{flashing/zip.test.d.ts → bluetooth/connection.test.d.ts} +0 -0
  427. /package/build/esm/{device-bond-state.d.ts → bluetooth/device-bond-state.d.ts} +0 -0
  428. /package/build/esm/{device-bond-state.js → bluetooth/device-bond-state.js} +0 -0
  429. /package/build/esm/{flashing → bluetooth/flashing}/flashing-makecode.js +0 -0
  430. /package/build/esm/{usb.test.d.ts → bluetooth/flashing/flashing-makecode.test.d.ts} +0 -0
  431. /package/build/esm/{flashing → bluetooth/flashing}/flashing-v1.d.ts +0 -0
  432. /package/build/esm/{flashing → bluetooth/flashing}/flashing-v1.js +0 -0
  433. /package/build/esm/{flashing → bluetooth/flashing}/zip.d.ts +0 -0
  434. /package/build/esm/{flashing → bluetooth/flashing}/zip.js +0 -0
  435. /package/build/esm/{flashing → bluetooth/flashing}/zip.test.js +0 -0
  436. /package/build/esm/{bluetooth-profile.d.ts → bluetooth/profile.d.ts} +0 -0
  437. /package/build/esm/{dfu-service.d.ts → bluetooth/services/dfu-service.d.ts} +0 -0
  438. /package/build/esm/{usb-serial-protocol.d.ts → radio-bridge/serial-protocol.d.ts} +0 -0
  439. /package/build/esm/{promise-queue.d.ts → usb/promise-queue.d.ts} +0 -0
  440. /package/build/esm/{promise-queue.js → usb/promise-queue.js} +0 -0
  441. /package/build/esm/{promise-queue.test.js → usb/promise-queue.test.js} +0 -0
@@ -1,15 +1,12 @@
1
- import { AccelerometerData } from "./accelerometer.js";
2
- import { DeviceConnection, FlashDataSource, FlashOptions } from "./device.js";
3
- import { LedMatrix } from "./led.js";
4
- import { Logging } from "./logging.js";
5
- import { MagnetometerData } from "./magnetometer.js";
6
- import { ServiceConnectionEventMap } from "./service-events.js";
1
+ import { DeviceConnection, FlashDataSource, FlashOptions } from "../device.js";
2
+ import { Logging } from "../logging.js";
3
+ import { AccelerometerData, LedMatrix, MagnetometerData, ServiceConnectionEventMap } from "../service-events.js";
7
4
  import { DeviceBondState } from "./device-bond-state.js";
8
- export interface MicrobitWebBluetoothConnectionOptions {
5
+ export interface MicrobitBluetoothConnectionOptions {
9
6
  logging?: Logging;
10
7
  deviceBondState?: DeviceBondState;
11
8
  }
12
- export interface MicrobitWebBluetoothConnection extends DeviceConnection<ServiceConnectionEventMap> {
9
+ export interface MicrobitBluetoothConnection extends DeviceConnection<ServiceConnectionEventMap> {
13
10
  /**
14
11
  * Sets micro:bit name filter for device requesting.
15
12
  *
@@ -19,96 +16,103 @@ export interface MicrobitWebBluetoothConnection extends DeviceConnection<Service
19
16
  /**
20
17
  * Gets micro:bit accelerometer data.
21
18
  *
22
- * @returns accelerometer data or undefined if there is no connection.
19
+ * @returns accelerometer data.
20
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
23
21
  */
24
- getAccelerometerData(): Promise<AccelerometerData | undefined>;
22
+ getAccelerometerData(): Promise<AccelerometerData>;
25
23
  /**
26
24
  * Gets micro:bit accelerometer period.
27
25
  *
28
- * @returns accelerometer period or undefined if there is no connection.
26
+ * @returns accelerometer period.
27
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
29
28
  */
30
- getAccelerometerPeriod(): Promise<number | undefined>;
29
+ getAccelerometerPeriod(): Promise<number>;
31
30
  /**
32
31
  * Sets micro:bit accelerometer period.
33
32
  *
34
33
  * @param value The accelerometer period.
34
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
35
35
  */
36
36
  setAccelerometerPeriod(value: number): Promise<void>;
37
37
  /**
38
38
  * Sets micro:bit LED text.
39
39
  *
40
40
  * @param text The text displayed on micro:bit LED.
41
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
41
42
  */
42
43
  setLedText(text: string): Promise<void>;
43
44
  /**
44
45
  * Gets micro:bit LED scrolling delay.
45
46
  *
46
47
  * @returns LED scrolling delay in milliseconds.
48
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
47
49
  */
48
- getLedScrollingDelay(): Promise<number | undefined>;
50
+ getLedScrollingDelay(): Promise<number>;
49
51
  /**
50
52
  * Sets micro:bit LED scrolling delay.
51
53
  *
52
54
  * @param delayInMillis LED scrolling delay in milliseconds.
55
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
53
56
  */
54
57
  setLedScrollingDelay(delayInMillis: number): Promise<void>;
55
58
  /**
56
59
  * Gets micro:bit LED matrix.
57
60
  *
58
61
  * @returns a boolean matrix representing the micro:bit LED display.
62
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
59
63
  */
60
- getLedMatrix(): Promise<LedMatrix | undefined>;
64
+ getLedMatrix(): Promise<LedMatrix>;
61
65
  /**
62
66
  * Sets micro:bit LED matrix.
63
67
  *
64
68
  * @param matrix an boolean matrix representing the micro:bit LED display.
69
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
65
70
  */
66
71
  setLedMatrix(matrix: LedMatrix): Promise<void>;
67
72
  /**
68
73
  * Gets micro:bit magnetometer data.
69
74
  *
70
75
  * @returns magnetometer data.
76
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
71
77
  */
72
- getMagnetometerData(): Promise<MagnetometerData | undefined>;
78
+ getMagnetometerData(): Promise<MagnetometerData>;
73
79
  /**
74
80
  * Gets micro:bit magnetometer bearing.
75
81
  *
76
82
  * @returns magnetometer bearing.
83
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
77
84
  */
78
- getMagnetometerBearing(): Promise<number | undefined>;
85
+ getMagnetometerBearing(): Promise<number>;
79
86
  /**
80
87
  * Gets micro:bit magnetometer period.
81
88
  *
82
89
  * @returns magnetometer period.
90
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
83
91
  */
84
- getMagnetometerPeriod(): Promise<number | undefined>;
92
+ getMagnetometerPeriod(): Promise<number>;
85
93
  /**
86
94
  * Sets micro:bit magnetometer period.
87
95
  *
88
96
  * @param value magnetometer period.
97
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
89
98
  */
90
99
  setMagnetometerPeriod(value: number): Promise<void>;
91
100
  /**
92
101
  * Triggers micro:bit magnetometer calibration.
102
+ *
103
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
93
104
  */
94
105
  triggerMagnetometerCalibration(): Promise<void>;
95
106
  /**
96
107
  * Write UART messages.
97
108
  *
98
109
  * @param data UART message.
110
+ * @throws {DeviceError} with code `not-connected` if there is no connection.
99
111
  */
100
112
  uartWrite(data: Uint8Array): Promise<void>;
101
- /**
102
- * Flash the micro:bit.
103
- *
104
- * @param dataSource The data to use.
105
- * @param options Flash options and progress callback.
106
- * @throws {DeviceError} On flash failure. The error.code property indicates the failure type.
107
- * @throws {FlashDataError} If data preparation fails.
108
- */
109
113
  flash(dataSource: FlashDataSource, options: FlashOptions): Promise<void>;
110
114
  }
111
115
  /**
112
116
  * A Bluetooth connection factory.
113
117
  */
114
- export declare const createWebBluetoothConnection: (options?: MicrobitWebBluetoothConnectionOptions) => MicrobitWebBluetoothConnection;
118
+ export declare const createBluetoothConnection: (options?: MicrobitBluetoothConnectionOptions) => MicrobitBluetoothConnection;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.createWebBluetoothConnection = void 0;
29
+ exports.createBluetoothConnection = void 0;
30
30
  /**
31
31
  * (c) 2021, Micro:bit Educational Foundation and contributors
32
32
  *
@@ -35,40 +35,40 @@ exports.createWebBluetoothConnection = void 0;
35
35
  const bluetooth_le_1 = require("@capacitor-community/bluetooth-le");
36
36
  const core_1 = require("@capacitor/core");
37
37
  const nrf_intel_hex_1 = __importDefault(require("nrf-intel-hex"));
38
- const bluetooth_device_wrapper_js_1 = require("./bluetooth-device-wrapper.js");
39
- const bluetooth_profile_js_1 = require("./bluetooth-profile.js");
40
- const device_js_1 = require("./device.js");
41
- const events_js_1 = require("./events.js");
42
- const logging_js_1 = require("./logging.js");
38
+ const device_wrapper_js_1 = require("./device-wrapper.js");
39
+ const profile_js_1 = require("./profile.js");
40
+ const device_js_1 = require("../device.js");
41
+ const events_js_1 = require("../events.js");
42
+ const logging_js_1 = require("../logging.js");
43
43
  const flashing_full_js_1 = require("./flashing/flashing-full.js");
44
44
  const flashing_partial_js_1 = __importStar(require("./flashing/flashing-partial.js"));
45
- const availability_js_1 = require("./availability.js");
46
- const hex_flash_data_source_js_1 = require("./hex-flash-data-source.js");
45
+ const availability_js_1 = require("../availability.js");
46
+ const hex_util_js_1 = require("../hex-util.js");
47
47
  const device_bond_state_js_1 = require("./device-bond-state.js");
48
- const async_util_js_1 = require("./async-util.js");
48
+ const async_util_js_1 = require("../async-util.js");
49
49
  let bleClientInitialized = false;
50
50
  /**
51
51
  * A Bluetooth connection factory.
52
52
  */
53
- const createWebBluetoothConnection = (options) => new MicrobitWebBluetoothConnectionImpl(options);
54
- exports.createWebBluetoothConnection = createWebBluetoothConnection;
53
+ const createBluetoothConnection = (options) => new MicrobitBluetoothConnectionImpl(options);
54
+ exports.createBluetoothConnection = createBluetoothConnection;
55
55
  /**
56
56
  * A Bluetooth connection to a micro:bit device.
57
57
  */
58
- class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
58
+ class MicrobitBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
59
59
  constructor(options = {}) {
60
60
  super();
61
61
  Object.defineProperty(this, "status", {
62
62
  enumerable: true,
63
63
  configurable: true,
64
64
  writable: true,
65
- value: device_js_1.ConnectionStatus.NO_AUTHORIZED_DEVICE
65
+ value: device_js_1.ConnectionStatus.NoAuthorizedDevice
66
66
  });
67
67
  /**
68
- * The USB device we last connected to.
68
+ * The BLE device we last connected to.
69
69
  * Cleared if it is disconnected.
70
70
  */
71
- Object.defineProperty(this, "device", {
71
+ Object.defineProperty(this, "bleDevice", {
72
72
  enumerable: true,
73
73
  configurable: true,
74
74
  writable: true,
@@ -86,7 +86,19 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
86
86
  writable: true,
87
87
  value: void 0
88
88
  });
89
- Object.defineProperty(this, "connection", {
89
+ /**
90
+ * Device-specific state. Created on connect, cleared on disconnect.
91
+ */
92
+ Object.defineProperty(this, "device", {
93
+ enumerable: true,
94
+ configurable: true,
95
+ writable: true,
96
+ value: void 0
97
+ });
98
+ /**
99
+ * Cached device property that persists across reconnections until clearDevice.
100
+ */
101
+ Object.defineProperty(this, "cachedBoardVersion", {
90
102
  enumerable: true,
91
103
  configurable: true,
92
104
  writable: true,
@@ -115,10 +127,10 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
115
127
  options.deviceBondState || new device_bond_state_js_1.DefaultDeviceBondState();
116
128
  }
117
129
  eventActivated(type) {
118
- this.connection?.startNotifications(type);
130
+ this.device?.startNotifications(type);
119
131
  }
120
132
  eventDeactivated(type) {
121
- this.connection?.stopNotifications(type);
133
+ this.device?.stopNotifications(type);
122
134
  }
123
135
  log(v) {
124
136
  this.logging.log(v);
@@ -151,7 +163,7 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
151
163
  // On Android, check if location services are enabled. This is only
152
164
  // required on Android < 12 (API < 31), but isLocationEnabled() returns
153
165
  // true on newer Android, so we can always check it.
154
- if ((0, bluetooth_device_wrapper_js_1.isAndroid)()) {
166
+ if ((0, device_wrapper_js_1.isAndroid)()) {
155
167
  const isLocationEnabled = await bluetooth_le_1.BleClient.isLocationEnabled();
156
168
  if (!isLocationEnabled) {
157
169
  return "location-disabled";
@@ -186,7 +198,8 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
186
198
  }
187
199
  }
188
200
  getBoardVersion() {
189
- return this.connection?.boardVersion;
201
+ (0, device_js_1.assertConnected)(this.cachedBoardVersion);
202
+ return this.cachedBoardVersion;
190
203
  }
191
204
  async connect(options) {
192
205
  const progress = options?.progress ?? (() => { });
@@ -198,21 +211,22 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
198
211
  // disconnect before attempting to connect.
199
212
  this.waitForPostFlashDisconnectPromise &&
200
213
  (await this.waitForPostFlashDisconnectPromise);
201
- if (!this.device || !this.connection) {
214
+ if (!this.bleDevice || !this.device) {
202
215
  progress(device_js_1.ProgressStage.FindingDevice);
203
216
  const device = await this.requestDevice(options?.signal);
204
- this.connection = new bluetooth_device_wrapper_js_1.BluetoothDeviceWrapper(device, this.logging, this.deviceBondState, this.dispatchTypedEvent.bind(this), () => this.getActiveEvents(), {
205
- onConnecting: () => this.setStatus(device_js_1.ConnectionStatus.CONNECTING),
206
- onSuccess: () => this.setStatus(device_js_1.ConnectionStatus.CONNECTED),
207
- onDisconnect: () => this.setStatus(device_js_1.ConnectionStatus.DISCONNECTED),
217
+ this.device = new device_wrapper_js_1.BluetoothDeviceWrapper(device, this.logging, this.deviceBondState, this.dispatchEvent.bind(this), () => this.getActiveEvents(), {
218
+ onConnecting: () => this.setStatus(device_js_1.ConnectionStatus.Connecting),
219
+ onSuccess: () => this.setStatus(device_js_1.ConnectionStatus.Connected),
220
+ onDisconnect: () => this.setStatus(device_js_1.ConnectionStatus.Disconnected),
208
221
  });
209
222
  }
210
- await this.connection.connect(options);
223
+ await this.device.connect(options);
224
+ this.cachedBoardVersion = this.device.boardVersion;
211
225
  }
212
226
  async disconnect() {
213
227
  try {
214
- if (this.connection) {
215
- await this.connection.disconnect();
228
+ if (this.device) {
229
+ await this.device.disconnect();
216
230
  }
217
231
  }
218
232
  catch (e) {
@@ -222,7 +236,7 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
222
236
  });
223
237
  }
224
238
  finally {
225
- this.setStatus(device_js_1.ConnectionStatus.DISCONNECTED);
239
+ this.setStatus(device_js_1.ConnectionStatus.Disconnected);
226
240
  this.logging.event({
227
241
  type: "Bluetooth-info",
228
242
  message: "disconnected",
@@ -234,105 +248,118 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
234
248
  this.status = newStatus;
235
249
  this.log("Bluetooth connection status " + newStatus);
236
250
  if (this.deferredUpdatesPreviousStatus === undefined) {
237
- this.dispatchTypedEvent("status", new device_js_1.ConnectionStatusEvent(newStatus, previousStatus));
238
- }
239
- }
240
- serialWrite(data) {
241
- if (this.connection) {
242
- // TODO
251
+ this.dispatchEvent("status", {
252
+ status: newStatus,
253
+ previousStatus,
254
+ });
243
255
  }
244
- return Promise.resolve();
245
256
  }
246
257
  async clearDevice() {
247
258
  await this.disconnect();
248
- this.device = undefined;
249
- this.setStatus(device_js_1.ConnectionStatus.NO_AUTHORIZED_DEVICE);
259
+ this.bleDevice = undefined;
260
+ this.cachedBoardVersion = undefined;
261
+ this.setStatus(device_js_1.ConnectionStatus.NoAuthorizedDevice);
250
262
  }
251
263
  setNameFilter(name) {
252
264
  this.nameFilter = name;
253
265
  }
254
266
  async requestDevice(signal) {
255
- // TODO: is this possible to reinstate?
267
+ // Support both the default "BBC micro:bit" name and the shorter "uBit"
268
+ // name used by some MakeCode extensions (e.g. bsiever/microbit-pxt-blehid).
256
269
  // See https://github.com/bsiever/microbit-pxt-blehid/issues/31
257
- // namePrefix: this.nameFilter
258
- // ? `uBit [${this.nameFilter}]`
259
- // : "uBit",
260
- const namePrefix = this.nameFilter
261
- ? `BBC micro:bit [${this.nameFilter}]`
262
- : "BBC micro:bit";
270
+ const namePrefixes = this.nameFilter
271
+ ? [`BBC micro:bit [${this.nameFilter}]`, `uBit [${this.nameFilter}]`]
272
+ : ["BBC micro:bit", "uBit"];
263
273
  // If we have a cached device, check if it still matches the current filter.
264
274
  // If not, clear it so we find a new device.
265
- if (this.device) {
266
- if (this.device.name?.startsWith(namePrefix)) {
267
- return this.device;
275
+ if (this.bleDevice) {
276
+ if (namePrefixes.some((p) => this.bleDevice.name?.startsWith(p))) {
277
+ return this.bleDevice;
268
278
  }
269
- this.log(`Cached device "${this.device.name}" doesn't match filter "${namePrefix}", clearing`);
279
+ this.log(`Cached device "${this.bleDevice.name}" doesn't match filters "${namePrefixes.join(", ")}", clearing`);
270
280
  await this.clearDevice();
271
281
  }
272
- this.dispatchTypedEvent("beforerequestdevice", new device_js_1.BeforeRequestDevice());
282
+ this.dispatchEvent("beforerequestdevice");
273
283
  try {
274
- this.device = core_1.Capacitor.isNativePlatform()
275
- ? await this.requestDeviceNative(namePrefix, signal)
276
- : await this.requestDeviceWeb(namePrefix);
277
- if (!this.device) {
278
- this.setStatus(device_js_1.ConnectionStatus.NO_AUTHORIZED_DEVICE);
284
+ this.bleDevice = core_1.Capacitor.isNativePlatform()
285
+ ? await this.requestDeviceNative(namePrefixes, signal)
286
+ : await this.requestDeviceWeb(namePrefixes);
287
+ if (!this.bleDevice) {
288
+ this.setStatus(device_js_1.ConnectionStatus.NoAuthorizedDevice);
279
289
  throw new device_js_1.DeviceError({
280
290
  code: "no-device-selected",
281
291
  message: "No device selected",
282
292
  });
283
293
  }
284
- return this.device;
294
+ return this.bleDevice;
285
295
  }
286
296
  finally {
287
- this.dispatchTypedEvent("afterrequestdevice", new device_js_1.AfterRequestDevice());
297
+ this.dispatchEvent("afterrequestdevice");
288
298
  }
289
299
  }
290
300
  async getAccelerometerData() {
291
- return this.connection?.accelerometer.getData();
301
+ (0, device_js_1.assertConnected)(this.device);
302
+ return this.device.accelerometer.getData();
292
303
  }
293
304
  async getAccelerometerPeriod() {
294
- return this.connection?.accelerometer.getPeriod();
305
+ (0, device_js_1.assertConnected)(this.device);
306
+ return this.device.accelerometer.getPeriod();
295
307
  }
296
308
  async setAccelerometerPeriod(value) {
297
- return this.connection?.accelerometer.setPeriod(value);
309
+ (0, device_js_1.assertConnected)(this.device);
310
+ return this.device.accelerometer.setPeriod(value);
298
311
  }
299
312
  async setLedText(text) {
300
- return this.connection?.led.setText(text);
313
+ (0, device_js_1.assertConnected)(this.device);
314
+ return this.device.led.setText(text);
301
315
  }
302
316
  async getLedScrollingDelay() {
303
- return this.connection?.led.getScrollingDelay();
317
+ (0, device_js_1.assertConnected)(this.device);
318
+ return this.device.led.getScrollingDelay();
304
319
  }
305
320
  async setLedScrollingDelay(delayInMillis) {
306
- await this.connection?.led.setScrollingDelay(delayInMillis);
321
+ (0, device_js_1.assertConnected)(this.device);
322
+ await this.device.led.setScrollingDelay(delayInMillis);
307
323
  }
308
324
  async getLedMatrix() {
309
- return await this.connection?.led.getLedMatrix();
325
+ (0, device_js_1.assertConnected)(this.device);
326
+ return await this.device.led.getLedMatrix();
310
327
  }
311
328
  async setLedMatrix(matrix) {
312
- await this.connection?.led.setLedMatrix(matrix);
329
+ (0, device_js_1.assertConnected)(this.device);
330
+ await this.device.led.setLedMatrix(matrix);
313
331
  }
314
332
  async getMagnetometerData() {
315
- return this.connection?.magnetometer.getData();
333
+ (0, device_js_1.assertConnected)(this.device);
334
+ return this.device.magnetometer.getData();
316
335
  }
317
336
  async getMagnetometerPeriod() {
318
- return this.connection?.magnetometer.getPeriod();
337
+ (0, device_js_1.assertConnected)(this.device);
338
+ return this.device.magnetometer.getPeriod();
319
339
  }
320
340
  async setMagnetometerPeriod(value) {
321
- return this.connection?.magnetometer.setPeriod(value);
341
+ (0, device_js_1.assertConnected)(this.device);
342
+ return this.device.magnetometer.setPeriod(value);
322
343
  }
323
344
  async getMagnetometerBearing() {
324
- return this.connection?.magnetometer.getBearing();
345
+ (0, device_js_1.assertConnected)(this.device);
346
+ return this.device.magnetometer.getBearing();
325
347
  }
326
348
  async triggerMagnetometerCalibration() {
327
- await this.connection?.magnetometer.triggerCalibration();
349
+ (0, device_js_1.assertConnected)(this.device);
350
+ await this.device.magnetometer.triggerCalibration();
328
351
  }
329
352
  async uartWrite(data) {
330
- await this.connection?.uart.writeData(data);
353
+ (0, device_js_1.assertConnected)(this.device);
354
+ await this.device.uart.writeData(data);
331
355
  }
332
356
  /**
333
357
  * Flash the micro:bit.
334
358
  *
335
- * Note that this will always leave the connection disconnected.
359
+ * Always leaves the connection in {@link ConnectionStatus.Disconnected} state.
360
+ * Bluetooth connects directly to the application processor, which reboots
361
+ * after flashing, so the connection is necessarily lost. Call {@link connect}
362
+ * again after flashing to reconnect.
336
363
  *
337
364
  * @param dataSource The data to use.
338
365
  * @param options Flash options and progress callback.
@@ -342,10 +369,10 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
342
369
  try {
343
370
  // We'll disconnect/reconnect multiple times due to device resets, but reporting this is unhelpful.
344
371
  this.deferredUpdatesPreviousStatus = this.status;
345
- if (this.status !== device_js_1.ConnectionStatus.CONNECTED) {
372
+ if (this.status !== device_js_1.ConnectionStatus.Connected) {
346
373
  await this.connect({ progress, signal: options.signal });
347
374
  }
348
- const connection = this.connection;
375
+ const connection = this.device;
349
376
  try {
350
377
  const boardVersion = connection.boardVersion;
351
378
  if (!boardVersion) {
@@ -358,7 +385,7 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
358
385
  if (!memoryMap) {
359
386
  throw new device_js_1.FlashDataError("Could not convert hex to memory map");
360
387
  }
361
- if (!this.device) {
388
+ if (!this.bleDevice) {
362
389
  throw new device_js_1.DeviceError({
363
390
  code: "device-disconnected",
364
391
  message: "No device",
@@ -369,7 +396,8 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
369
396
  if (partialFlashResult === flashing_partial_js_1.PartialFlashResult.AttemptFullFlash) {
370
397
  await (0, flashing_full_js_1.fullFlash)(connection, boardVersion, memoryMap, progress);
371
398
  }
372
- else if (partialFlashResult === flashing_partial_js_1.PartialFlashResult.AlreadyUpToDate ||
399
+ this.dispatchEvent("flash");
400
+ if (partialFlashResult === flashing_partial_js_1.PartialFlashResult.AlreadyUpToDate ||
373
401
  partialFlashResult === flashing_partial_js_1.PartialFlashResult.Success) {
374
402
  this.waitForPostFlashDisconnectPromise = (async () => {
375
403
  try {
@@ -393,7 +421,7 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
393
421
  }
394
422
  }
395
423
  })();
396
- this.setStatus(device_js_1.ConnectionStatus.DISCONNECTED);
424
+ this.setStatus(device_js_1.ConnectionStatus.Disconnected);
397
425
  }
398
426
  }
399
427
  catch (e) {
@@ -409,7 +437,10 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
409
437
  finally {
410
438
  const previousStatus = this.deferredUpdatesPreviousStatus;
411
439
  this.deferredUpdatesPreviousStatus = undefined;
412
- this.dispatchTypedEvent("status", new device_js_1.ConnectionStatusEvent(this.status, previousStatus));
440
+ this.dispatchEvent("status", {
441
+ status: this.status,
442
+ previousStatus,
443
+ });
413
444
  }
414
445
  }
415
446
  /**
@@ -417,22 +448,33 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
417
448
  *
418
449
  * @returns device or undefined if user cancels.
419
450
  */
420
- async requestDeviceWeb(namePrefix) {
451
+ async requestDeviceWeb(namePrefixes) {
452
+ const optionalServices = [
453
+ profile_js_1.profile.accelerometer.id,
454
+ profile_js_1.profile.button.id,
455
+ profile_js_1.profile.deviceInformation.id,
456
+ profile_js_1.profile.dfuControl.id,
457
+ profile_js_1.profile.event.id,
458
+ profile_js_1.profile.ioPin.id,
459
+ profile_js_1.profile.led.id,
460
+ profile_js_1.profile.magnetometer.id,
461
+ profile_js_1.profile.temperature.id,
462
+ profile_js_1.profile.uart.id,
463
+ ];
464
+ // Temporarily patch navigator.bluetooth.requestDevice to support multiple
465
+ // name prefix filters. The capacitor-ble plugin only supports a single
466
+ // namePrefix, but the Web Bluetooth API supports a filters array.
467
+ // By patching at this level the plugin's internal deviceMap is populated
468
+ // naturally when its own requestDevice completes.
469
+ const orig = navigator.bluetooth.requestDevice.bind(navigator.bluetooth);
421
470
  try {
471
+ navigator.bluetooth.requestDevice = (options) => orig({
472
+ ...options,
473
+ filters: namePrefixes.map((namePrefix) => ({ namePrefix })),
474
+ });
422
475
  return await bluetooth_le_1.BleClient.requestDevice({
423
- namePrefix,
424
- optionalServices: [
425
- bluetooth_profile_js_1.profile.accelerometer.id,
426
- bluetooth_profile_js_1.profile.button.id,
427
- bluetooth_profile_js_1.profile.deviceInformation.id,
428
- bluetooth_profile_js_1.profile.dfuControl.id,
429
- bluetooth_profile_js_1.profile.event.id,
430
- bluetooth_profile_js_1.profile.ioPin.id,
431
- bluetooth_profile_js_1.profile.led.id,
432
- bluetooth_profile_js_1.profile.magnetometer.id,
433
- bluetooth_profile_js_1.profile.temperature.id,
434
- bluetooth_profile_js_1.profile.uart.id,
435
- ],
476
+ namePrefix: namePrefixes[0],
477
+ optionalServices,
436
478
  });
437
479
  }
438
480
  catch (e) {
@@ -441,6 +483,9 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
441
483
  }
442
484
  throw e;
443
485
  }
486
+ finally {
487
+ navigator.bluetooth.requestDevice = orig;
488
+ }
444
489
  }
445
490
  /**
446
491
  * Finds device with specified name prefix.
@@ -448,19 +493,17 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
448
493
  * @returns device or undefined if none can be found.
449
494
  * @throws DeviceError with code "aborted" if signal is aborted.
450
495
  */
451
- async requestDeviceNative(namePrefix, signal) {
496
+ async requestDeviceNative(namePrefixes, signal) {
452
497
  if (signal?.aborted) {
453
498
  throw new device_js_1.DeviceError({ code: "aborted", message: "Connection aborted" });
454
499
  }
500
+ const matchesAnyPrefix = (name) => !!name && namePrefixes.some((p) => name.startsWith(p));
455
501
  // Check for existing bonded devices.
456
- const bonded = await this.checkBondedDevices((device) => {
457
- const name = device.name;
458
- return !!name && name.startsWith(namePrefix);
459
- });
502
+ const bonded = await this.checkBondedDevices((device) => matchesAnyPrefix(device.name));
460
503
  if (bonded) {
461
504
  return bonded;
462
505
  }
463
- this.log(`Scanning for device - ${namePrefix}`);
506
+ this.log(`Scanning for device - ${namePrefixes.join(", ")}`);
464
507
  let found = false;
465
508
  let aborted = false;
466
509
  const scanPromise = new Promise((resolve) =>
@@ -470,8 +513,8 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
470
513
  // isn't matched by the name filter but the advertising name is in the
471
514
  // localName on the device. So we filter here instead. This happens on
472
515
  // iOS if DFU fails / is interrupted.
473
- if (result.device.name?.startsWith(namePrefix) ||
474
- result.localName?.startsWith(namePrefix)) {
516
+ if (matchesAnyPrefix(result.device.name) ||
517
+ matchesAnyPrefix(result.localName)) {
475
518
  found = true;
476
519
  await bluetooth_le_1.BleClient.stopLEScan();
477
520
  resolve(result.device);
@@ -491,11 +534,11 @@ class MicrobitWebBluetoothConnectionImpl extends events_js_1.TypedEventTarget {
491
534
  this.log("Timeout scanning for device");
492
535
  resolve(undefined);
493
536
  }
494
- }, bluetooth_device_wrapper_js_1.scanningTimeoutInMs));
537
+ }, device_wrapper_js_1.scanningTimeoutInMs));
495
538
  return await Promise.race([scanPromise, scanTimeoutPromise, abortPromise]);
496
539
  }
497
540
  async checkBondedDevices(predicate) {
498
- if (!(0, bluetooth_device_wrapper_js_1.isAndroid)()) {
541
+ if (!(0, device_wrapper_js_1.isAndroid)()) {
499
542
  // Not supported.
500
543
  return undefined;
501
544
  }
@@ -514,6 +557,6 @@ const convertDataToMemoryMap = (data) => {
514
557
  if (data instanceof Uint8Array) {
515
558
  return nrf_intel_hex_1.default.fromPaddedUint8Array(data);
516
559
  }
517
- return nrf_intel_hex_1.default.fromHex((0, hex_flash_data_source_js_1.truncateHexAfterEof)(data));
560
+ return nrf_intel_hex_1.default.fromHex((0, hex_util_js_1.truncateHexAfterEof)(data));
518
561
  };
519
- //# sourceMappingURL=bluetooth.js.map
562
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/bluetooth/connection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oEAAyE;AACzE,0CAA4C;AAC5C,kEAAsC;AACtC,2DAI6B;AAC7B,6CAAuC;AACvC,4CAcsB;AACtB,4CAAgD;AAChD,8CAAwD;AACxD,kEAAwD;AACxD,sFAEwC;AASxC,wDAAwD;AACxD,gDAAqD;AACrD,iEAGgC;AAChC,oDAAgD;AAIhD,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAkIjC;;GAEG;AACI,MAAM,yBAAyB,GAAG,CACvC,OAA4C,EACf,EAAE,CAAC,IAAI,+BAA+B,CAAC,OAAO,CAAC,CAAC;AAFlE,QAAA,yBAAyB,6BAEyC;AAE/E;;GAEG;AACH,MAAM,+BACJ,SAAQ,4BAAsE;IA2B9E,YAAY,UAA8C,EAAE;QAC1D,KAAK,EAAE,CAAC;QAzBV;;;;mBAA2B,4BAAgB,CAAC,kBAAkB;WAAC;QAE/D;;;WAGG;QACK;;;;;WAAiC;QAEjC;;;;;WAAiB;QACjB;;;;;WAAiC;QACzC;;WAEG;QACK;;;;;WAA2C;QAEnD;;WAEG;QACK;;;;;WAA6C;QAE7C;;;;;WAA+B;QAC/B;;;;;WAA4D;QAC5D;;;;;WAA6D;QAInE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,2BAAc,EAAE,CAAC;QACvD,IAAI,CAAC,eAAe;YAClB,OAAO,CAAC,eAAe,IAAI,IAAI,6CAAsB,EAAE,CAAC;IAC5D,CAAC;IAES,cAAc,CAAC,IAAY;QACnC,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAyB,CAAC,CAAC;IAC7D,CAAC;IAES,gBAAgB,CAAC,IAAY;QACrC,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC,IAAyB,CAAC,CAA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