Made the sicslowpan MAC layer reachable from outside modules

This commit is contained in:
adamdunkels 2010-01-28 13:50:51 +00:00
parent da3a7ffbd8
commit 388c5d4244
2 changed files with 8 additions and 7 deletions

View File

@ -32,7 +32,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: sicslowpan.c,v 1.10 2009/11/02 11:58:56 adamdunkels Exp $
* $Id: sicslowpan.c,v 1.11 2010/01/28 13:50:51 adamdunkels Exp $
*/
/**
* \file
@ -142,7 +142,7 @@ void uip_log(char *msg);
* @{
*/
/** A pointer to the mac driver */
static const struct mac_driver *mac;
const struct mac_driver *sicslowpan_mac;
/**
* A pointer to the rime buffer.
@ -1109,10 +1109,10 @@ send_packet(rimeaddr_t *dest)
*/
packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, dest);
if(mac != NULL) {
if(sicslowpan_mac != NULL) {
/** \todo: Fix sending delays so they aren't blocking, or even better would
* be to figure out how to get rid of delays entirely */
mac->send();
sicslowpan_mac->send();
}
}
@ -1466,10 +1466,10 @@ void
sicslowpan_init(const struct mac_driver *m)
{
/* remember the mac driver */
mac = m;
sicslowpan_mac = m;
/* Set our input function as the receive function of the MAC. */
mac->set_receive_function(input);
sicslowpan_mac->set_receive_function(input);
/*
* Set out output function as the function to be called from uIP to

View File

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: sicslowpan.h,v 1.4 2009/04/06 13:11:20 nifi Exp $
* $Id: sicslowpan.h,v 1.5 2010/01/28 13:50:51 adamdunkels Exp $
*/
/**
* \file
@ -255,5 +255,6 @@ struct sicslowpan_addr_context {
*/
void sicslowpan_init(const struct mac_driver *m);
extern const struct mac_driver *sicslowpan_mac;
#endif /* __SICSLOWPAN_H__ */
/** @} */