blob: c8f13780a10b1cddc1a8f8761ec88fe149558b62 (
plain)
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
|
#ifndef _RSP_H
#define _RSP_H
#define LOG_DEBUG(...)
//#include <stdio.h>
//#define LOG_DEBUG(...) printf(__VA_ARGS__)
struct rsp_state {
int sockfd;
int data_maxlen;
int noackmode;
int replied;
int command_len, response_len;
char *command, *response, *decoded; /* Malloc'ed */
char *response_bom, *response_eom; /* Just pointers on *response string */
};
int rsp_init(int sockfd, int data_maxlen, struct rsp_state *rsp);
void rsp_quit(struct rsp_state *rsp);
void rsp_send_break(struct rsp_state *rsp);
void rsp_query(struct rsp_state *rsp, char command[]);
int rsp_check_and_clear(struct rsp_state *rsp, char expected_response[]);
int rsp_recv_full(struct rsp_state *rsp);
int rsp_decode(struct rsp_state *rsp);
int rsp_poke(struct rsp_state *rsp, unsigned int poke_addr, unsigned int poke_value);
#endif /*_RSP_H*/
|