Skip to content

Instantly share code, notes, and snippets.

@kamalmarhubi
Last active February 12, 2019 21:25
Show Gist options
  • Save kamalmarhubi/684517fdc06b2d916a1cd589ede9f4cc to your computer and use it in GitHub Desktop.
Save kamalmarhubi/684517fdc06b2d916a1cd589ede9f4cc to your computer and use it in GitHub Desktop.
Unpaired
Unpaired
connectionTimeout -> InitialState
connectionError -> InitialState
protocolError -> InitialState
pairingTimeout -> InitialState
InitialState*
deviceInitiate -> PendingServerPairingAck
PendingServerPairingAck
serverAck -> PendingClientConfirmation
PendingClientConfirmation
deviceConfirm -> PairedAndDisconnected
deviceDeny -> InitialState
Paired
deviceTerminateSession -> InitialState
sessionTimeout -> InitialState
connectionError -> PairedAndDisconnected
connectionTimeout -> PairedAndDisconnected
protocolError -> PairedAndDisconnected
PairedAndDisconnected
deviceConnect -> PendingServerAck
PendingServerAck
serverAck -> Idle
Connected
Idle
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",Spec (See tutorial)
1
Unpaired
2
connectionError -> InitialState
3
protocolError -> InitialState
4
pairingTimeout -> InitialState
5
connectionTimeout -> InitialState
6
InitialState*
7
deviceInitiate -> PendingServerPairingAck
8
PendingServerPairingAck
9
serverAck -> PendingClientConfirmation
10
PendingClientConfirmation
11
deviceConfirm -> PairedAndDisconnected
12
13
Paired
14
connectionError -> PairedAndDisconnected
15
connectionTimeout -> PairedAndDisconnected
16
protocolError -> PairedAndDisconnected
17
sessionTimeout -> InitialState
18
19
PairedAndDisconnected
20
deviceConnect -> PendingServerAck
21
PendingServerAck
22
serverAck -> Idle
23
24
Connected
25
Idle
26
27
Diagram
Unpaired
connectionError → InitialState
protocolError → InitialState
pairingTimeout → InitialState
connectionTimeout → InitialState
InitialState
deviceInitiate → PendingServerPairingAck
PendingServerPairingAck
serverAck → PendingClientConfirmation
PendingClientConfirmation
deviceConfirm → PairedAndDisconnected
Paired
connectionError → PairedAndDisconnected
connectionTimeout → PairedAndDisconnected
protocolError → PairedAndDisconnected
sessionTimeout → InitialState
PairedAndDisconnected
deviceConnect → PendingServerAck
PendingServerAck
serverAck → Idle
Connected
Idle
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment