Renamed driver output function to abc_driver_send

This commit is contained in:
adamdunkels 2007-03-14 00:29:05 +00:00
parent 355724669e
commit 91f8c4b8e4
3 changed files with 28 additions and 10 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: abc-udp.c,v 1.2 2007/03/13 13:02:33 adamdunkels Exp $
* $Id: abc-udp.c,v 1.3 2007/03/14 00:29:05 adamdunkels Exp $
*/
/**
@ -63,9 +63,8 @@ PROCESS_THREAD(abc_udp_process, ev, data)
}
/*---------------------------------------------------------------------------*/
void
abc_arch_send(u8_t *buf, int len)
abc_driver_send(void)
{
uip_udp_packet_send(c, uip_buf, uip_len);
return 1;
uip_udp_packet_send(c, rimebuf_hdrptr(), rimebuf_totlen());
}
/*---------------------------------------------------------------------------*/

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: abc.c,v 1.1 2007/03/13 13:01:48 adamdunkels Exp $
* $Id: abc.c,v 1.2 2007/03/14 00:29:05 adamdunkels Exp $
*/
/**
@ -59,8 +59,6 @@ void
abc_setup(struct abc_conn *c, u16_t channel,
const struct abc_ulayer *ulayer)
{
struct channel *chan;
c->channel = channel;
c->u = ulayer;
@ -73,9 +71,11 @@ abc_send(struct abc_conn *c)
if(rimebuf_hdrextend(sizeof(struct abc_hdr))) {
struct abc_hdr *hdr = rimebuf_hdrptr();
DEBUGF(1, "%d: abc: abc_send on channel %d\n", node_id, c->channel);
hdr->channel = c->channel;
rimebuf_copy_reference();
abc_arch_send(rimebuf_hdrptr(), rimebuf_totlen());
rimebuf_compact();
abc_driver_send();
return 1;
}
return 0;
@ -89,6 +89,8 @@ abc_input_packet(void)
hdr = rimebuf_dataptr();
DEBUGF(1, "%d: abc: abc_input_packet on channel %d\n", node_id, hdr->channel);
if(rimebuf_hdrreduce(sizeof(struct abc_hdr))) {
for(c = list_head(channels); c != NULL; c = c->next) {

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: abc.h,v 1.2 2007/03/13 13:01:48 adamdunkels Exp $
* $Id: abc.h,v 1.3 2007/03/14 00:29:05 adamdunkels Exp $
*/
/**
@ -105,5 +105,22 @@ int abc_send(struct abc_conn *c);
*/
void abc_input_packet(void);
/**
* \brief This function, which must be implemented by the driver, is called to send out a packet
*
* This function is implemented by the driver running
* below abc and is called by abc to send out a
* packet. The packet is contained in the rimebuf. The
* packet is consecutive in the rimebuf and a pointer to
* the first byte is gotten from the rimebuf_hdrptr()
* function. The length of the packet to send is gotten
* with the rimebuf_totlen() function.
*
* The driver, which typically is a MAC protocol, may
* queue the packet by using the queuebuf functions.
*
*/
void abc_driver_send(void);
#endif /* __BC_H__ */
/** @} */