Added Code Generated Proto
This commit is contained in:
parent
72486619f2
commit
a3a2c35fed
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
build/
|
||||
.cache
|
||||
alox.protogen
|
||||
.vscode/
|
||||
|
||||
10
Makefile
10
Makefile
@ -4,6 +4,16 @@ all:
|
||||
export:
|
||||
source ~/esp/esp-idf/export.fish && fish
|
||||
|
||||
get_code_gen:
|
||||
wget git.aloxdrim.de/skruecken/protgen/actions/runs/latest/artifacts/alox.protogen -O alox.protogen.zip
|
||||
unzip -o alox.protogen.zip
|
||||
rm alox.protogen.zip
|
||||
chmod +x alox.protogen
|
||||
|
||||
gen_prot:
|
||||
./alox.protogen -i prot.json -o main/uart
|
||||
|
||||
|
||||
buildIdf:
|
||||
idf.py build
|
||||
|
||||
|
||||
2
main/.gitignore
vendored
Normal file
2
main/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
uart_prot.c
|
||||
uart_prot.h
|
||||
@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "main.c" "uart_handler.c" "communication_handler.c"
|
||||
idf_component_register(SRCS "main.c" "uart_handler.c" "communication_handler.c" "uart_prot.c"
|
||||
INCLUDE_DIRS ".")
|
||||
|
||||
|
||||
61
prot.json
Normal file
61
prot.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"protocol": {
|
||||
"start_byte": "0xAA",
|
||||
"message_length": 0,
|
||||
"max_payload": 255,
|
||||
"checksum": "xor"
|
||||
},
|
||||
"messages_esp_to_pc": [
|
||||
{
|
||||
"name": "Clients",
|
||||
"id": "0xE1",
|
||||
"payload": [
|
||||
{ "name": "clientCount", "type": "uint8_t" },
|
||||
{ "name": "clientAvaiableBitMask", "type": "uint32_t" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Status",
|
||||
"id": "0xE2",
|
||||
"payload": [
|
||||
{ "name": "clientId", "type": "uint8_t" },
|
||||
{ "name": "mac", "type": "uint8_t", "array": 6 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pong",
|
||||
"id": "0xD1",
|
||||
"payload": [
|
||||
{ "name": "clientId", "type": "uint8_t" },
|
||||
{ "name": "ping", "type": "uint32_t" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"messages_pc_to_esp": [
|
||||
{
|
||||
"name": "RequestPing",
|
||||
"id": "0xE1",
|
||||
"payload": [
|
||||
{ "name": "clientId", "type": "uint8_t" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RequestStatus",
|
||||
"id": "0xE2",
|
||||
"payload": [
|
||||
{ "name": "clientId", "type": "uint8_t" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "PrepareFirmwareUpdate",
|
||||
"id": "0xF1"
|
||||
},
|
||||
{
|
||||
"name": "FirmwareUpdateLine",
|
||||
"id": "0xF2",
|
||||
"payload": [
|
||||
{ "name": "data", "type": "uint8_t", "array": 240 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
21
readme.md
21
readme.md
@ -23,6 +23,27 @@
|
||||
- **Checksum** (`uint8_t`):
|
||||
XOR über alle Bytes ab `Length` bis einschließlich `Payload`.
|
||||
|
||||
### Nachrichten von PC zu ESP:
|
||||
|
||||
clientid: 0x00 für master, 0xFF für broadcast, ansonsten 0xA0-0xB3 // 19 Clients
|
||||
|
||||
### RequestPing 0xE1
|
||||
Payload: byte: clientid
|
||||
### RequestInfo 0xE2
|
||||
Payload: byte: clientid
|
||||
### RequestRestart 0xE3
|
||||
Payload: byte: clientid
|
||||
### PrepareFirmwareUpdate 0xF1
|
||||
Payload: none
|
||||
### FirmwareUpdateLine 0xF2
|
||||
Payload: firmware line 240Bytes MAX
|
||||
### ExecuteFirmwareUpdate 0xF3
|
||||
Payload: none
|
||||
|
||||
### Nachrichten von ESP zu PC:
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
# Roadmap
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user