Initial import

This commit is contained in:
nzasch
2022-10-24 19:21:04 +02:00
commit 77e97b7f40
7 changed files with 563 additions and 0 deletions

42
arnet_cli.h Normal file
View File

@@ -0,0 +1,42 @@
/*
* https://ciapini.wiki.esiliati.org/view/ArNet
*/
#ifndef ARNET_CLI_H
#define ARNET_CLI_H
#include <stdint.h>
#include "../net.h"
#define ARNET_CLI_ELEMENT_SEPARATOR ','
#define ARNET_CLI_KV_SEPARATOR '='
// queue
#define ARNET_CLI_TX_QUEUE 'T'
// packet
#define ARNET_CLI_SRC_ADDR 'S'
#define ARNET_CLI_DST_ADDR 'D'
#define ARNET_CLI_HDR_SIZE 'H'
#define ARNET_CLI_PLD_SIZE 'P'
// EC
#define ARNET_CLI_EC_ENABLED 'C'
#define ARNET_CLI_EC_OK 'K'
// errors
#define ARNET_CLI_ERR 'E'
#define ARNET_CLI_ERR_OK 0
#define ARNET_CLI_ERR_INVALID_NAME 1
#define ARNET_CLI_ERR_INVALID_VALUE 2
// protoz
uint8_t arnet_cli_exec(uint8_t name, uint32_t value);
// uint8_t arnet_cli_parse(uint8_t *Buffer, uint8_t bufferlen);
uint8_t arnet_cli_print_state(uint8_t *Buffer);
uint8_t arnet_cli_print_packet(net_packet net_pck, arnet_packet arnet_pck, uint8_t *Buffer);
#endif /* ARNET_CLI_H */