-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchitecture.txt
More file actions
62 lines (48 loc) · 1.63 KB
/
Copy patharchitecture.txt
File metadata and controls
62 lines (48 loc) · 1.63 KB
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
POD SLOT x4
bool isBound;
bool isSticky;
string deviceID;
BLEDevice dev;
CANDIDATE DEVICES (list of BLEDevice)
STATE:
- ATMATCHING -> Association Token matching
- CONNECTING -> Connection in progress
- DISCCHARS -> Discovering characteristics
- SUBSCRIBING -> Subscribing to characteristic
- HANDSHAKE -> Exchanging initial messages
- READY -> Assign to slot and remove from candidate list
Operations
==========
Startup()
Shutdown()
ScanForDFUDevices()
StopScanningForDFUDevices()
(per slot)
setSticky(sticky) -> When the connection is lost, it scans and tries to reconnect
freeUp()
-> Frees up the slot. If a Pod is connected, then it will be disconnected.
findAndConnect(keepml)
-> Displays ML, and tries to connect to the device over it
-> Can't be done if the slot is bound to a device. Need to call freeUp first
abortFinding()
-> Stops device scan and ML
disconnect()
-> Closes connection to device and fires 'Disconnected' event
reconnect()
-> Tries to reconnect to last device w/o ML
(proxy functions)
sendCommand(cmd)
uploadFile(stream, id, unique, cmdcb, filecb)
downloadFile(stream, id, unique, cmdcb, filecb)
getID()
-> Gets UID / BDADDR of the device (to track different devices)
setMLState(enabled)
Events
======
(Connection events)
-> UpdateRequired(pod/app) -> The Pod in this slot cannot be connected until a firmware or app update is done
-> Connected
-> Disconnected (unexpected/requested/dfu)
-> Timeout -> Operation timeout. Connection is closed.
(ML of each slot)
-> status change (white/black) per frame