Changed name on the neighbor discovery module from (cryptic) 'nbh' to 'neighbor-discovery'

This commit is contained in:
adamdunkels 2007-12-09 15:40:43 +00:00
parent 29b2d1d236
commit 4e1d2906b7
3 changed files with 27 additions and 27 deletions

View File

@ -1,6 +1,6 @@
CONTIKI_SOURCEFILES += rimebuf.c queuebuf.c rimeaddr.c ctimer.c rime.c \
rimestats.c ibc.c uc.c suc.c ruc.c sibc.c sabc.c abc.c nf.c \
mh.c rmh.c rucb.c polite.c ipolite.c nbh.c \
mh.c rmh.c rucb.c polite.c ipolite.c neighbor-discovery.c \
mesh.c route.c route-discovery.c \
collect.c neighbor.c \
trickle.c \

View File

@ -1,5 +1,5 @@
/**
* \addtogroup rimenbh
* \addtogroup rimeneighbordiscovery
* @{
*/
@ -33,12 +33,12 @@
*
* This file is part of the Contiki operating system.
*
* $Id: nbh.c,v 1.4 2007/11/17 10:34:17 adamdunkels Exp $
* $Id: neighbor-discovery.c,v 1.1 2007/12/09 15:40:43 adamdunkels Exp $
*/
/**
* \file
* Neighborhood discovery
* Neighbor discovery
* \author
* Adam Dunkels <adam@sics.se>
*/
@ -48,7 +48,7 @@
#include "net/rime.h"
#include "net/rime/neighbor.h"
#include "net/rime/nf.h"
#include "net/rime/nbh.h"
#include "net/rime/neighbor-discovery.h"
#include "dev/radio-sensor.h"
@ -84,7 +84,7 @@ struct adv_msg {
/*---------------------------------------------------------------------------*/
static void
send_adv(struct nbh_conn *c, clock_time_t interval)
send_adv(struct neighbor_discovery_conn *c, clock_time_t interval)
{
struct adv_msg *hdr;
@ -104,7 +104,7 @@ send_adv(struct nbh_conn *c, clock_time_t interval)
static void
adv_packet_received(struct ibc_conn *ibc, rimeaddr_t *from)
{
struct nbh_conn *c = (struct nbh_conn *)ibc;
struct neighbor_discovery_conn *c = (struct neighbor_discovery_conn *)ibc;
struct adv_msg *msg = rimebuf_dataptr();
/* struct neighbor *n; */
@ -132,7 +132,7 @@ adv_packet_received(struct ibc_conn *ibc, rimeaddr_t *from)
static void
send_timer(void *ptr)
{
struct nbh_conn *tc = ptr;
struct neighbor_discovery_conn *tc = ptr;
send_adv(tc, MAX_INTERVAL / 2);
ctimer_set(&tc->t,
@ -144,22 +144,22 @@ static const struct ibc_callbacks ibc_callbacks =
{adv_packet_received};
/*---------------------------------------------------------------------------*/
void
nbh_open(struct nbh_conn *c, uint16_t channel,
const struct nbh_callbacks *cb)
neighbor_discovery_open(struct neighbor_discovery_conn *c, uint16_t channel,
const struct neighbor_discovery_callbacks *cb)
{
ibc_open(&c->c, channel, &ibc_callbacks);
c->u = cb;
}
/*---------------------------------------------------------------------------*/
void
nbh_close(struct nbh_conn *c)
neighbor_discovery_close(struct neighbor_discovery_conn *c)
{
ibc_close(&c->c);
ctimer_stop(&c->t);
}
/*---------------------------------------------------------------------------*/
void
nbh_start(struct nbh_conn *c, uint16_t val)
neighbor_discovery_start(struct neighbor_discovery_conn *c, uint16_t val)
{
c->val = val;
ctimer_set(&c->t, random_rand() % MIN_INTERVAL, send_timer, c);

View File

@ -28,39 +28,39 @@
*
* This file is part of the Contiki operating system.
*
* $Id: nbh.h,v 1.2 2007/11/17 10:32:54 adamdunkels Exp $
* $Id: neighbor-discovery.h,v 1.1 2007/12/09 15:40:43 adamdunkels Exp $
*/
/**
* \file
* Neighborhood discovery header file
* Neighbor discovery header file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __NBH_H__
#define __NBH_H__
#ifndef __NEIGHBOR_DISCOVERY_H__
#define __NEIGHBOR_DISCOVERY_H__
#include "net/rime/ibc.h"
struct nbh_conn;
struct neighbor_discovery_conn;
struct nbh_callbacks {
void (* recv)(struct nbh_conn *c, rimeaddr_t *from, uint16_t val);
void (* sent)(struct nbh_conn *c);
struct neighbor_discovery_callbacks {
void (* recv)(struct neighbor_discovery_conn *c, rimeaddr_t *from, uint16_t val);
void (* sent)(struct neighbor_discovery_conn *c);
};
struct nbh_conn {
struct neighbor_discovery_conn {
struct ibc_conn c;
const struct nbh_callbacks *u;
const struct neighbor_discovery_callbacks *u;
struct ctimer t;
uint16_t val;
};
void nbh_open(struct nbh_conn *c, uint16_t channel,
const struct nbh_callbacks *u);
void nbh_close(struct nbh_conn *c);
void neighbor_discovery_open(struct neighbor_discovery_conn *c, uint16_t channel,
const struct neighbor_discovery_callbacks *u);
void neighbor_discovery_close(struct neighbor_discovery_conn *c);
void nbh_start(struct nbh_conn *c, uint16_t val);
void neighbor_discovery_start(struct neighbor_discovery_conn *c, uint16_t val);
#endif /* __NBH_H__ */
#endif /* __NEIGHBOR_DISCOVERY_H__ */