diff --git a/core/dev/radio.h b/core/dev/radio.h index 4bd828266..5b9144286 100644 --- a/core/dev/radio.h +++ b/core/dev/radio.h @@ -42,7 +42,7 @@ * * This file is part of the Contiki operating system. * - * $Id: radio.h,v 1.1 2006/06/17 22:41:17 adamdunkels Exp $ + * $Id: radio.h,v 1.2 2007/05/15 07:51:57 adamdunkels Exp $ */ /** @@ -55,6 +55,26 @@ #ifndef __RADIO_H__ #define __RADIO_H__ +/** + * The structure of a device driver for a radio in Contiki. + */ +struct radio_driver { + /** Send a packet */ + int (* send)(const u8_t *buf, u16_t len); + + /** Read a received packet. */ + u16_t (* read)(u8_t *buf, u16_t bufsize); + + /** Set a function to be called when a packet has been received. */ + void (* set_receive_function)(void (*f)(const struct radio_driver *d)); + + /** Turn the radio on. */ + int (* on)(void); + + /** Turn the radio off. */ + int (* off)(void); +}; + /** * \brief Turn radio on.