1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Transport traits that protocols are written against.
//!
//! Protocols are `async` and generic over these traits, so the same protocol code runs on
//! every backend: native serial, USB and Bluetooth stacks, and the browser's Web Serial,
//! WebUSB, WebHID and Web Bluetooth APIs. Each trait describes one kind of link; a
//! protocol asks for exactly the kind it needs. See the
//! [transport documents](https://michidk.github.io/divecomputer-rs/spec/transports/README.html).
// The traits have no `Send` bound because browser futures are not `Send`; whether to add
// `Send` variants is an open decision in ARCHITECTURE.md.
use Vec;
use Duration;
use crateResult;
/// A byte stream: serial ports, USB-serial chips, Bluetooth classic RFCOMM, or a BLE
/// GATT link that behaves like a serial line.
/// A packet link that keeps message boundaries: USB HID reports, USB bulk transfers or
/// BLE characteristic writes and notifications.
/// Time for protocols: native timers, the browser's `setTimeout`, or a virtual clock in
/// tests.