@stoprocent/noble 1.9.2-16
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.
- package/.editorconfig +11 -0
- package/.eslintrc.js +25 -0
- package/.github/FUNDING.yml +2 -0
- package/.github/workflows/fediverse-action.yml +16 -0
- package/.github/workflows/nodepackage.yml +77 -0
- package/.github/workflows/npm-publish.yml +26 -0
- package/.github/workflows/prebuild.yml +65 -0
- package/.nycrc.json +4 -0
- package/CHANGELOG.md +119 -0
- package/LICENSE +20 -0
- package/MAINTAINERS.md +1 -0
- package/README.md +833 -0
- package/assets/noble-logo.png +0 -0
- package/assets/noble-logo.svg +13 -0
- package/binding.gyp +19 -0
- package/codecov.yml +5 -0
- package/examples/advertisement-discovery.js +65 -0
- package/examples/cache-gatt-discovery.js +198 -0
- package/examples/cache-gatt-reconnect.js +164 -0
- package/examples/echo.js +104 -0
- package/examples/enter-exit.js +78 -0
- package/examples/peripheral-explorer-async.js +133 -0
- package/examples/peripheral-explorer.js +225 -0
- package/examples/pizza/README.md +15 -0
- package/examples/pizza/central.js +194 -0
- package/examples/pizza/pizza.js +60 -0
- package/index.d.ts +203 -0
- package/index.js +6 -0
- package/lib/characteristic.js +161 -0
- package/lib/characteristics.json +449 -0
- package/lib/descriptor.js +72 -0
- package/lib/descriptors.json +47 -0
- package/lib/distributed/bindings.js +326 -0
- package/lib/hci-socket/acl-stream.js +60 -0
- package/lib/hci-socket/bindings.js +788 -0
- package/lib/hci-socket/crypto.js +74 -0
- package/lib/hci-socket/gap.js +432 -0
- package/lib/hci-socket/gatt.js +809 -0
- package/lib/hci-socket/hci-status.json +71 -0
- package/lib/hci-socket/hci.js +1264 -0
- package/lib/hci-socket/signaling.js +76 -0
- package/lib/hci-socket/smp.js +140 -0
- package/lib/hci-uart/bindings.js +569 -0
- package/lib/hci-uart/hci-serial-parser.js +70 -0
- package/lib/hci-uart/hci.js +1336 -0
- package/lib/mac/binding.gyp +26 -0
- package/lib/mac/bindings.js +11 -0
- package/lib/mac/src/ble_manager.h +41 -0
- package/lib/mac/src/ble_manager.mm +435 -0
- package/lib/mac/src/callbacks.cc +222 -0
- package/lib/mac/src/callbacks.h +84 -0
- package/lib/mac/src/napi_objc.h +12 -0
- package/lib/mac/src/napi_objc.mm +50 -0
- package/lib/mac/src/noble_mac.h +34 -0
- package/lib/mac/src/noble_mac.mm +264 -0
- package/lib/mac/src/objc_cpp.h +26 -0
- package/lib/mac/src/objc_cpp.mm +126 -0
- package/lib/mac/src/peripheral.h +23 -0
- package/lib/manufacture.js +48 -0
- package/lib/noble.js +593 -0
- package/lib/peripheral.js +219 -0
- package/lib/resolve-bindings-web.js +9 -0
- package/lib/resolve-bindings.js +44 -0
- package/lib/service.js +72 -0
- package/lib/services.json +92 -0
- package/lib/webbluetooth/bindings.js +368 -0
- package/lib/websocket/bindings.js +321 -0
- package/lib/win/binding.gyp +23 -0
- package/lib/win/bindings.js +11 -0
- package/lib/win/src/ble_manager.cc +802 -0
- package/lib/win/src/ble_manager.h +77 -0
- package/lib/win/src/callbacks.cc +274 -0
- package/lib/win/src/callbacks.h +33 -0
- package/lib/win/src/napi_winrt.cc +76 -0
- package/lib/win/src/napi_winrt.h +12 -0
- package/lib/win/src/noble_winrt.cc +308 -0
- package/lib/win/src/noble_winrt.h +34 -0
- package/lib/win/src/notify_map.cc +62 -0
- package/lib/win/src/notify_map.h +50 -0
- package/lib/win/src/peripheral.h +23 -0
- package/lib/win/src/peripheral_winrt.cc +296 -0
- package/lib/win/src/peripheral_winrt.h +82 -0
- package/lib/win/src/radio_watcher.cc +125 -0
- package/lib/win/src/radio_watcher.h +61 -0
- package/lib/win/src/winrt_cpp.cc +82 -0
- package/lib/win/src/winrt_cpp.h +11 -0
- package/lib/win/src/winrt_guid.cc +12 -0
- package/lib/win/src/winrt_guid.h +13 -0
- package/misc/nrf52840dk.hex +6921 -0
- package/misc/prj.conf +43 -0
- package/package.json +96 -0
- package/test/lib/characteristic.test.js +791 -0
- package/test/lib/descriptor.test.js +249 -0
- package/test/lib/distributed/bindings.test.js +918 -0
- package/test/lib/hci-socket/acl-stream.test.js +188 -0
- package/test/lib/hci-socket/bindings.test.js +1756 -0
- package/test/lib/hci-socket/crypto.test.js +55 -0
- package/test/lib/hci-socket/gap.test.js +1089 -0
- package/test/lib/hci-socket/gatt.test.js +2392 -0
- package/test/lib/hci-socket/hci.test.js +1891 -0
- package/test/lib/hci-socket/signaling.test.js +94 -0
- package/test/lib/hci-socket/smp.test.js +268 -0
- package/test/lib/manufacture.test.js +77 -0
- package/test/lib/peripheral.test.js +623 -0
- package/test/lib/resolve-bindings.test.js +102 -0
- package/test/lib/service.test.js +195 -0
- package/test/lib/webbluetooth/bindings.test.js +190 -0
- package/test/lib/websocket/bindings.test.js +456 -0
- package/test/noble.test.js +1565 -0
- package/test.js +131 -0
- package/with-bindings.js +5 -0
- package/ws-slave.js +404 -0
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
{
|
|
2
|
+
"2a00" : { "name" : "Device Name"
|
|
3
|
+
, "type" : "org.bluetooth.characteristic.gap.device_name"
|
|
4
|
+
}
|
|
5
|
+
, "2a01" : { "name" : "Appearance"
|
|
6
|
+
, "type" : "org.bluetooth.characteristic.gap.appearance"
|
|
7
|
+
}
|
|
8
|
+
, "2a02" : { "name" : "Peripheral Privacy Flag"
|
|
9
|
+
, "type" : "org.bluetooth.characteristic.gap.peripheral_privacy_flag"
|
|
10
|
+
}
|
|
11
|
+
, "2a03" : { "name" : "Reconnection Address"
|
|
12
|
+
, "type" : "org.bluetooth.characteristic.gap.reconnection_address"
|
|
13
|
+
}
|
|
14
|
+
, "2a04" : { "name" : "Peripheral Preferred Connection Parameters"
|
|
15
|
+
, "type" : "org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters"
|
|
16
|
+
}
|
|
17
|
+
, "2a05" : { "name" : "Service Changed"
|
|
18
|
+
, "type" : "org.bluetooth.characteristic.gatt.service_changed"
|
|
19
|
+
}
|
|
20
|
+
, "2a06" : { "name" : "Alert Level"
|
|
21
|
+
, "type" : "org.bluetooth.characteristic.alert_level"
|
|
22
|
+
}
|
|
23
|
+
, "2a07" : { "name" : "Tx Power Level"
|
|
24
|
+
, "type" : "org.bluetooth.characteristic.tx_power_level"
|
|
25
|
+
}
|
|
26
|
+
, "2a08" : { "name" : "Date Time"
|
|
27
|
+
, "type" : "org.bluetooth.characteristic.date_time"
|
|
28
|
+
}
|
|
29
|
+
, "2a09" : { "name" : "Day of Week"
|
|
30
|
+
, "type" : "org.bluetooth.characteristic.day_of_week"
|
|
31
|
+
}
|
|
32
|
+
, "2a0a" : { "name" : "Day Date Time"
|
|
33
|
+
, "type" : "org.bluetooth.characteristic.day_date_time"
|
|
34
|
+
}
|
|
35
|
+
, "2a0c" : { "name" : "Exact Time 256"
|
|
36
|
+
, "type" : "org.bluetooth.characteristic.exact_time_256"
|
|
37
|
+
}
|
|
38
|
+
, "2a0d" : { "name" : "DST Offset"
|
|
39
|
+
, "type" : "org.bluetooth.characteristic.dst_offset"
|
|
40
|
+
}
|
|
41
|
+
, "2a0e" : { "name" : "Time Zone"
|
|
42
|
+
, "type" : "org.bluetooth.characteristic.time_zone"
|
|
43
|
+
}
|
|
44
|
+
, "2a0f" : { "name" : "Local Time Information"
|
|
45
|
+
, "type" : "org.bluetooth.characteristic.local_time_information"
|
|
46
|
+
}
|
|
47
|
+
, "2a11" : { "name" : "Time with DST"
|
|
48
|
+
, "type" : "org.bluetooth.characteristic.time_with_dst"
|
|
49
|
+
}
|
|
50
|
+
, "2a12" : { "name" : "Time Accuracy"
|
|
51
|
+
, "type" : "org.bluetooth.characteristic.time_accuracy"
|
|
52
|
+
}
|
|
53
|
+
, "2a13" : { "name" : "Time Source"
|
|
54
|
+
, "type" : "org.bluetooth.characteristic.time_source"
|
|
55
|
+
}
|
|
56
|
+
, "2a14" : { "name" : "Reference Time Information"
|
|
57
|
+
, "type" : "org.bluetooth.characteristic.reference_time_information"
|
|
58
|
+
}
|
|
59
|
+
, "2a16" : { "name" : "Time Update Control Point"
|
|
60
|
+
, "type" : "org.bluetooth.characteristic.time_update_control_point"
|
|
61
|
+
}
|
|
62
|
+
, "2a17" : { "name" : "Time Update State"
|
|
63
|
+
, "type" : "org.bluetooth.characteristic.time_update_state"
|
|
64
|
+
}
|
|
65
|
+
, "2a18" : { "name" : "Glucose Measurement"
|
|
66
|
+
, "type" : "org.bluetooth.characteristic.glucose_measurement"
|
|
67
|
+
}
|
|
68
|
+
, "2a19" : { "name" : "Battery Level"
|
|
69
|
+
, "type" : "org.bluetooth.characteristic.battery_level"
|
|
70
|
+
}
|
|
71
|
+
, "2a1c" : { "name" : "Temperature Measurement"
|
|
72
|
+
, "type" : "org.bluetooth.characteristic.temperature_measurement"
|
|
73
|
+
}
|
|
74
|
+
, "2a1d" : { "name" : "Temperature Type"
|
|
75
|
+
, "type" : "org.bluetooth.characteristic.temperature_type"
|
|
76
|
+
}
|
|
77
|
+
, "2a1e" : { "name" : "Intermediate Temperature"
|
|
78
|
+
, "type" : "org.bluetooth.characteristic.intermediate_temperature"
|
|
79
|
+
}
|
|
80
|
+
, "2a21" : { "name" : "Measurement Interval"
|
|
81
|
+
, "type" : "org.bluetooth.characteristic.measurement_interval"
|
|
82
|
+
}
|
|
83
|
+
, "2a22" : { "name" : "Boot Keyboard Input Report"
|
|
84
|
+
, "type" : "org.bluetooth.characteristic.boot_keyboard_input_report"
|
|
85
|
+
}
|
|
86
|
+
, "2a23" : { "name" : "System ID"
|
|
87
|
+
, "type" : "org.bluetooth.characteristic.system_id"
|
|
88
|
+
}
|
|
89
|
+
, "2a24" : { "name" : "Model Number String"
|
|
90
|
+
, "type" : "org.bluetooth.characteristic.model_number_string"
|
|
91
|
+
}
|
|
92
|
+
, "2a25" : { "name" : "Serial Number String"
|
|
93
|
+
, "type" : "org.bluetooth.characteristic.serial_number_string"
|
|
94
|
+
}
|
|
95
|
+
, "2a26" : { "name" : "Firmware Revision String"
|
|
96
|
+
, "type" : "org.bluetooth.characteristic.firmware_revision_string"
|
|
97
|
+
}
|
|
98
|
+
, "2a27" : { "name" : "Hardware Revision String"
|
|
99
|
+
, "type" : "org.bluetooth.characteristic.hardware_revision_string"
|
|
100
|
+
}
|
|
101
|
+
, "2a28" : { "name" : "Software Revision String"
|
|
102
|
+
, "type" : "org.bluetooth.characteristic.software_revision_string"
|
|
103
|
+
}
|
|
104
|
+
, "2a29" : { "name" : "Manufacturer Name String"
|
|
105
|
+
, "type" : "org.bluetooth.characteristic.manufacturer_name_string"
|
|
106
|
+
}
|
|
107
|
+
, "2a2a" : { "name" : "IEEE 11073-20601 Regulatory Certification Data List"
|
|
108
|
+
, "type" : "org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list"
|
|
109
|
+
}
|
|
110
|
+
, "2a2b" : { "name" : "Current Time"
|
|
111
|
+
, "type" : "org.bluetooth.characteristic.current_time"
|
|
112
|
+
}
|
|
113
|
+
, "2a2c" : { "name" : "Magnetic Declination"
|
|
114
|
+
, "type" : "org.bluetooth.characteristic.magnetic_declination"
|
|
115
|
+
}
|
|
116
|
+
, "2a31" : { "name" : "Scan Refresh"
|
|
117
|
+
, "type" : "org.bluetooth.characteristic.scan_refresh"
|
|
118
|
+
}
|
|
119
|
+
, "2a32" : { "name" : "Boot Keyboard Output Report"
|
|
120
|
+
, "type" : "org.bluetooth.characteristic.boot_keyboard_output_report"
|
|
121
|
+
}
|
|
122
|
+
, "2a33" : { "name" : "Boot Mouse Input Report"
|
|
123
|
+
, "type" : "org.bluetooth.characteristic.boot_mouse_input_report"
|
|
124
|
+
}
|
|
125
|
+
, "2a34" : { "name" : "Glucose Measurement Context"
|
|
126
|
+
, "type" : "org.bluetooth.characteristic.glucose_measurement_context"
|
|
127
|
+
}
|
|
128
|
+
, "2a35" : { "name" : "Blood Pressure Measurement"
|
|
129
|
+
, "type" : "org.bluetooth.characteristic.blood_pressure_measurement"
|
|
130
|
+
}
|
|
131
|
+
, "2a36" : { "name" : "Intermediate Cuff Pressure"
|
|
132
|
+
, "type" : "org.bluetooth.characteristic.intermediate_blood_pressure"
|
|
133
|
+
}
|
|
134
|
+
, "2a37" : { "name" : "Heart Rate Measurement"
|
|
135
|
+
, "type" : "org.bluetooth.characteristic.heart_rate_measurement"
|
|
136
|
+
}
|
|
137
|
+
, "2a38" : { "name" : "Body Sensor Location"
|
|
138
|
+
, "type" : "org.bluetooth.characteristic.body_sensor_location"
|
|
139
|
+
}
|
|
140
|
+
, "2a39" : { "name" : "Heart Rate Control Point"
|
|
141
|
+
, "type" : "org.bluetooth.characteristic.heart_rate_control_point"
|
|
142
|
+
}
|
|
143
|
+
, "2a3f" : { "name" : "Alert Status"
|
|
144
|
+
, "type" : "org.bluetooth.characteristic.alert_status"
|
|
145
|
+
}
|
|
146
|
+
, "2a40" : { "name" : "Ringer Control Point"
|
|
147
|
+
, "type" : "org.bluetooth.characteristic.ringer_control_point"
|
|
148
|
+
}
|
|
149
|
+
, "2a41" : { "name" : "Ringer Setting"
|
|
150
|
+
, "type" : "org.bluetooth.characteristic.ringer_setting"
|
|
151
|
+
}
|
|
152
|
+
, "2a42" : { "name" : "Alert Category ID Bit Mask"
|
|
153
|
+
, "type" : "org.bluetooth.characteristic.alert_category_id_bit_mask"
|
|
154
|
+
}
|
|
155
|
+
, "2a43" : { "name" : "Alert Category ID"
|
|
156
|
+
, "type" : "org.bluetooth.characteristic.alert_category_id"
|
|
157
|
+
}
|
|
158
|
+
, "2a44" : { "name" : "Alert Notification Control Point"
|
|
159
|
+
, "type" : "org.bluetooth.characteristic.alert_notification_control_point"
|
|
160
|
+
}
|
|
161
|
+
, "2a45" : { "name" : "Unread Alert Status"
|
|
162
|
+
, "type" : "org.bluetooth.characteristic.unread_alert_status"
|
|
163
|
+
}
|
|
164
|
+
, "2a46" : { "name" : "New Alert"
|
|
165
|
+
, "type" : "org.bluetooth.characteristic.new_alert"
|
|
166
|
+
}
|
|
167
|
+
, "2a47" : { "name" : "Supported New Alert Category"
|
|
168
|
+
, "type" : "org.bluetooth.characteristic.supported_new_alert_category"
|
|
169
|
+
}
|
|
170
|
+
, "2a48" : { "name" : "Supported Unread Alert Category"
|
|
171
|
+
, "type" : "org.bluetooth.characteristic.supported_unread_alert_category"
|
|
172
|
+
}
|
|
173
|
+
, "2a49" : { "name" : "Blood Pressure Feature"
|
|
174
|
+
, "type" : "org.bluetooth.characteristic.blood_pressure_feature"
|
|
175
|
+
}
|
|
176
|
+
, "2a4a" : { "name" : "HID Information"
|
|
177
|
+
, "type" : "org.bluetooth.characteristic.hid_information"
|
|
178
|
+
}
|
|
179
|
+
, "2a4b" : { "name" : "Report Map"
|
|
180
|
+
, "type" : "org.bluetooth.characteristic.report_map"
|
|
181
|
+
}
|
|
182
|
+
, "2a4c" : { "name" : "HID Control Point"
|
|
183
|
+
, "type" : "org.bluetooth.characteristic.hid_control_point"
|
|
184
|
+
}
|
|
185
|
+
, "2a4d" : { "name" : "Report"
|
|
186
|
+
, "type" : "org.bluetooth.characteristic.report"
|
|
187
|
+
}
|
|
188
|
+
, "2a4e" : { "name" : "Protocol Mode"
|
|
189
|
+
, "type" : "org.bluetooth.characteristic.protocol_mode"
|
|
190
|
+
}
|
|
191
|
+
, "2a4f" : { "name" : "Scan Interval Window"
|
|
192
|
+
, "type" : "org.bluetooth.characteristic.scan_interval_window"
|
|
193
|
+
}
|
|
194
|
+
, "2a50" : { "name" : "PnP ID"
|
|
195
|
+
, "type" : "org.bluetooth.characteristic.pnp_id"
|
|
196
|
+
}
|
|
197
|
+
, "2a51" : { "name" : "Glucose Feature"
|
|
198
|
+
, "type" : "org.bluetooth.characteristic.glucose_feature"
|
|
199
|
+
}
|
|
200
|
+
, "2a52" : { "name" : "Record Access Control Point"
|
|
201
|
+
, "type" : "org.bluetooth.characteristic.record_access_control_point"
|
|
202
|
+
}
|
|
203
|
+
, "2a53" : { "name" : "RSC Measurement"
|
|
204
|
+
, "type" : "org.bluetooth.characteristic.rsc_measurement"
|
|
205
|
+
}
|
|
206
|
+
, "2a54" : { "name" : "RSC Feature"
|
|
207
|
+
, "type" : "org.bluetooth.characteristic.rsc_feature"
|
|
208
|
+
}
|
|
209
|
+
, "2a55" : { "name" : "SC Control Point"
|
|
210
|
+
, "type" : "org.bluetooth.characteristic.sc_control_point"
|
|
211
|
+
}
|
|
212
|
+
, "2a56" : { "name" : "Digital"
|
|
213
|
+
, "type" : "org.bluetooth.characteristic.digital"
|
|
214
|
+
}
|
|
215
|
+
, "2a58" : { "name" : "Analog"
|
|
216
|
+
, "type" : "org.bluetooth.characteristic.analog"
|
|
217
|
+
}
|
|
218
|
+
, "2a5a" : { "name" : "Aggregate"
|
|
219
|
+
, "type" : "org.bluetooth.characteristic.aggregate"
|
|
220
|
+
}
|
|
221
|
+
, "2a5b" : { "name" : "CSC Measurement"
|
|
222
|
+
, "type" : "org.bluetooth.characteristic.csc_measurement"
|
|
223
|
+
}
|
|
224
|
+
, "2a5c" : { "name" : "CSC Feature"
|
|
225
|
+
, "type" : "org.bluetooth.characteristic.csc_feature"
|
|
226
|
+
}
|
|
227
|
+
, "2a5d" : { "name" : "Sensor Location"
|
|
228
|
+
, "type" : "org.bluetooth.characteristic.sensor_location"
|
|
229
|
+
}
|
|
230
|
+
, "2a63" : { "name" : "Cycling Power Measurement"
|
|
231
|
+
, "type" : "org.bluetooth.characteristic.cycling_power_measurement"
|
|
232
|
+
}
|
|
233
|
+
, "2a64" : { "name" : "Cycling Power Vector"
|
|
234
|
+
, "type" : "org.bluetooth.characteristic.cycling_power_vector"
|
|
235
|
+
}
|
|
236
|
+
, "2a65" : { "name" : "Cycling Power Feature"
|
|
237
|
+
, "type" : "org.bluetooth.characteristic.cycling_power_feature"
|
|
238
|
+
}
|
|
239
|
+
, "2a66" : { "name" : "Cycling Power Control Point"
|
|
240
|
+
, "type" : "org.bluetooth.characteristic.cycling_power_control_point"
|
|
241
|
+
}
|
|
242
|
+
, "2a67" : { "name" : "Location and Speed"
|
|
243
|
+
, "type" : "org.bluetooth.characteristic.location_and_speed"
|
|
244
|
+
}
|
|
245
|
+
, "2a68" : { "name" : "Navigation"
|
|
246
|
+
, "type" : "org.bluetooth.characteristic.navigation"
|
|
247
|
+
}
|
|
248
|
+
, "2a69" : { "name" : "Position Quality"
|
|
249
|
+
, "type" : "org.bluetooth.characteristic.position_quality"
|
|
250
|
+
}
|
|
251
|
+
, "2a6a" : { "name" : "LN Feature"
|
|
252
|
+
, "type" : "org.bluetooth.characteristic.ln_feature"
|
|
253
|
+
}
|
|
254
|
+
, "2a6b" : { "name" : "LN Control Point"
|
|
255
|
+
, "type" : "org.bluetooth.characteristic.ln_control_point"
|
|
256
|
+
}
|
|
257
|
+
, "2a6c" : { "name" : "Elevation"
|
|
258
|
+
, "type" : "org.bluetooth.characteristic.elevation"
|
|
259
|
+
}
|
|
260
|
+
, "2a6d" : { "name" : "Pressure"
|
|
261
|
+
, "type" : "org.bluetooth.characteristic.pressure"
|
|
262
|
+
}
|
|
263
|
+
, "2a6e" : { "name" : "Temperature"
|
|
264
|
+
, "type" : "org.bluetooth.characteristic.temperature"
|
|
265
|
+
}
|
|
266
|
+
, "2a6f" : { "name" : "Humidity"
|
|
267
|
+
, "type" : "org.bluetooth.characteristic.humidity"
|
|
268
|
+
}
|
|
269
|
+
, "2a70" : { "name" : "True Wind Speed"
|
|
270
|
+
, "type" : "org.bluetooth.characteristic.true_wind_speed"
|
|
271
|
+
}
|
|
272
|
+
, "2a71" : { "name" : "True Wind Direction"
|
|
273
|
+
, "type" : "org.bluetooth.characteristic.true_wind_direction"
|
|
274
|
+
}
|
|
275
|
+
, "2a72" : { "name" : "Apparent Wind Speed"
|
|
276
|
+
, "type" : "org.bluetooth.characteristic.apparent_wind_speed"
|
|
277
|
+
}
|
|
278
|
+
, "2a73" : { "name" : "Apparent Wind Direction"
|
|
279
|
+
, "type" : "org.bluetooth.characteristic.apparent_wind_direction"
|
|
280
|
+
}
|
|
281
|
+
, "2a74" : { "name" : "Gust Factor"
|
|
282
|
+
, "type" : "org.bluetooth.characteristic.gust_factor"
|
|
283
|
+
}
|
|
284
|
+
, "2a75" : { "name" : "Pollen Concentration"
|
|
285
|
+
, "type" : "org.bluetooth.characteristic.pollen_concentration"
|
|
286
|
+
}
|
|
287
|
+
, "2a76" : { "name" : "UV Index"
|
|
288
|
+
, "type" : "org.bluetooth.characteristic.uv_index"
|
|
289
|
+
}
|
|
290
|
+
, "2a77" : { "name" : "Irradiance"
|
|
291
|
+
, "type" : "org.bluetooth.characteristic.irradiance"
|
|
292
|
+
}
|
|
293
|
+
, "2a78" : { "name" : "Rainfall"
|
|
294
|
+
, "type" : "org.bluetooth.characteristic.rainfall"
|
|
295
|
+
}
|
|
296
|
+
, "2a79" : { "name" : "Wind Chill"
|
|
297
|
+
, "type" : "org.bluetooth.characteristic.wind_chill"
|
|
298
|
+
}
|
|
299
|
+
, "2a7a" : { "name" : "Heat Index"
|
|
300
|
+
, "type" : "org.bluetooth.characteristic.heat_index"
|
|
301
|
+
}
|
|
302
|
+
, "2a7b" : { "name" : "Dew Point"
|
|
303
|
+
, "type" : "org.bluetooth.characteristic.dew_point"
|
|
304
|
+
}
|
|
305
|
+
, "2a7d" : { "name" : "Descriptor Value Changed"
|
|
306
|
+
, "type" : "org.bluetooth.characteristic.descriptor_value_change"
|
|
307
|
+
}
|
|
308
|
+
, "2a7e" : { "name" : "Aerobic Heart Rate Lower Limit"
|
|
309
|
+
, "type" : "org.bluetooth.characteristic.aerobic_heart_rate_lower_limit"
|
|
310
|
+
}
|
|
311
|
+
, "2a7f" : { "name" : "Aerobic Threshold"
|
|
312
|
+
, "type" : "org.bluetooth.characteristic.aerobic_threshold"
|
|
313
|
+
}
|
|
314
|
+
, "2a80" : { "name" : "Age"
|
|
315
|
+
, "type" : "org.bluetooth.characteristic.age"
|
|
316
|
+
}
|
|
317
|
+
, "2a81" : { "name" : "Anaerobic Heart Rate Lower Limit"
|
|
318
|
+
, "type" : "org.bluetooth.characteristic.anaerobic_heart_rate_lower_limit"
|
|
319
|
+
}
|
|
320
|
+
, "2a82" : { "name" : "Anaerobic Heart Rate Upper Limit"
|
|
321
|
+
, "type" : "org.bluetooth.characteristic.anaerobic_heart_rate_upper_limit"
|
|
322
|
+
}
|
|
323
|
+
, "2a83" : { "name" : "Anaerobic Threshold"
|
|
324
|
+
, "type" : "org.bluetooth.characteristic.anaerobic_threshold"
|
|
325
|
+
}
|
|
326
|
+
, "2a84" : { "name" : "Aerobic Heart Rate Upper Limit"
|
|
327
|
+
, "type" : "org.bluetooth.characteristic.aerobic_heart_rate_upper_limit"
|
|
328
|
+
}
|
|
329
|
+
, "2a85" : { "name" : "Date of Birth"
|
|
330
|
+
, "type" : "org.bluetooth.characteristic.date_of_birth"
|
|
331
|
+
}
|
|
332
|
+
, "2a86" : { "name" : "Date of Threshold Assessment"
|
|
333
|
+
, "type" : "org.bluetooth.characteristic.date_of_threshold_assessment"
|
|
334
|
+
}
|
|
335
|
+
, "2a87" : { "name" : "Email Address"
|
|
336
|
+
, "type" : "org.bluetooth.characteristic.email_address"
|
|
337
|
+
}
|
|
338
|
+
, "2a88" : { "name" : "Fat Burn Heart Rate Lower Limit"
|
|
339
|
+
, "type" : "org.bluetooth.characteristic.fat_burn_heart_lower_limit"
|
|
340
|
+
}
|
|
341
|
+
, "2a89" : { "name" : "Fat Burn Heart Rate Upper Limit"
|
|
342
|
+
, "type" : "org.bluetooth.characteristic.fat_burn_heart_upper_limit"
|
|
343
|
+
}
|
|
344
|
+
, "2a8a" : { "name" : "First Name"
|
|
345
|
+
, "type" : "org.bluetooth.characteristic.first_name"
|
|
346
|
+
}
|
|
347
|
+
, "2a8b" : { "name" : "Five Zone Heart Rate Limits"
|
|
348
|
+
, "type" : "org.bluetooth.characteristic.five_zone_heart_rate_limits"
|
|
349
|
+
}
|
|
350
|
+
, "2a8c" : { "name" : "Gender"
|
|
351
|
+
, "type" : "org.bluetooth.characteristic.gender"
|
|
352
|
+
}
|
|
353
|
+
, "2a8d" : { "name" : "Heart Rate Max"
|
|
354
|
+
, "type" : "org.bluetooth.characteristic.heart_rate_max"
|
|
355
|
+
}
|
|
356
|
+
, "2a8e" : { "name" : "Height"
|
|
357
|
+
, "type" : "org.bluetooth.characteristic.height"
|
|
358
|
+
}
|
|
359
|
+
, "2a8f" : { "name" : "Hip Circumference"
|
|
360
|
+
, "type" : "org.bluetooth.characteristic.hip_circumference"
|
|
361
|
+
}
|
|
362
|
+
, "2a90" : { "name" : "Last Name"
|
|
363
|
+
, "type" : "org.bluetooth.characteristic.last_name"
|
|
364
|
+
}
|
|
365
|
+
, "2a91" : { "name" : "Maximum Recommended Heart Rate"
|
|
366
|
+
, "type" : "org.bluetooth.characteristic.maximum_recommended_heart_rate"
|
|
367
|
+
}
|
|
368
|
+
, "2a92" : { "name" : "Resting Heart Rate"
|
|
369
|
+
, "type" : "org.bluetooth.characteristic.resting_heart_rate"
|
|
370
|
+
}
|
|
371
|
+
, "2a93" : { "name" : "Sport Type for Aerobic and Anaerobic Threshold"
|
|
372
|
+
, "type" : "org.bluetooth.characteristic.sport_type_for_aerobic_and_anaerobic_threshold"
|
|
373
|
+
}
|
|
374
|
+
, "2a94" : { "name" : "Three Zone Heart Rate Limits"
|
|
375
|
+
, "type" : "org.bluetooth.characteristic.three_zone_heart_rate_limits"
|
|
376
|
+
}
|
|
377
|
+
, "2a95" : { "name" : "Two Zone Heart Rate Limit"
|
|
378
|
+
, "type" : "org.bluetooth.characteristic.two_zone_heart_rate_limit"
|
|
379
|
+
}
|
|
380
|
+
, "2a96" : { "name" : "VO2 Max"
|
|
381
|
+
, "type" : "org.bluetooth.characteristic.vo2_max"
|
|
382
|
+
}
|
|
383
|
+
, "2a97" : { "name" : "Waist Circumference"
|
|
384
|
+
, "type" : "org.bluetooth.characteristic.waist_circumference"
|
|
385
|
+
}
|
|
386
|
+
, "2a98" : { "name" : "Weight"
|
|
387
|
+
, "type" : "org.bluetooth.characteristic.weight"
|
|
388
|
+
}
|
|
389
|
+
, "2a99" : { "name" : "Database Change Increment"
|
|
390
|
+
, "type" : "org.bluetooth.characteristic.database_change_increment"
|
|
391
|
+
}
|
|
392
|
+
, "2a9a" : { "name" : "User Index"
|
|
393
|
+
, "type" : "org.bluetooth.characteristic.user_index"
|
|
394
|
+
}
|
|
395
|
+
, "2a9b" : { "name" : "Body Composition Feature"
|
|
396
|
+
, "type" : "org.bluetooth.characteristic.body_composition_feature"
|
|
397
|
+
}
|
|
398
|
+
, "2a9c" : { "name" : "Body Composition Measurement"
|
|
399
|
+
, "type" : "org.bluetooth.characteristic.body_composition_measurement"
|
|
400
|
+
}
|
|
401
|
+
, "2a9d" : { "name" : "Weight Measurement"
|
|
402
|
+
, "type" : "org.bluetooth.characteristic.weight_measurement"
|
|
403
|
+
}
|
|
404
|
+
, "2a9e" : { "name" : "Weight Scale Feature"
|
|
405
|
+
, "type" : "org.bluetooth.characteristic.weight_scale_feature"
|
|
406
|
+
}
|
|
407
|
+
, "2a9f" : { "name" : "User Control Point"
|
|
408
|
+
, "type" : "org.bluetooth.characteristic.user_control_point"
|
|
409
|
+
}
|
|
410
|
+
, "2aa0" : { "name" : "Magnetic Flux Density - 2D"
|
|
411
|
+
, "type" : "org.bluetooth.characteristic.magnetic_flux_density_2d"
|
|
412
|
+
}
|
|
413
|
+
, "2aa1" : { "name" : "Magnetic Flux Density - 3D"
|
|
414
|
+
, "type" : "org.bluetooth.characteristic.magnetic_flux_density_3d"
|
|
415
|
+
}
|
|
416
|
+
, "2aa2" : { "name" : "Language"
|
|
417
|
+
, "type" : "org.bluetooth.characteristic.language"
|
|
418
|
+
}
|
|
419
|
+
, "2aa3" : { "name" : "Barometric Pressure Trend"
|
|
420
|
+
, "type" : "org.bluetooth.characteristic.barometric_pressure_trend"
|
|
421
|
+
}
|
|
422
|
+
, "2aa4" : { "name" : "Bond Management Control Point"
|
|
423
|
+
, "type" : "org.bluetooth.characteristic.bond_management_control_point"
|
|
424
|
+
}
|
|
425
|
+
, "2aa5" : { "name" : "Bond Management Feature"
|
|
426
|
+
, "type" : "org.bluetooth.characteristic.bond_management_feature"
|
|
427
|
+
}
|
|
428
|
+
, "2aa6" : { "name" : "Central Address Resolution"
|
|
429
|
+
, "type" : "org.bluetooth.characteristic.central_address_resolution"
|
|
430
|
+
}
|
|
431
|
+
, "2aa7" : { "name" : "CGM Measurement"
|
|
432
|
+
, "type" : "org.bluetooth.characteristic.cgm_measurement"
|
|
433
|
+
}
|
|
434
|
+
, "2aa8" : { "name" : "CGM Feature"
|
|
435
|
+
, "type" : "org.bluetooth.characteristic.cgm_feature"
|
|
436
|
+
}
|
|
437
|
+
, "2aa9" : { "name" : "CGM Status"
|
|
438
|
+
, "type" : "org.bluetooth.characteristic.cgm_status"
|
|
439
|
+
}
|
|
440
|
+
, "2aaa" : { "name" : "CGM Session Start Time"
|
|
441
|
+
, "type" : "org.bluetooth.characteristic.cgm_session_start_time"
|
|
442
|
+
}
|
|
443
|
+
, "2aab" : { "name" : "CGM Session Run Time"
|
|
444
|
+
, "type" : "org.bluetooth.characteristic.cgm_session_run_time"
|
|
445
|
+
}
|
|
446
|
+
, "2aac" : { "name" : "CGM Specific Ops Control Point"
|
|
447
|
+
, "type" : "org.bluetooth.characteristic.cgm_specific_ops_control_point"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const events = require('events');
|
|
2
|
+
const util = require('util');
|
|
3
|
+
|
|
4
|
+
const descriptors = require('./descriptors.json');
|
|
5
|
+
|
|
6
|
+
function Descriptor (noble, peripheralId, serviceUuid, characteristicUuid, uuid) {
|
|
7
|
+
this._noble = noble;
|
|
8
|
+
this._peripheralId = peripheralId;
|
|
9
|
+
this._serviceUuid = serviceUuid;
|
|
10
|
+
this._characteristicUuid = characteristicUuid;
|
|
11
|
+
|
|
12
|
+
this.uuid = uuid;
|
|
13
|
+
this.name = null;
|
|
14
|
+
this.type = null;
|
|
15
|
+
|
|
16
|
+
const descriptor = descriptors[uuid];
|
|
17
|
+
if (descriptor) {
|
|
18
|
+
this.name = descriptor.name;
|
|
19
|
+
this.type = descriptor.type;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
util.inherits(Descriptor, events.EventEmitter);
|
|
24
|
+
|
|
25
|
+
Descriptor.prototype.toString = function () {
|
|
26
|
+
return JSON.stringify({
|
|
27
|
+
uuid: this.uuid,
|
|
28
|
+
name: this.name,
|
|
29
|
+
type: this.type
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const readValue = function (callback) {
|
|
34
|
+
if (callback) {
|
|
35
|
+
this.once('valueRead', data => {
|
|
36
|
+
callback(null, data);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
this._noble.readValue(
|
|
40
|
+
this._peripheralId,
|
|
41
|
+
this._serviceUuid,
|
|
42
|
+
this._characteristicUuid,
|
|
43
|
+
this.uuid
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
Descriptor.prototype.readValue = readValue;
|
|
48
|
+
Descriptor.prototype.readValueAsync = util.promisify(readValue);
|
|
49
|
+
|
|
50
|
+
const writeValue = function (data, callback) {
|
|
51
|
+
if (!(data instanceof Buffer)) {
|
|
52
|
+
throw new Error('data must be a Buffer');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (callback) {
|
|
56
|
+
this.once('valueWrite', () => {
|
|
57
|
+
callback(null);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
this._noble.writeValue(
|
|
61
|
+
this._peripheralId,
|
|
62
|
+
this._serviceUuid,
|
|
63
|
+
this._characteristicUuid,
|
|
64
|
+
this.uuid,
|
|
65
|
+
data
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
Descriptor.prototype.writeValue = writeValue;
|
|
70
|
+
Descriptor.prototype.writeValueAsync = util.promisify(writeValue);
|
|
71
|
+
|
|
72
|
+
module.exports = Descriptor;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"2900" : { "name" : "Characteristic Extended Properties"
|
|
3
|
+
, "type" : "org.bluetooth.descriptor.gatt.characteristic_extended_properties"
|
|
4
|
+
}
|
|
5
|
+
, "2901" : { "name" : "Characteristic User Description"
|
|
6
|
+
, "type" : "org.bluetooth.descriptor.gatt.characteristic_user_description"
|
|
7
|
+
}
|
|
8
|
+
, "2902" : { "name" : "Client Characteristic Configuration"
|
|
9
|
+
, "type" : "org.bluetooth.descriptor.gatt.client_characteristic_configuration"
|
|
10
|
+
}
|
|
11
|
+
, "2903" : { "name" : "Server Characteristic Configuration"
|
|
12
|
+
, "type" : "org.bluetooth.descriptor.gatt.server_characteristic_configuration"
|
|
13
|
+
}
|
|
14
|
+
, "2904" : { "name" : "Characteristic Presentation Format"
|
|
15
|
+
, "type" : "org.bluetooth.descriptor.gatt.characteristic_presentation_format"
|
|
16
|
+
}
|
|
17
|
+
, "2905" : { "name" : "Characteristic Aggregate Format"
|
|
18
|
+
, "type" : "org.bluetooth.descriptor.gatt.characteristic_aggregate_format"
|
|
19
|
+
}
|
|
20
|
+
, "2906" : { "name" : "Valid Range"
|
|
21
|
+
, "type" : "org.bluetooth.descriptor.valid_range"
|
|
22
|
+
}
|
|
23
|
+
, "2907" : { "name" : "External Report Reference"
|
|
24
|
+
, "type" : "org.bluetooth.descriptor.external_report_reference"
|
|
25
|
+
}
|
|
26
|
+
, "2908" : { "name" : "Report Reference"
|
|
27
|
+
, "type" : "org.bluetooth.descriptor.report_reference"
|
|
28
|
+
}
|
|
29
|
+
, "2909" : { "name" : "Number of Digitals"
|
|
30
|
+
, "type" : "org.bluetooth.descriptor.number_of_digitals"
|
|
31
|
+
}
|
|
32
|
+
, "290a" : { "name" : "Value Trigger Setting"
|
|
33
|
+
, "type" : "org.bluetooth.descriptor.value_trigger_setting"
|
|
34
|
+
}
|
|
35
|
+
, "290b" : { "name" : "Environmental Sensing Configuration"
|
|
36
|
+
, "type" : "org.bluetooth.descriptor.environmental_sensing_configuration"
|
|
37
|
+
}
|
|
38
|
+
, "290c" : { "name" : "Environmental Sensing Measurement"
|
|
39
|
+
, "type" : "org.bluetooth.descriptor.environmental_sensing_measurement"
|
|
40
|
+
}
|
|
41
|
+
, "290d" : { "name" : "Environmental Sensing Trigger Setting"
|
|
42
|
+
, "type" : "org.bluetooth.descriptor.environmental_sensing_trigger_setting"
|
|
43
|
+
}
|
|
44
|
+
, "290e" : { "name" : "Time Trigger Setting"
|
|
45
|
+
, "type" : "org.bluetooth.descriptor.time_trigger_setting"
|
|
46
|
+
}
|
|
47
|
+
}
|