throttle_drv.h 761 Bytes
Newer Older
Riccardo Gaiati's avatar
Riccardo Gaiati committed
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef _THROTTLE_DRV_H_
#define _THROTTLE_DRV_H_

#define ETH_ADR_SIZE 6

/* typedef of the callback used to manage the received Ethernet Frame (the User Data)*/
typedef int (*thr_msg_handler_t)(void* data);
struct thr_chn_t;


int thr_init(const char* eth_int);
struct thr_chn_t* thr_open_chn(const unsigned char* dst_adr, unsigned char chn_id, unsigned char frag_size, unsigned short freq, thr_msg_handler_t funct);
Sven Robertz's avatar
Sven Robertz committed
13
void thr_close_chn(struct thr_chn_t* c);
Riccardo Gaiati's avatar
Riccardo Gaiati committed
14
15
16
17
int thr_receive (struct thr_chn_t* thr_chn, unsigned char* data, void* param);
int thr_send(const struct thr_chn_t* thr_chn, const char* data, unsigned int length);
int thr_read(struct thr_chn_t* thr_chn, unsigned char* data, int length);

Sven Robertz's avatar
Sven Robertz committed
18
unsigned char* get_sender_addr(struct thr_chn_t* ch);
Riccardo Gaiati's avatar
Riccardo Gaiati committed
19
#endif