Skip to content

Commit 5d68fed

Browse files
committed
update README
1 parent cba4f6e commit 5d68fed

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,27 @@ graph TD;
2020
Request-.->Hello
2121
Request-.->PostResults
2222
Request-.->PostStats
23-
Request-.->Bye
23+
Request-.->SendNotification
2424
Request-.->GetSetting
25-
Request-.->GetSettings
25+
Request-.->UpdateCheck
26+
Request-.->NextUpdateChunk
27+
Request-.->ReportFirmwareUpdate
28+
Request-.->Bye
2629
2730
Response-.->Pong
2831
Response-.->Ok
2932
Response-.->Reject
30-
Response-.->Setting
33+
Response-.->FirmwareUpToDate
34+
Response-.->UpdateAvailable
35+
Response-.->UpdatePart
36+
Response-.->UpdateEnd
3137
Response-.->Settings
3238
```
3339

40+
### Ping test message (`Ping`)
41+
The `Pind` message is only used for testing if the connection to the server is alive. The server will respond with a `Pong` message.
42+
```
43+
3444
### Introduction message (`Hello`)
3545
The `Hello` message is the first message sent by the client (node) to the server. It contains the MAC address of the client. The server will respond with an `Ok` message if the client is authorized to communicate with the server.
3646
@@ -86,13 +96,44 @@ graph LR;
8696
```mermaid
8797
sequenceDiagram
8898
Node->>Server: Hello (incl. MAC address)
89-
Server->>Node: Ok
99+
100+
alt Known MAC, Successful authentication
101+
Server->>Node: Ok
102+
else Unknown MAC
103+
Server--xNode: Reject
104+
end
105+
90106
Node->>Server: GetSettings [...]
91107
Server->>Node: Settings [...]
92108
Node->>Server: PostResults [temperature, humidity, ...]
93109
Server->>Node: Ok
94110
Node->>Server: PostStats (node statistics)
95111
Server->>Node: Ok
112+
Node->>Server: UpdateCheck [current version]
113+
114+
opt Detected rollback from bad firmware
115+
Node->>Server: ReportFirmwareUpdate [false]
116+
Server->>Node: Ok
117+
end
118+
119+
opt Successfull update
120+
Node->>Server: ReportFirmwareUpdate [true]
121+
Server->>Node: Ok
122+
end
123+
124+
alt Update available
125+
Server->>Node: UpdateAvailable
126+
127+
loop Download update
128+
Node->>Server: NextUpdateChunk [chunk size]
129+
Server->>Node: UpdatePart [...]
130+
end
131+
132+
Server->>Node: UpdateEnd
133+
else Already up to date
134+
Server->>Node: FirmwareUpToDate
135+
end
136+
96137
Node->>Server: Bye
97138
```
98139

0 commit comments

Comments
 (0)