60 #ifndef __RUDOLPH0_H__
61 #define __RUDOLPH0_H__
70 RUDOLPH0_FLAG_NEWFILE,
71 RUDOLPH0_FLAG_LASTCHUNK,
74 struct rudolph0_callbacks {
75 void (* write_chunk)(
struct rudolph0_conn *c,
int offset,
int flag,
76 uint8_t *data,
int len);
77 int (* read_chunk)(
struct rudolph0_conn *c,
int offset, uint8_t *to,
81 #ifdef RUDOLPH0_CONF_DATASIZE
82 #define RUDOLPH0_DATASIZE RUDOLPH0_CONF_DATASIZE
84 #define RUDOLPH0_DATASIZE 64
93 struct rudolph0_datapacket {
94 struct rudolph0_hdr h;
96 uint8_t data[RUDOLPH0_DATASIZE];
99 struct rudolph0_conn {
102 const struct rudolph0_callbacks *cb;
103 clock_time_t send_interval;
105 struct rudolph0_datapacket current;
108 void rudolph0_open(
struct rudolph0_conn *c, uint16_t channel,
109 const struct rudolph0_callbacks *cb);
110 void rudolph0_close(
struct rudolph0_conn *c);
111 void rudolph0_send(
struct rudolph0_conn *c, clock_time_t interval);
112 void rudolph0_stop(
struct rudolph0_conn *c);
115 void rudolph0_force_restart(
struct rudolph0_conn *c);
117 void rudolph0_set_version(
struct rudolph0_conn *c,
int version);
118 int rudolph0_version(
struct rudolph0_conn *c);