prog.c:10:3: error: unknown type name ‘uint8_t’
uint8_t id;
^~~~~~~
prog.c:11:3: error: unknown type name ‘uint8_t’
uint8_t length;
^~~~~~~
prog.c:12:3: error: unknown type name ‘uint8_t’
uint8_t seq_num;
^~~~~~~
prog.c:13:3: error: unknown type name ‘uint8_t’
uint8_t payload[231];
^~~~~~~
prog.c:17:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parse_packet’
size_t parse_packet(uint8_t* data, size_t length, state *state, packet *packet) {
^~~~~~~~~~~~
prog.c: In function ‘main’:
prog.c:64:3: error: unknown type name ‘uint8_t’
uint8_t buf[MAX_PACKET_LEN * 3];
^~~~~~~
prog.c:64:15: error: ‘MAX_PACKET_LEN’ undeclared (first use in this function)
uint8_t buf[MAX_PACKET_LEN * 3];
^~~~~~~~~~~~~~
prog.c:64:15: note: each undeclared identifier is reported only once for each function it appears in
prog.c:65:3: error: unknown type name ‘size_t’
size_t buf_size = 0;
^~~~~~
prog.c:65:3: note: ‘size_t’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
prog.c:1:1:
+#include <stddef.h>
enum {
prog.c:65:3:
size_t buf_size = 0;
^~~~~~
prog.c:67:3: warning: statement with no effect [-Wunused-value]
state state = WAIT_MAGIC0;
^~~~~
prog.c:67:8: error: expected ‘;’ before ‘state’
state state = WAIT_MAGIC0;
^~~~~~
;
prog.c:68:3: error: unknown type name ‘packet’; use ‘struct’ keyword to refer to the type
packet packet;
^~~~~~
struct
prog.c:71:5: error: unknown type name ‘size_t’
size_t rcv_len = uart_read(); // recieve buffer and store to (buf + buf_size)
^~~~~~
prog.c:71:5: note: ‘size_t’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
prog.c:71:22: warning: implicit declaration of function ‘uart_read’ [-Wimplicit-function-declaration]
size_t rcv_len = uart_read(); // recieve buffer and store to (buf + buf_size)
^~~~~~~~~
prog.c:74:5: error: unknown type name ‘size_t’
size_t consumed_len = parse_packet(buf, buf_size, &state, &packet);
^~~~~~
prog.c:74:5: note: ‘size_t’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
prog.c:74:27: warning: implicit declaration of function ‘parse_packet’ [-Wimplicit-function-declaration]
size_t consumed_len = parse_packet(buf, buf_size, &state, &packet);
^~~~~~~~~~~~
prog.c:74:12: warning: unused variable ‘consumed_len’ [-Wunused-variable]
size_t consumed_len = parse_packet(buf, buf_size, &state, &packet);
^~~~~~~~~~~~
prog.c:64:11: warning: unused variable ‘buf’ [-Wunused-variable]
uint8_t buf[MAX_PACKET_LEN * 3];
^~~