aboutsummaryrefslogtreecommitdiff
path: root/arduino/ace_old/transport.h
blob: 233d19ca101ef5deba0c7caa05595f3202db2dce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef TRANSPORT_H
#define TRANSPORT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <inttypes.h>

typedef struct {
  uint8_t* data;
  uint16_t length;
} message;

typedef enum {
  RECEIVED = 0,
  SEND_SUCCESS = 1,
  SEND_ERROR = 2,
  NO_ACK = 3,
  BAD_ACK = 4,
  BUSY = 5
} transport_code;

void init_transport_layer(uint32_t timeout_millis);
void to_transport_layer(message* s); //implemented in transport
void from_transport_layer(transport_code code, message* r); //should be implemented in application

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* TRANSPORT_H */