Expose the Rime MAC driver so that applications can use it - a bit of a hack, but it works for now
This commit is contained in:
parent
d8617c7879
commit
442516356a
2 changed files with 10 additions and 8 deletions
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: rime.h,v 1.10 2007/11/28 19:54:24 adamdunkels Exp $
|
* $Id: rime.h,v 1.11 2007/12/05 13:21:58 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,6 +94,8 @@ void rime_driver_send(void);
|
||||||
void rime_set_output(void (*output_function)(void));
|
void rime_set_output(void (*output_function)(void));
|
||||||
void rime_output(void);
|
void rime_output(void);
|
||||||
|
|
||||||
|
extern const struct mac_driver *rime_mac;
|
||||||
|
|
||||||
#endif /* __RIME_H__ */
|
#endif /* __RIME_H__ */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: rime.c,v 1.12 2007/11/15 13:07:42 nifi Exp $
|
* $Id: rime.c,v 1.13 2007/12/05 13:21:58 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,13 +48,13 @@
|
||||||
#include "net/rime/route.h"
|
#include "net/rime/route.h"
|
||||||
#include "net/mac/mac.h"
|
#include "net/mac/mac.h"
|
||||||
|
|
||||||
static const struct mac_driver *mac;
|
const struct mac_driver *rime_mac;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
input(const struct mac_driver *r)
|
input(const struct mac_driver *r)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
len = mac->read();
|
len = rime_mac->read();
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
RIMESTATS_ADD(rx);
|
RIMESTATS_ADD(rx);
|
||||||
abc_input_packet();
|
abc_input_packet();
|
||||||
|
@ -68,8 +68,8 @@ rime_init(const struct mac_driver *m)
|
||||||
route_init();
|
route_init();
|
||||||
rimebuf_clear();
|
rimebuf_clear();
|
||||||
neighbor_init();
|
neighbor_init();
|
||||||
mac = m;
|
rime_mac = m;
|
||||||
mac->set_receive_function(input);
|
rime_mac->set_receive_function(input);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
@ -77,8 +77,8 @@ rime_output(void)
|
||||||
{
|
{
|
||||||
RIMESTATS_ADD(tx);
|
RIMESTATS_ADD(tx);
|
||||||
rimebuf_compact();
|
rimebuf_compact();
|
||||||
if(mac) {
|
if(rime_mac) {
|
||||||
mac->send();
|
rime_mac->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue