UartBus source documentation
rpc.h
1 /*
2  * ub.h
3  *
4  * Created on: 2019.03.02.
5  * Author: Dankó Dávid
6  */
7 
8 #ifndef RPC_H_
9 #define RPC_H_
10 
11 #include "stdint.h"
12 #include <stdbool.h>
13 #include <stddef.h>
14 #include <stdarg.h>
15 #include <alloca.h>
16 #include "posix_errno.h"
17 
19 {
20  uint8_t size;
21  uint8_t* data;
22 };
23 
25 {
26  int16_t from;
27  int16_t to;
28  uint8_t* payload;
29  uint8_t size;
30  uint8_t procPtr;
31 
32  int16_t (*reply)(struct rpc_request* req, uint8_t args, struct response_part** parts);
33 };
34 
35 uint8_t rpc_append_size(uint8_t args, struct response_part** parts);
36 int16_t rpc_append_arr(uint8_t* dst, uint8_t size, uint8_t args, struct response_part** parts);
37 
38 bool il_reply_arr(struct rpc_request* req, uint8_t* data, uint8_t size);
39 bool il_reply(struct rpc_request* req, uint8_t size, ...);
40 
41 void dispatch_function_chain(void** chain, struct rpc_request* req);
42 void dispatch_descriptor_chain(void** chain, struct rpc_request* req);
43 
44 bool try_consume_path(struct rpc_request* req, uint8_t size, ...);
45 
46 #endif /* RPC_H_ */