@ovok/native 1.10.10 → 1.10.11

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 (302) hide show
  1. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +19 -1
  2. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  3. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js +47 -0
  4. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js.map +1 -0
  5. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js +119 -0
  6. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js.map +1 -0
  7. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-standard-variants.js +6 -0
  8. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-standard-variants.js.map +1 -1
  9. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js +173 -0
  10. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js.map +1 -0
  11. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-variants.js +8 -0
  12. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-variants.js.map +1 -1
  13. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-yonker-variants.js +113 -0
  14. package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-yonker-variants.js.map +1 -0
  15. package/lib/commonjs/modules/bt-device/constants/supported-devices.js +2 -37
  16. package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
  17. package/lib/commonjs/modules/bt-management/constants/and-medical-device-variants.js +39 -0
  18. package/lib/commonjs/modules/bt-management/constants/and-medical-device-variants.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/constants/built-in-measurement-types.js +84 -0
  20. package/lib/commonjs/modules/bt-management/constants/built-in-measurement-types.js.map +1 -0
  21. package/lib/commonjs/modules/bt-management/constants/cofoe-device-variants.js +101 -0
  22. package/lib/commonjs/modules/bt-management/constants/cofoe-device-variants.js.map +1 -0
  23. package/lib/commonjs/modules/bt-management/constants/device-variants.js +5 -1
  24. package/lib/commonjs/modules/bt-management/constants/device-variants.js.map +1 -1
  25. package/lib/commonjs/modules/bt-management/constants/standard-device-variants.js +5 -0
  26. package/lib/commonjs/modules/bt-management/constants/standard-device-variants.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/constants/taidoc-device-variants.js +144 -0
  28. package/lib/commonjs/modules/bt-management/constants/taidoc-device-variants.js.map +1 -0
  29. package/lib/commonjs/modules/bt-management/constants/yonker-device-variants.js +93 -0
  30. package/lib/commonjs/modules/bt-management/constants/yonker-device-variants.js.map +1 -0
  31. package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js +18 -0
  32. package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/device-classes.js +23 -1
  34. package/lib/commonjs/modules/bt-management/services/device-classes.js.map +1 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.device.js +61 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.device.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.protocol.js +113 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.protocol.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js +77 -0
  40. package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js.map +1 -0
  41. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj-70b.device.js +1 -1
  42. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj-70b.device.js.map +1 -1
  43. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +7 -25
  44. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  45. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +7 -2
  46. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  47. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js +86 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js.map +1 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js +155 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js +33 -0
  52. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js.map +1 -0
  53. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.device.js +87 -0
  54. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.device.js.map +1 -0
  55. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.protocol.js +185 -0
  56. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.protocol.js.map +1 -0
  57. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js +86 -0
  58. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -0
  59. package/lib/commonjs/modules/bt-management/services/devices/jumper/jumper.device.js +1 -1
  60. package/lib/commonjs/modules/bt-management/services/devices/jumper/jumper.device.js.map +1 -1
  61. package/lib/commonjs/modules/bt-management/services/devices/live-oximeter.sequencer.js +10 -6
  62. package/lib/commonjs/modules/bt-management/services/devices/live-oximeter.sequencer.js.map +1 -1
  63. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.device.js +50 -0
  64. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.device.js.map +1 -0
  65. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.protocol.js +127 -0
  66. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.protocol.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.records.js +181 -0
  68. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.records.js.map +1 -0
  69. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js +139 -0
  70. package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js.map +1 -0
  71. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.device.js +90 -0
  72. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.device.js.map +1 -0
  73. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.protocol.js +202 -0
  74. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.protocol.js.map +1 -0
  75. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.sequencer.js +137 -0
  76. package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.sequencer.js.map +1 -0
  77. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +18 -0
  78. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  79. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +19 -1
  80. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  81. package/lib/module/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js +45 -0
  82. package/lib/module/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js.map +1 -0
  83. package/lib/module/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js +117 -0
  84. package/lib/module/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js.map +1 -0
  85. package/lib/module/modules/bt-device/constants/supported-device-catalog-standard-variants.js +6 -0
  86. package/lib/module/modules/bt-device/constants/supported-device-catalog-standard-variants.js.map +1 -1
  87. package/lib/module/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js +171 -0
  88. package/lib/module/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js.map +1 -0
  89. package/lib/module/modules/bt-device/constants/supported-device-catalog-variants.js +8 -0
  90. package/lib/module/modules/bt-device/constants/supported-device-catalog-variants.js.map +1 -1
  91. package/lib/module/modules/bt-device/constants/supported-device-catalog-yonker-variants.js +111 -0
  92. package/lib/module/modules/bt-device/constants/supported-device-catalog-yonker-variants.js.map +1 -0
  93. package/lib/module/modules/bt-device/constants/supported-devices.js +2 -37
  94. package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
  95. package/lib/module/modules/bt-management/constants/and-medical-device-variants.js +37 -0
  96. package/lib/module/modules/bt-management/constants/and-medical-device-variants.js.map +1 -0
  97. package/lib/module/modules/bt-management/constants/built-in-measurement-types.js +82 -0
  98. package/lib/module/modules/bt-management/constants/built-in-measurement-types.js.map +1 -0
  99. package/lib/module/modules/bt-management/constants/cofoe-device-variants.js +99 -0
  100. package/lib/module/modules/bt-management/constants/cofoe-device-variants.js.map +1 -0
  101. package/lib/module/modules/bt-management/constants/device-variants.js +5 -1
  102. package/lib/module/modules/bt-management/constants/device-variants.js.map +1 -1
  103. package/lib/module/modules/bt-management/constants/standard-device-variants.js +5 -0
  104. package/lib/module/modules/bt-management/constants/standard-device-variants.js.map +1 -1
  105. package/lib/module/modules/bt-management/constants/taidoc-device-variants.js +142 -0
  106. package/lib/module/modules/bt-management/constants/taidoc-device-variants.js.map +1 -0
  107. package/lib/module/modules/bt-management/constants/yonker-device-variants.js +91 -0
  108. package/lib/module/modules/bt-management/constants/yonker-device-variants.js.map +1 -0
  109. package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js +18 -0
  110. package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
  111. package/lib/module/modules/bt-management/services/device-classes.js +23 -1
  112. package/lib/module/modules/bt-management/services/device-classes.js.map +1 -1
  113. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.device.js +57 -0
  114. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.device.js.map +1 -0
  115. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.protocol.js +106 -0
  116. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.protocol.js.map +1 -0
  117. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js +74 -0
  118. package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js.map +1 -0
  119. package/lib/module/modules/bt-management/services/devices/aoj/aoj-70b.device.js +2 -2
  120. package/lib/module/modules/bt-management/services/devices/aoj/aoj-70b.device.js.map +1 -1
  121. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +6 -24
  122. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  123. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +7 -2
  124. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  125. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js +82 -0
  126. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js.map +1 -0
  127. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js +148 -0
  128. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js.map +1 -0
  129. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js +30 -0
  130. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js.map +1 -0
  131. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.device.js +83 -0
  132. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.device.js.map +1 -0
  133. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.protocol.js +173 -0
  134. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.protocol.js.map +1 -0
  135. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js +78 -0
  136. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -0
  137. package/lib/module/modules/bt-management/services/devices/jumper/jumper.device.js +2 -2
  138. package/lib/module/modules/bt-management/services/devices/jumper/jumper.device.js.map +1 -1
  139. package/lib/module/modules/bt-management/services/devices/live-oximeter.sequencer.js +10 -6
  140. package/lib/module/modules/bt-management/services/devices/live-oximeter.sequencer.js.map +1 -1
  141. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.device.js +46 -0
  142. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.device.js.map +1 -0
  143. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.protocol.js +114 -0
  144. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.protocol.js.map +1 -0
  145. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.records.js +168 -0
  146. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.records.js.map +1 -0
  147. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js +136 -0
  148. package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js.map +1 -0
  149. package/lib/module/modules/bt-management/services/devices/yonker/yonker.device.js +86 -0
  150. package/lib/module/modules/bt-management/services/devices/yonker/yonker.device.js.map +1 -0
  151. package/lib/module/modules/bt-management/services/devices/yonker/yonker.protocol.js +186 -0
  152. package/lib/module/modules/bt-management/services/devices/yonker/yonker.protocol.js.map +1 -0
  153. package/lib/module/modules/bt-management/services/devices/yonker/yonker.sequencer.js +133 -0
  154. package/lib/module/modules/bt-management/services/devices/yonker/yonker.sequencer.js.map +1 -0
  155. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  156. package/lib/module/modules/bt-management/types/integrated-devices.js +18 -0
  157. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  158. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts +5 -0
  160. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts +5 -0
  162. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-standard-variants.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts +5 -0
  165. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-variants.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts +5 -0
  168. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
  170. package/lib/typescript/commonjs/src/modules/bt-management/constants/and-medical-device-variants.d.ts +5 -0
  171. package/lib/typescript/commonjs/src/modules/bt-management/constants/and-medical-device-variants.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/modules/bt-management/constants/built-in-measurement-types.d.ts +9 -0
  173. package/lib/typescript/commonjs/src/modules/bt-management/constants/built-in-measurement-types.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/modules/bt-management/constants/cofoe-device-variants.d.ts +5 -0
  175. package/lib/typescript/commonjs/src/modules/bt-management/constants/cofoe-device-variants.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/src/modules/bt-management/constants/device-variants.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/src/modules/bt-management/constants/standard-device-variants.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/modules/bt-management/constants/taidoc-device-variants.d.ts +5 -0
  179. package/lib/typescript/commonjs/src/modules/bt-management/constants/taidoc-device-variants.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/src/modules/bt-management/constants/yonker-device-variants.d.ts +5 -0
  181. package/lib/typescript/commonjs/src/modules/bt-management/constants/yonker-device-variants.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -1
  183. package/lib/typescript/commonjs/src/modules/bt-management/services/device-classes.d.ts +22 -0
  184. package/lib/typescript/commonjs/src/modules/bt-management/services/device-classes.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts +18 -0
  186. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts +30 -0
  188. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts +26 -0
  190. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +4 -1
  193. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  194. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts +32 -0
  195. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts +46 -0
  197. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts +15 -0
  199. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts +18 -0
  201. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts +75 -0
  203. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts +22 -0
  205. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/jumper/jumper.device.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts +6 -2
  208. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts +16 -0
  210. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts +50 -0
  212. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts +40 -0
  214. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts +38 -0
  216. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts +21 -0
  218. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts +62 -0
  220. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts +46 -0
  222. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts +1 -0
  224. package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts.map +1 -1
  225. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +18 -0
  226. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  227. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +19 -1
  228. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +2 -2
  230. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  231. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts +5 -0
  232. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts.map +1 -0
  233. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts +5 -0
  234. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts.map +1 -0
  235. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-standard-variants.d.ts.map +1 -1
  236. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts +5 -0
  237. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts.map +1 -0
  238. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-variants.d.ts.map +1 -1
  239. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts +5 -0
  240. package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts.map +1 -0
  241. package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
  242. package/lib/typescript/module/src/modules/bt-management/constants/and-medical-device-variants.d.ts +5 -0
  243. package/lib/typescript/module/src/modules/bt-management/constants/and-medical-device-variants.d.ts.map +1 -0
  244. package/lib/typescript/module/src/modules/bt-management/constants/built-in-measurement-types.d.ts +9 -0
  245. package/lib/typescript/module/src/modules/bt-management/constants/built-in-measurement-types.d.ts.map +1 -0
  246. package/lib/typescript/module/src/modules/bt-management/constants/cofoe-device-variants.d.ts +5 -0
  247. package/lib/typescript/module/src/modules/bt-management/constants/cofoe-device-variants.d.ts.map +1 -0
  248. package/lib/typescript/module/src/modules/bt-management/constants/device-variants.d.ts.map +1 -1
  249. package/lib/typescript/module/src/modules/bt-management/constants/standard-device-variants.d.ts.map +1 -1
  250. package/lib/typescript/module/src/modules/bt-management/constants/taidoc-device-variants.d.ts +5 -0
  251. package/lib/typescript/module/src/modules/bt-management/constants/taidoc-device-variants.d.ts.map +1 -0
  252. package/lib/typescript/module/src/modules/bt-management/constants/yonker-device-variants.d.ts +5 -0
  253. package/lib/typescript/module/src/modules/bt-management/constants/yonker-device-variants.d.ts.map +1 -0
  254. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -1
  255. package/lib/typescript/module/src/modules/bt-management/services/device-classes.d.ts +22 -0
  256. package/lib/typescript/module/src/modules/bt-management/services/device-classes.d.ts.map +1 -1
  257. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts +18 -0
  258. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts.map +1 -0
  259. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts +30 -0
  260. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts.map +1 -0
  261. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts +26 -0
  262. package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts.map +1 -0
  263. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  264. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +4 -1
  265. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  266. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts +32 -0
  267. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts.map +1 -0
  268. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts +46 -0
  269. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts.map +1 -0
  270. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts +15 -0
  271. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts.map +1 -0
  272. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts +18 -0
  273. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts.map +1 -0
  274. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts +75 -0
  275. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts.map +1 -0
  276. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts +22 -0
  277. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -0
  278. package/lib/typescript/module/src/modules/bt-management/services/devices/jumper/jumper.device.d.ts.map +1 -1
  279. package/lib/typescript/module/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts +6 -2
  280. package/lib/typescript/module/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts.map +1 -1
  281. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts +16 -0
  282. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts.map +1 -0
  283. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts +50 -0
  284. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts.map +1 -0
  285. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts +40 -0
  286. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts.map +1 -0
  287. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts +38 -0
  288. package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts.map +1 -0
  289. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts +21 -0
  290. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts.map +1 -0
  291. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts +62 -0
  292. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts.map +1 -0
  293. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts +46 -0
  294. package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts.map +1 -0
  295. package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts +1 -0
  296. package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts.map +1 -1
  297. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +18 -0
  298. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  299. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +19 -1
  300. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  301. package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +2 -2
  302. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FrameReadStatus","hexToByte","TAIDOC_SERVICE","TAIDOC_CHARACTERISTIC","TAIDOC","wakeUp","deviceTime","model","readingTime","readingResult","serial1","serial2","oximeterAfterTime","readingCount","setTime","shutdown","wakeNotice","weightRecord","setUser","busy","START","HOST_END","DEVICE_END","FIXED_FRAME_BYTES","VARIABLE_COMMANDS","toHex","bytes","map","value","toString","padStart","byteAt","frame","index","sum","reduce","total","withChecksum","commandOf","taidocCommand","command","a","b","c","d","readingCountCommand","user","readingCommand","setTimeCommand","now","date","getFullYear","getMonth","getDate","getMinutes","getHours","weightRecordCommand","isHostFrame","length","TaidocFrameReader","readFrame","buffer","start","findIndex","byte","status","INCOMPLETE","consumedBytes","includes","received","slice","end","CORRUPT","COMPLETE","MULTI_USER_CODES","Set","usersFor","has","readCount"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/taidoc/taidoc.protocol.ts"],"mappings":";;AAAA;;AAGA,SAASA,eAAe,QAAQ,qCAAkC;AAElE,SAASC,SAAS,QAAQ,+BAA4B;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,sCAAsC;AACpE,OAAO,MAAMC,qBAAqB,GAAG,sCAAsC;AAE3E,OAAO,MAAMC,MAAM,GAAG;EACpBC,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,WAAW,EAAE,IAAI;EACjBC,aA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CAAC4C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK5C,KAAK,CAACgC,MAAM,GAAG,CAAC,CAAC,EAAE;MAC7F,OAAO;QAAEO,MAAM,EAAEjE,eAAe,CAACwE,OAAO;QAAEL,aAAa,EAAEL,KAAK,GAAG;MAAE,CAAC;IACtE;IAEA,OAAO;MAAEG,MAAM,EAAEjE,eAAe,CAACyE,QAAQ;MAAEN,aAAa,EAAEL,KAAK,GAAGJ,MAAM;MAAE1B,KAAK,EAAEqC;IAAS,CAAC;EAC7F;AACF;;AAEA;AACA;AACA;AACA;AACA,MAAMK,gBAAqC,GAAG,IAAIC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvF,OAAO,MAAMC,QAAQ,GAAIrE,KAAwB,IAC/CmE,gBAAgB,CAACG,GAAG,CAAC9C,MAAM,CAACxB,KAAK,EAAE,CAAC,CAAC,GAAIwB,MAAM,CAACxB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAE,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE1E;AACA,OAAO,MAAMuE,SAAS,GAAI9C,KAAwB,IAChDD,MAAM,CAACC,KAAK,EAAE,CAAC,CAAC,GAAID,MAAM,CAACC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAE","ignoreList":[]}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+ import { MeasurementTypeKey } from "@ovok/core";
5
+ import { hexToByte } from "../../../utils/hex-to-byte.js";
6
+
7
+ /**
8
+ * TaiDoc record layouts, from MedM Health Diary 3.12.11's `CTaiDocBTM`, `CTaiDocTM`,
9
+ * `CTaiDoc_8255` and `CTaiDocW` parsers. A record is the 0x25 answer (its time and flags) and
10
+ * the 0x26 answer (its values); the scale's 0x71 record carries both.
11
+ */
12
+ const byteAt = (frame, index) => hexToByte(frame[index] ?? "00");
13
+
14
+ /** The 0x25 answer's flags byte: bits 0-5 minute, 6 irregular pulse, 7 blood-pressure record. */
15
+ const FLAGS_BYTE = 4;
16
+ export const isBloodPressureRecord = time => (byteAt(time, FLAGS_BYTE) & 0x80) !== 0;
17
+
18
+ /**
19
+ * The record time in a 0x25 answer: `date16` as in set time, minute and hour. A year byte past
20
+ * 2069 is MedM's "clock not valid", and such a record is dropped rather than given today's date.
21
+ */
22
+ export const readRecordTime = time => {
23
+ const date = byteAt(time, 2) | byteAt(time, 3) << 8;
24
+ const year = date >> 9;
25
+ const month = date >> 5 & 0x0f;
26
+ const day = date & 0x1f;
27
+ if (year > 69 || month < 1 || month > 12 || day < 1) {
28
+ return undefined;
29
+ }
30
+ return new Date(2000 + year, month - 1, day, byteAt(time, 5) & 0x1f, byteAt(time, FLAGS_BYTE) & 0x3f);
31
+ };
32
+
33
+ /** 0x26 blood pressure: systolic, mean arterial pressure, diastolic, pulse. */
34
+ export const readBloodPressure = (time, result) => {
35
+ const systolic = byteAt(result, 2);
36
+ const diastolic = byteAt(result, 4);
37
+ if (systolic === 0 || diastolic === 0) {
38
+ return undefined;
39
+ }
40
+ return {
41
+ systolic,
42
+ diastolic,
43
+ heartRate: byteAt(result, 5),
44
+ ...((byteAt(time, FLAGS_BYTE) & 0x40) !== 0 ? {
45
+ irregularHeartbeat: true
46
+ } : {})
47
+ };
48
+ };
49
+
50
+ /**
51
+ * Frame byte 5 of the 0x26 stored result is d3: bits 6-7 the meal flag, where `11` marks a
52
+ * control-solution test, and on multi-parameter meters bits 2-5 the parameter - 0 glucose;
53
+ * 6 haematocrit, 7 ketone, 8 uric acid, 9 cholesterol, 11 haemoglobin, 12 lactate,
54
+ * 13 triglycerides. Single-parameter TaiDoc meters keep the strip code in bits 2-5 instead,
55
+ * so this check holds only for multi-parameter ones.
56
+ */
57
+ const CONTROL_SOLUTION_FLAG = 0b11;
58
+ const GLUCOSE_PARAMETER = 0;
59
+
60
+ /** A stored TaiDoc result is a patient glucose reading, not another analyte or a control test. */
61
+ export const isPatientGlucoseRecord = result => {
62
+ const flags = byteAt(result, 5);
63
+ return flags >> 6 !== CONTROL_SOLUTION_FLAG && (flags >> 2 & 0x0f) === GLUCOSE_PARAMETER;
64
+ };
65
+
66
+ /**
67
+ * 0x26 glucose, mg/dL little-endian in d0-d1. The meters on this parser are glucose-only or
68
+ * BP+glucose, whose bits 2-5 may hold a strip code, so only control-solution tests are dropped.
69
+ */
70
+ export const readGlucose = result => {
71
+ const bloodGlucose = byteAt(result, 2) | byteAt(result, 3) << 8;
72
+ return bloodGlucose > 0 && byteAt(result, 5) >> 6 !== CONTROL_SOLUTION_FLAG ? bloodGlucose : undefined;
73
+ };
74
+
75
+ /** 0x26 temperature, tenths of a degree Celsius; above 60.0 is MedM's object (surface) mode. */
76
+ export const readTemperature = result => {
77
+ const tenths = byteAt(result, 2) | byteAt(result, 3) << 8;
78
+ return tenths > 0 && tenths <= 600 ? tenths / 10 : undefined;
79
+ };
80
+
81
+ /** 0x26 pulse oximetry: SpO2 % in d0-d1, pulse in d3. */
82
+ export const readOximeter = result => {
83
+ const bloodOxygen = byteAt(result, 2) | byteAt(result, 3) << 8;
84
+ const pulseRate = byteAt(result, 5);
85
+ return bloodOxygen > 0 && bloodOxygen <= 100 && pulseRate > 0 ? {
86
+ bloodOxygen,
87
+ pulseRate
88
+ } : undefined;
89
+ };
90
+
91
+ /**
92
+ * The scale's 34-byte 0x71 record: yy MM dd hh mm at 4-8, user at 9, a unit selector at 15 and
93
+ * the weight in tenths, big-endian, at 16. Selector 1 puts the weight in a second slot in a unit
94
+ * MedM does not name, so it is dropped rather than guessed. Body composition is not decoded:
95
+ * which quantity each of its fields carries is not known.
96
+ */
97
+ export const readWeight = record => {
98
+ const year = byteAt(record, 4);
99
+ const month = byteAt(record, 5);
100
+ const selector = byteAt(record, 0x0f);
101
+ const tenths = byteAt(record, 0x10) << 8 | byteAt(record, 0x11);
102
+ if (record.length !== 34 || selector !== 0 && selector !== 2 || tenths === 0 || year > 69 || month < 1 || month > 12) {
103
+ return undefined;
104
+ }
105
+ return {
106
+ bodyWeight: tenths / 10,
107
+ recordedAt: new Date(2000 + year, month - 1, byteAt(record, 6), byteAt(record, 7), byteAt(record, 8)),
108
+ user: byteAt(record, 9)
109
+ };
110
+ };
111
+
112
+ /** What the 0x26 record holds: `multi` is glucose or blood pressure by the type bit, `bpm` always blood pressure. */
113
+
114
+ const readValues = (kind, time, result) => {
115
+ if (kind === "bpm" || kind === "multi" && isBloodPressureRecord(time)) {
116
+ const reading = readBloodPressure(time, result);
117
+ return reading && {
118
+ measurementTypeKey: MeasurementTypeKey.bloodPressure,
119
+ ...reading
120
+ };
121
+ }
122
+ if (kind === "multi") {
123
+ const bloodGlucose = readGlucose(result);
124
+ return bloodGlucose === undefined ? undefined : {
125
+ measurementTypeKey: MeasurementTypeKey.bloodGlucose,
126
+ bloodGlucose
127
+ };
128
+ }
129
+ if (kind === "thermometer") {
130
+ const bodyTemp = readTemperature(result);
131
+ return bodyTemp === undefined ? undefined : {
132
+ measurementTypeKey: MeasurementTypeKey.temperature,
133
+ bodyTemp
134
+ };
135
+ }
136
+ const reading = kind === "oximeter" ? readOximeter(result) : undefined;
137
+ return reading && {
138
+ measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
139
+ ...reading
140
+ };
141
+ };
142
+
143
+ /** One 0x25/0x26 record pair as a result, or undefined when it is invalid or not a reading. */
144
+ export const decodeRecord = (kind, time, result, user) => {
145
+ const recordedAt = readRecordTime(time);
146
+ const values = recordedAt && readValues(kind, time, result);
147
+ return values && {
148
+ ...values,
149
+ recordedAt,
150
+ ...(user > 0 ? {
151
+ memorySlot: user
152
+ } : {})
153
+ };
154
+ };
155
+
156
+ /** The scale's 0x71 record as a result. */
157
+ export const decodeWeightRecord = record => {
158
+ const weight = readWeight(record);
159
+ return weight && {
160
+ measurementTypeKey: MeasurementTypeKey.bodyWeight,
161
+ bodyWeight: weight.bodyWeight,
162
+ recordedAt: weight.recordedAt,
163
+ ...(weight.user > 0 ? {
164
+ memorySlot: weight.user
165
+ } : {})
166
+ };
167
+ };
168
+ //# sourceMappingURL=taidoc.records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","hexToByte","byteAt","frame","index","FLAGS_BYTE","isBloodPressureRecord","time","readRecordTime","date","year","month","day","undefined","Date","readBloodPressure","result","systolic","diastolic","heartRate","irregularHeartbeat","CONTROL_SOLUTION_FLAG","GLUCOSE_PARAMETER","isPatientGlucoseRecord","flags","readGlucose","bloodGlucose","readTemperature","tenths","readOximeter","bloodOxygen","pulseRate","readWeight","record","selector","length","bodyWeight","recordedAt","user","readValues","kind","reading","measurementTypeKey","bloodPressure","bodyTemp","temperature","bloodOxygenPulseRate","decodeRecord","values","memorySlot","decodeWeightRecord","weight"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/taidoc/taidoc.records.ts"],"mappings":";;AAAA;AACA,SAASA,kBAAkB,QAAQ,YAAY;AAE/C,SAASC,SAAS,QAAQ,+BAA4B;;AAEtD;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAGA,CAACC,KAAwB,EAAEC,KAAa,KACrDH,SAAS,CAACE,KAAK,CAACC,KAAK,CAAC,IAAI,IAAI,CAAC;;AAEjC;AACA,MAAMC,UAAU,GAAG,CAAC;AAEpB,OAAO,MAAMC,qBAAqB,GAAIC,IAAuB,IAC3D,CAACL,MAAM,CAACK,IAAI,EAAEF,UAAU,CAAC,GAAG,IAAI,MAAM,CAAC;;AAEzC;AACA;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAID,IAAuB,IAAuB;EAC3E,MAAME,IAAI,GAAGP,MAAM,CAACK,IAAI,EAAE,CAAC,CAAC,GAAIL,MAAM,CAACK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAE;EACrD,MAAMG,IAAI,GAAGD,IAAI,IAAI,CAAC;EACtB,MAAME,KAAK,GAAIF,IAAI,IAAI,CAAC,GAAI,IAAI;EAChC,MAAMG,GAAG,GAAGH,IA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I,GAAG,CAAC,GAAG;MAAEW,UAAU,EAAEE,MAAM,CAACb;IAAK,CAAC,GAAG,CAAC,CAAC;EACxD,CAAC;AAEL,CAAC","ignoreList":[]}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+
3
+ import { CaseType } from "../../../types/case-type.js";
4
+ import { commandOf, isHostFrame, readCount, readingCommand, readingCountCommand, setTimeCommand, TAIDOC, TAIDOC_CHARACTERISTIC, TAIDOC_SERVICE, taidocCommand, usersFor, weightRecordCommand } from "./taidoc.protocol.js";
5
+ import { decodeRecord, decodeWeightRecord } from "./taidoc.records.js";
6
+
7
+ /** MedM's wait after connecting before the first command: 1.5 s, 3 s for the 8255, 8 s for the cuff. */
8
+ const START_DELAY_MS = {
9
+ multi: 1_500,
10
+ bpm: 8_000,
11
+ thermometer: 1_500,
12
+ oximeter: 3_000,
13
+ scale: 1_500
14
+ };
15
+
16
+ /** The scale paces its record requests 250 ms apart. */
17
+ const SCALE_RECORD_DELAY_MS = 250;
18
+ const RESPONSE_TIMEOUT_MS = 3_000;
19
+ const RETRIES = 3;
20
+
21
+ /**
22
+ * MedM's history session: model, serial, device time, set time, then for every device user the
23
+ * record count and each record by index (record time 0x25, then result 0x26; the scale's 0x71
24
+ * carries both). It ends with power off 0x50; the clear-memory command 0x52 is never sent.
25
+ */
26
+ class TaidocSequencer {
27
+ retries = RETRIES;
28
+ ended = false;
29
+ user = 0;
30
+ maxUser = 0;
31
+ count = 0;
32
+ index = 0;
33
+ recordTime = [];
34
+ constructor(params) {
35
+ this.params = params;
36
+ }
37
+ initialCommands = () => [this.send(taidocCommand(TAIDOC.model), START_DELAY_MS[this.params.kind])];
38
+ isHistoryTransfer = () => true;
39
+ isNormalDisconnect = () => this.ended;
40
+ commandTimeoutMs = () => this.ended ? undefined : RESPONSE_TIMEOUT_MS;
41
+ onCommandTimeout = () => {
42
+ if (this.retries === 0 || !this.last) {
43
+ return {
44
+ terminal: true
45
+ };
46
+ }
47
+ this.retries -= 1;
48
+ return {
49
+ commands: [this.last]
50
+ };
51
+ };
52
+ commandProgress = frame => isHostFrame(frame) ? "ignored" : "complete";
53
+ nextCommand = frame => {
54
+ if (isHostFrame(frame) || this.ended) {
55
+ return undefined;
56
+ }
57
+ this.retries = RETRIES;
58
+ switch (commandOf(frame)) {
59
+ case TAIDOC.busy:
60
+ return this.last && [this.last];
61
+ case TAIDOC.wakeUp:
62
+ case TAIDOC.wakeNotice:
63
+ return [this.send(taidocCommand(TAIDOC.model))];
64
+ case TAIDOC.model:
65
+ {
66
+ const users = usersFor(frame);
67
+ this.user = users > 1 ? 1 : 0;
68
+ this.maxUser = users > 1 ? users : 0;
69
+ return [this.send(taidocCommand(TAIDOC.serial1))];
70
+ }
71
+ case TAIDOC.serial1:
72
+ return [this.send(taidocCommand(TAIDOC.serial2))];
73
+ case TAIDOC.serial2:
74
+ return [this.send(taidocCommand(TAIDOC.deviceTime))];
75
+ case TAIDOC.deviceTime:
76
+ return [this.send(setTimeCommand(this.now()))];
77
+ case TAIDOC.setTime:
78
+ return [this.send(this.params.kind === "oximeter" ? taidocCommand(TAIDOC.oximeterAfterTime) : readingCountCommand(this.user))];
79
+ case TAIDOC.oximeterAfterTime:
80
+ return [this.send(readingCountCommand(this.user))];
81
+ case TAIDOC.readingCount:
82
+ this.count = readCount(frame);
83
+ this.index = 0;
84
+ return this.nextReading();
85
+ case TAIDOC.readingTime:
86
+ this.recordTime = frame;
87
+ return [this.send(readingCommand(TAIDOC.readingResult, this.index - 1, this.user))];
88
+ case TAIDOC.readingResult:
89
+ this.report(decodeRecord(this.params.kind, this.recordTime, frame, this.user));
90
+ return this.nextReading();
91
+ case TAIDOC.weightRecord:
92
+ this.report(decodeWeightRecord(frame));
93
+ return this.nextReading();
94
+ default:
95
+ return undefined;
96
+ }
97
+ };
98
+
99
+ /** Requests the next index, then the next user's count, then powers the device off. */
100
+ nextReading = () => {
101
+ if (this.index < this.count) {
102
+ const index = this.index;
103
+ this.index += 1;
104
+ return [this.params.kind === "scale" ? this.send(weightRecordCommand(index), SCALE_RECORD_DELAY_MS) : this.send(readingCommand(TAIDOC.readingTime, index, this.user))];
105
+ }
106
+ if (this.user < this.maxUser) {
107
+ this.user += 1;
108
+ return [this.send(readingCountCommand(this.user))];
109
+ }
110
+ this.ended = true;
111
+ return [this.send(taidocCommand(TAIDOC.shutdown))];
112
+ };
113
+ report = reading => {
114
+ if (reading) {
115
+ this.params.onResult({
116
+ caseType: CaseType.RESULT,
117
+ ...reading
118
+ });
119
+ }
120
+ };
121
+ now = () => this.params.now?.() ?? new Date();
122
+ send = (frame, delayBeforeWriteMs) => {
123
+ // A re-send goes out at once: the start delay only settles the link after connecting.
124
+ this.last = {
125
+ serviceUuid: TAIDOC_SERVICE,
126
+ characteristicUuid: TAIDOC_CHARACTERISTIC,
127
+ frame
128
+ };
129
+ return delayBeforeWriteMs ? {
130
+ ...this.last,
131
+ delayBeforeWriteMs
132
+ } : this.last;
133
+ };
134
+ }
135
+ export { TaidocSequencer };
136
+ //# sourceMappingURL=taidoc.sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CaseType","commandOf","isHostFrame","readCount","readingCommand","readingCountCommand","setTimeCommand","TAIDOC","TAIDOC_CHARACTERISTIC","TAIDOC_SERVICE","taidocCommand","usersFor","weightRecordCommand","decodeRecord","decodeWeightRecord","START_DELAY_MS","multi","bpm","thermometer","oximeter","scale","SCALE_RECORD_DELAY_MS","RESPONSE_TIMEOUT_MS","RETRIES","TaidocSequencer","retries","ended","user","maxUser","count","index","recordTime","constructor","params","initialCommands","send","model","kind","isHistoryTransfer","isNormalDisconnect","commandTimeoutMs","undefined","onCommandTimeout","last","terminal","commands","commandProgress","frame","nextCommand","busy","wakeUp","wakeNotice","users","serial1","serial2","deviceTime","now","setTime","oximeterAfterTime","readingCount","nextReading","readingTime","readingResult","report","weightRecord","shutdown","reading","onResult","caseType","RESULT","Date","delayBeforeWriteMs","serviceUuid","characteristicUuid"],"sourceRoot":"../../../../../../../src","sources":["modules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AAEpE,QAAQ,CAACqE,MAAM;QAAE,GAAGH;MAAQ,CAAC,CAAC;IACjE;EACF,CAAC;EAEOV,GAAG,GAAGA,CAAA,KAAY,IAAI,CAACvB,MAAM,CAACuB,GAAG,GAAG,CAAC,IAAI,IAAIc,IAAI,CAAC,CAAC;EAEnDnC,IAAI,GAAGA,CAACY,KAAwB,EAAEwB,kBAA2B,KAAoB;IACvF;IACA,IAAI,CAAC5B,IAAI,GAAG;MAAE6B,WAAW,EAAE/D,cAAc;MAAEgE,kBAAkB,EAAEjE,qBAAqB;MAAEuC;IAAM,CAAC;IAE7F,OAAOwB,kBAAkB,GAAG;MAAE,GAAG,IAAI,CAAC5B,IAAI;MAAE4B;IAAmB,CAAC,GAAG,IAAI,CAAC5B,IAAI;EAC9E,CAAC;AACH;AAEA,SAASnB,eAAe","ignoreList":[]}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ import { IntegratedDevices } from "../../../types/integrated-devices.js";
4
+ import { BTManagedDevice } from "../bt-managed-device.js";
5
+ import { AOJ_VALUES, LiveOximeterSequencer, readOximeterData } from "../live-oximeter.sequencer.js";
6
+ import { AILINK_GATT, AilinkFrameReader, FIRMWARE_REQUEST, read80bMeasurement, YONKER_GATT } from "./yonker.protocol.js";
7
+ import { YonkerScaleSequencer, YonkerSequencer } from "./yonker.sequencer.js";
8
+ const passThrough = {
9
+ caseValuePosition: [],
10
+ cases: []
11
+ };
12
+ const service = (uuid, notify, optional = false) => ({
13
+ uuid,
14
+ optional,
15
+ monitorUuids: notify.map(monitor => ({
16
+ uuid: monitor,
17
+ parsingModel: passThrough
18
+ }))
19
+ });
20
+
21
+ /** MedM subscribes to all three; the type byte, not the characteristic, says what a frame is. */
22
+ const YONKER_SERVICES = [service(YONKER_GATT.service, [YONKER_GATT.notify, YONKER_GATT.notifyAlternate], true), service(YONKER_GATT.uartService, [YONKER_GATT.uartNotify], true)];
23
+ const SERVICES = {
24
+ [IntegratedDevices.YONKER_OXIMETER]: YONKER_SERVICES,
25
+ [IntegratedDevices.YONKER_BPM]: YONKER_SERVICES,
26
+ [IntegratedDevices.YONKER_THERMOMETER]: YONKER_SERVICES,
27
+ [IntegratedDevices.YONKER_SCALE]: [service(AILINK_GATT.service, [AILINK_GATT.notify])],
28
+ [IntegratedDevices.YONKER_80B]: [service(AILINK_GATT.service, [AILINK_GATT.notify])]
29
+ };
30
+
31
+ /** The YK-80B: MedM asks for the firmware version on connect, then reads the stream. */
32
+ class Yonker80bSequencer extends LiveOximeterSequencer {
33
+ initialCommands = () => [{
34
+ serviceUuid: AILINK_GATT.service,
35
+ characteristicUuid: AILINK_GATT.writeShort,
36
+ frame: FIRMWARE_REQUEST
37
+ }];
38
+ }
39
+ const SEQUENCERS = {
40
+ [IntegratedDevices.YONKER_OXIMETER]: onResult => new LiveOximeterSequencer({
41
+ readValues: frame => readOximeterData(frame, AOJ_VALUES, "spo2-pulse"),
42
+ onResult
43
+ }),
44
+ [IntegratedDevices.YONKER_BPM]: onResult => new YonkerSequencer({
45
+ kind: "blood-pressure",
46
+ onResult
47
+ }),
48
+ [IntegratedDevices.YONKER_THERMOMETER]: onResult => new YonkerSequencer({
49
+ kind: "thermometer",
50
+ onResult
51
+ }),
52
+ [IntegratedDevices.YONKER_SCALE]: onResult => new YonkerScaleSequencer({
53
+ onResult
54
+ }),
55
+ [IntegratedDevices.YONKER_80B]: onResult => new Yonker80bSequencer({
56
+ readValues: read80bMeasurement,
57
+ onResult
58
+ })
59
+ };
60
+
61
+ /**
62
+ * Yonker YK-81C oximeters, YK-BPA blood-pressure monitors, YK-IRT4 thermometers, the AiLink
63
+ * weight scale and the YK-80B oximeter, with their rebrands.
64
+ */
65
+ class YonkerDeviceClass extends BTManagedDevice {
66
+ stuckDataTimeout = 120_000;
67
+ onStreamStart = undefined;
68
+ constructor(device, params) {
69
+ super(device, params);
70
+ this.mainServices = SERVICES[params.deviceName];
71
+ if (params.deviceName === IntegratedDevices.YONKER_SCALE) {
72
+ this.frameReader = new AilinkFrameReader([0xa7]);
73
+ } else if (params.deviceName === IntegratedDevices.YONKER_80B) {
74
+ this.frameReader = new AilinkFrameReader([0xa6, 0xa7]);
75
+ }
76
+ this.createCommandSequencer = () => SEQUENCERS[params.deviceName](result => this.onResult?.(result));
77
+ }
78
+
79
+ /** The oximeter, monitor and thermometer send one frame per notification. */
80
+ validatePackage = () => true;
81
+ handleSuccessResult() {
82
+ return;
83
+ }
84
+ }
85
+ export { YonkerDeviceClass as YonkerDevice };
86
+ //# sourceMappingURL=yonker.device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IntegratedDevices","BTManagedDevice","AOJ_VALUES","LiveOximeterSequencer","readOximeterData","AILINK_GATT","AilinkFrameReader","FIRMWARE_REQUEST","read80bMeasurement","YONKER_GATT","YonkerScaleSequencer","YonkerSequencer","passThrough","caseValuePosition","cases","service","uuid","notify","optional","monitorUuids","map","monitor","parsingModel","YONKER_SERVICES","notifyAlternate","uartService","uartNotify","SERVICES","YONKER_OXIMETER","YONKER_BPM","YONKER_THERMOMETER","YONKER_SCALE","YONKER_80B","Yonker80bSequencer","initialCommands","serviceUuid","characteristicUuid","writeShort","frame","SEQUENCERS","onResult","readValues","kind","YonkerDeviceClass","stuckDataTimeout","onStreamStart","undefined","constructor","device","params","mainServices","deviceName","frameReader","createCommandSequencer","result","validatePackage","handleSuccessResult","YonkerDevice"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/yonker/yonker.device.ts"],"mappings":";;AAKA,SAASA,iBAAiB,QAAQ,sCAAmC;AAGrE,SAASC,eAAe,QAAQ,yBAAsB;AACtD,SAASC,UAAU,EAAEC,qBAAqB,EAAEC,gBAAgB,QAAQ,+BAA4B;AAEhG,SACEC,WAAW,EACXC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,WAAW,QACN,sBAAmB;AAC1B,SAASC,oBAAoB,EAAEC,eAAe,QAAQ,uBAAoB;AAW1E,MAAMC,WAAW,GAAG;EAAEC,iBA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AI,CAACoB,WAAW,GAAG,IAAI9C,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD;IAEA,IAAI,CAAC+C,sBAAsB,GAAG,MAC5Bd,UAAU,CAACU,MAAM,CAACE,UAAU,CAAC,CAAEG,MAAM,IACnC,IAAI,CAACd,QAAQ,GACXc,MACF,CACF,CAAC;EACL;;EAEA;EACUC,eAAe,GAAGA,CAAA,KAAe,IAAI;EAErCC,mBAAmBA,CAAA,EAAS;IACpC;EACF;AACF;AAEA,SAASb,iBAAiB,IAAIc,YAAY","ignoreList":[]}
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+
5
+ import { FrameReadStatus } from "../../../types/frame-read-status.js";
6
+ import { hexToByte } from "../../../utils/hex-to-byte.js";
7
+ /**
8
+ * Yonker devices and their rebrands, from MedM Health Diary 3.12.11's `CYonker_*` classes.
9
+ *
10
+ * The oximeter, blood-pressure monitor and thermometer share one GATT map and send one frame
11
+ * per notification: a type byte (`80` live, `81` result) and its values, no length, no
12
+ * checksum. The scale (an AiLink module, MedM's `CConmo_WeightScale`) and the YK-80B oximeter
13
+ * frame everything as `A6|A7 xx xx LL CMD body CS 7A`.
14
+ */
15
+ const sig16 = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
16
+ export const YONKER_GATT = {
17
+ service: "cdeacd80-5235-4c07-8846-93a37ee6b86d",
18
+ notify: "cdeacd81-5235-4c07-8846-93a37ee6b86d",
19
+ notifyAlternate: "cdeacd82-5235-4c07-8846-93a37ee6b86d",
20
+ /** Nordic UART; MedM subscribes to its `…0002` characteristic. */
21
+ uartService: "6e400001-b5a3-f393-e0a9-e50e24dcca9e",
22
+ uartNotify: "6e400002-b5a3-f393-e0a9-e50e24dcca9e",
23
+ /** Where the blood-pressure monitor takes its clock. */
24
+ timeService: sig16("1804"),
25
+ timeWrite: sig16("2a07")
26
+ };
27
+
28
+ /** The scale and the YK-80B: notify on `ffe2`, long frames to `ffe1`, short ones to `ffe3`. */
29
+ export const AILINK_GATT = {
30
+ service: sig16("ffe0"),
31
+ writeLong: sig16("ffe1"),
32
+ notify: sig16("ffe2"),
33
+ writeShort: sig16("ffe3")
34
+ };
35
+ const bytes = frame => frame.map(byte => hexToByte(byte));
36
+ const toHex = values => values.map(value => (value & 0xff).toString(16).padStart(2, "0"));
37
+ const sum = values => values.reduce((total, value) => total + value, 0) & 0xff;
38
+
39
+ /** `8F YY MM DD hh mm` and nine zero bytes, local time. */
40
+ export const bpmSetTimeCommand = now => toHex([0x8f, now.getFullYear() - 2000, now.getMonth() + 1, now.getDate(), now.getHours(), now.getMinutes(), ...new Array(9).fill(0)]);
41
+
42
+ /**
43
+ * `81 SYS DIA PULSE USER RECORD YY MM DD hh mm`, mmHg, local time. A zero year means the clock
44
+ * was never set, and the phone's time is used, as MedM does.
45
+ */
46
+ export const readYonkerBloodPressure = (frame, now) => {
47
+ const b = bytes(frame);
48
+ if (b.length < 11 || b[0] !== 0x81 || !b[1] || !b[2]) {
49
+ return undefined;
50
+ }
51
+ const year = b[6] ?? 0;
52
+ const user = b[4] ?? 0;
53
+ return {
54
+ systolic: b[1],
55
+ diastolic: b[2],
56
+ ...(b[3] ? {
57
+ heartRate: b[3]
58
+ } : {}),
59
+ recordedAt: year === 0 ? now : new Date(2000 + year, (b[7] ?? 1) - 1, b[8] ?? 1, b[9] ?? 0, b[10] ?? 0),
60
+ ...(user > 0 ? {
61
+ memorySlot: user
62
+ } : {})
63
+ };
64
+ };
65
+
66
+ /**
67
+ * `80 hi lo FLAGS X`: hundredths of a degree; flags bit 1 marks Fahrenheit, which MedM ignores
68
+ * and the SDK converts.
69
+ */
70
+ export const readYonkerTemperature = frame => {
71
+ const b = bytes(frame);
72
+ if (b.length < 5 || b[0] !== 0x80) {
73
+ return undefined;
74
+ }
75
+ const value = ((b[1] ?? 0) << 8 | (b[2] ?? 0)) / 100;
76
+ if (value === 0) {
77
+ return undefined;
78
+ }
79
+ return ((b[3] ?? 0) & 0x02) !== 0 ? Math.round((value - 32) * 5 / 9 * 100) / 100 : value;
80
+ };
81
+
82
+ /** `A7 ID ID (n+1) CMD payload CS 7A`, the checksum covering everything but the first byte. */
83
+ export const longFrame = (id, command, payload = []) => {
84
+ const covered = [id >> 8, id & 0xff, payload.length + 1, command, ...payload];
85
+ return toHex([0xa7, ...covered, sum(covered), 0x7a]);
86
+ };
87
+
88
+ /** `A6 (n+1) CMD payload CS 6A`. */
89
+ export const shortFrame = (command, payload = []) => {
90
+ const covered = [payload.length + 1, command, ...payload];
91
+ return toHex([0xa6, ...covered, sum(covered), 0x6a]);
92
+ };
93
+
94
+ /** Scale set time, command `37`: `YY MM DD hh mm ss weekday` (Sunday 1), local time. */
95
+ export const scaleSetTimeCommand = now => shortFrame(0x37, [now.getFullYear() - 2000, now.getMonth() + 1, now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getDay() + 1]);
96
+ export const idOf = frame => hexToByte(frame[1] ?? "00") << 8 | hexToByte(frame[2] ?? "00");
97
+ export const commandOf = frame => hexToByte(frame[4] ?? "00");
98
+ export const bodyOf = frame => bytes(frame.slice(5, -2));
99
+
100
+ /**
101
+ * Scale weight, command `02`: a u24 big-endian raw value, then precision (high nibble, decimal
102
+ * places) and unit (low nibble). Only kilograms (unit 0) are accepted - the SDK sets the scale to
103
+ * kilograms, and the other unit codes are not documented.
104
+ */
105
+ export const readScaleWeight = body => {
106
+ const raw = (body[0] ?? 0) << 16 | (body[1] ?? 0) << 8 | (body[2] ?? 0);
107
+ const format = body[3] ?? 0;
108
+ if (body.length < 4 || raw === 0 || (format & 0x0f) !== 0) {
109
+ return undefined;
110
+ }
111
+ return raw / 10 ** (format >> 4);
112
+ };
113
+
114
+ /**
115
+ * YK-80B measurement, command `03`: status, SpO2, pulse, PI×10, battery, RR×10, waveform, bar,
116
+ * worn. Dropped when the status or worn flag is zero or the SpO2 is `FF`, as MedM does.
117
+ */
118
+ export const read80bMeasurement = frame => {
119
+ const body = bodyOf(frame);
120
+ if (commandOf(frame) !== 0x03 || body.length < 9) {
121
+ return undefined;
122
+ }
123
+ const [status = 0, bloodOxygen = 0, pulseRate = 0, perfusionIndex = 0] = body;
124
+ if (status === 0 || body[8] === 0 || bloodOxygen === 0 || bloodOxygen > 100 || pulseRate === 0 || pulseRate === 0xff) {
125
+ return undefined;
126
+ }
127
+ return {
128
+ bloodOxygen,
129
+ pulseRate,
130
+ ...(perfusionIndex > 0 && perfusionIndex !== 0xff ? {
131
+ perfusionIndex: perfusionIndex / 10
132
+ } : {})
133
+ };
134
+ };
135
+
136
+ /** YK-80B firmware request, the one command MedM writes to it. */
137
+ export const FIRMWARE_REQUEST = shortFrame(0x0e);
138
+
139
+ /** Isolates checked `A7 … 7A` frames (and `A6 … 7A` for the YK-80B) across notifications. */
140
+ export class AilinkFrameReader {
141
+ constructor(starts) {
142
+ this.starts = starts;
143
+ }
144
+ readFrame(buffer) {
145
+ const values = bytes(buffer);
146
+ const start = values.findIndex(value => this.starts.includes(value));
147
+ if (start === -1) {
148
+ return {
149
+ status: FrameReadStatus.INCOMPLETE,
150
+ consumedBytes: values.length
151
+ };
152
+ }
153
+ if (start + 4 > values.length) {
154
+ return {
155
+ status: FrameReadStatus.INCOMPLETE,
156
+ consumedBytes: start
157
+ };
158
+ }
159
+ const length = (values[start + 3] ?? 0) + 6;
160
+ if (length < 7) {
161
+ return {
162
+ status: FrameReadStatus.CORRUPT,
163
+ consumedBytes: start + 1
164
+ };
165
+ }
166
+ if (start + length > values.length) {
167
+ return {
168
+ status: FrameReadStatus.INCOMPLETE,
169
+ consumedBytes: start
170
+ };
171
+ }
172
+ const received = values.slice(start, start + length);
173
+ if (received[length - 1] !== 0x7a || received[length - 2] !== sum(received.slice(1, -2))) {
174
+ return {
175
+ status: FrameReadStatus.CORRUPT,
176
+ consumedBytes: start + 1
177
+ };
178
+ }
179
+ return {
180
+ status: FrameReadStatus.COMPLETE,
181
+ consumedBytes: start + length,
182
+ frame: buffer.slice(start, start + length)
183
+ };
184
+ }
185
+ }
186
+ //# sourceMappingURL=yonker.protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FrameReadStatus","hexToByte","sig16","assigned","YONKER_GATT","service","notify","notifyAlternate","uartService","uartNotify","timeService","timeWrite","AILINK_GATT","writeLong","writeShort","bytes","frame","map","byte","toHex","values","value","toString","padStart","sum","reduce","total","bpmSetTimeCommand","now","getFullYear","getMonth","getDate","getHours","getMinutes","Array","fill","readYonkerBloodPressure","b","length","undefined","year","user","systolic","diastolic","heartRate","recordedAt","Date","memorySlot","readYonkerTemperature","Math","round","longFrame","id","command","payload","covered","shortFrame","scaleSetTimeCommand","getSeconds","getDay","idOf","commandOf","bodyOf","slice","readScaleWeight","body","raw","format","read80bMeasurement","status","bloodOxygen","pulseRate","perfusionIndex","FIRMWARE_REQUEST","AilinkFrameReader","constructor","starts","readFrame","buffer","start","findIndex","includes","INCOMPLETE","consumedBytes","CORRUPT","received","COMPLETE"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/yonker/yonker.protocol.ts"],"mappings":";;AAAA;;AAGA,SAASA,eAAe,QAAQ,qCAAkC;AAElE,SAASC,SAAS,QAAQ,+BAA4B;AAGtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAIC,QAAgB,IAAa,OAAOA,QAAQ,8BAA8B;AAEzF,OAAO,MAAMC,WAAW,GAAG;EACzBC,OAAO,EAAE,sCAAsC;EAC/CC,MAAM,EAAE,sCAAsC;EAC9CC,eAAe,EAAE,sCAAsC;EAEvD;EACAC,WAAW,EAAE,sCAAsC;EACnDC,UAAU,EAAE,sCAAsC;EAElD;EACAC,WAAW,EAAER,KAAK,CAAC,MAAM,CAAC;EAC1BS,SAAS,EAAET,KAAK,CAAC,MAAM;AACzB,CAAU;;AAEV;AACA,OAAO,MAAMU,WAAW,GAAG;EACzBP,OAAO,EAAEH,KAAK,CAAC,MAAM,CAAC;EACtBW,SAAS,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