Skip to content

Commit 5da8d05

Browse files
committed
Merge pull request arduino#27 from ToSa27/development
Improved documentation and usage of codebender for auto sketch compilation
2 parents 04cdd4b + 0036c5f commit 5da8d05

File tree

8 files changed

+157
-1520
lines changed

8 files changed

+157
-1520
lines changed

Bootloader/Readme.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
See NodeJsController/Readme.md for usage instructions...
2+
3+
<h1>Technical details to write your own controller</h1>
4+
All initialization the bootloader does (finding parent / requesting nodeId on first start) uses the same packets as a normal MySensors sketch. There is no need for the controller to distinguish between packets from the bootloader and packets from normal sketch execution. The controller only needs to care about two additional request/response communications. All communication is binary.
5+
<h2>FirmwareConfig</h2>
6+
<ul>
7+
<li>the bootloader sends a FirmwareConfigRequest packet to the gateway to request information about the firmware it should execute:
8+
<p>
9+
typedef struct<br/>
10+
{<br/>
11+
&nbsp;uint16_t type;<br/>
12+
&nbsp;uint16_t version;<br/>
13+
} FirmwareConfigRequest;
14+
</p>
15+
<li>the gateway (the controller) responds with a FirmwareConfigResponse including details about the firmware the sensor should execute:
16+
<p>
17+
typedef struct<br/>
18+
{<br/>
19+
&nbsp;uint16_t type;<br/>
20+
&nbsp;uint16_t version;<br/>
21+
&nbsp;uint16_t blocks;<br/>
22+
&nbsp;uint16_t crc;<br/>
23+
} FirmwareConfigResponse;
24+
</p>
25+
</ul>
26+
<h2>Firmware</h2>
27+
<ul>
28+
<li>the bootloader sends a FirmwareRequest packet to the gateway to request a specific subset (block) of the compiled firmware:
29+
<p>
30+
typedef struct<br/>
31+
{<br/>
32+
&nbsp;uint16_t type;<br/>
33+
&nbsp;uint16_t version;<br/>
34+
&nbsp;uint16_t block;<br/>
35+
} FirmwareRequest;
36+
</p>
37+
<li>the gateway (the controller) responds with a FirmwareResponse including the specific block of the compiled firmware:
38+
</ul>
39+
<p>
40+
typedef struct<br/>
41+
{<br/>
42+
&nbsp;uint16_t type;<br/>
43+
&nbsp;uint16_t version;<br/>
44+
&nbsp;uint16_t block;<br/>
45+
&nbsp;uint8_t data[FIRMWARE_BLOCK_SIZE];<br/>
46+
} FirmwareResponse;
47+
</p>

NodeJsController/BlinkGreen.hex

-71
This file was deleted.

NodeJsController/BlinkRed.hex

-71
This file was deleted.

0 commit comments

Comments
 (0)