Changed name on the neighbor discovery module from (cryptic) 'nbh' to 'neighbor-discovery'
This commit is contained in:
parent
29b2d1d236
commit
4e1d2906b7
3 changed files with 27 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
||||||
CONTIKI_SOURCEFILES += rimebuf.c queuebuf.c rimeaddr.c ctimer.c rime.c \
|
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 \
|
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 \
|
mesh.c route.c route-discovery.c \
|
||||||
collect.c neighbor.c \
|
collect.c neighbor.c \
|
||||||
trickle.c \
|
trickle.c \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* \addtogroup rimenbh
|
* \addtogroup rimeneighbordiscovery
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
* \file
|
||||||
* Neighborhood discovery
|
* Neighbor discovery
|
||||||
* \author
|
* \author
|
||||||
* Adam Dunkels <adam@sics.se>
|
* Adam Dunkels <adam@sics.se>
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
#include "net/rime.h"
|
#include "net/rime.h"
|
||||||
#include "net/rime/neighbor.h"
|
#include "net/rime/neighbor.h"
|
||||||
#include "net/rime/nf.h"
|
#include "net/rime/nf.h"
|
||||||
#include "net/rime/nbh.h"
|
#include "net/rime/neighbor-discovery.h"
|
||||||
|
|
||||||
#include "dev/radio-sensor.h"
|
#include "dev/radio-sensor.h"
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ struct adv_msg {
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
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;
|
struct adv_msg *hdr;
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ send_adv(struct nbh_conn *c, clock_time_t interval)
|
||||||
static void
|
static void
|
||||||
adv_packet_received(struct ibc_conn *ibc, rimeaddr_t *from)
|
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 adv_msg *msg = rimebuf_dataptr();
|
||||||
/* struct neighbor *n; */
|
/* struct neighbor *n; */
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ adv_packet_received(struct ibc_conn *ibc, rimeaddr_t *from)
|
||||||
static void
|
static void
|
||||||
send_timer(void *ptr)
|
send_timer(void *ptr)
|
||||||
{
|
{
|
||||||
struct nbh_conn *tc = ptr;
|
struct neighbor_discovery_conn *tc = ptr;
|
||||||
|
|
||||||
send_adv(tc, MAX_INTERVAL / 2);
|
send_adv(tc, MAX_INTERVAL / 2);
|
||||||
ctimer_set(&tc->t,
|
ctimer_set(&tc->t,
|
||||||
|
@ -144,22 +144,22 @@ static const struct ibc_callbacks ibc_callbacks =
|
||||||
{adv_packet_received};
|
{adv_packet_received};
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
nbh_open(struct nbh_conn *c, uint16_t channel,
|
neighbor_discovery_open(struct neighbor_discovery_conn *c, uint16_t channel,
|
||||||
const struct nbh_callbacks *cb)
|
const struct neighbor_discovery_callbacks *cb)
|
||||||
{
|
{
|
||||||
ibc_open(&c->c, channel, &ibc_callbacks);
|
ibc_open(&c->c, channel, &ibc_callbacks);
|
||||||
c->u = cb;
|
c->u = cb;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
nbh_close(struct nbh_conn *c)
|
neighbor_discovery_close(struct neighbor_discovery_conn *c)
|
||||||
{
|
{
|
||||||
ibc_close(&c->c);
|
ibc_close(&c->c);
|
||||||
ctimer_stop(&c->t);
|
ctimer_stop(&c->t);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
nbh_start(struct nbh_conn *c, uint16_t val)
|
neighbor_discovery_start(struct neighbor_discovery_conn *c, uint16_t val)
|
||||||
{
|
{
|
||||||
c->val = val;
|
c->val = val;
|
||||||
ctimer_set(&c->t, random_rand() % MIN_INTERVAL, send_timer, c);
|
ctimer_set(&c->t, random_rand() % MIN_INTERVAL, send_timer, c);
|
|
@ -28,39 +28,39 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
* \file
|
||||||
* Neighborhood discovery header file
|
* Neighbor discovery header file
|
||||||
* \author
|
* \author
|
||||||
* Adam Dunkels <adam@sics.se>
|
* Adam Dunkels <adam@sics.se>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NBH_H__
|
#ifndef __NEIGHBOR_DISCOVERY_H__
|
||||||
#define __NBH_H__
|
#define __NEIGHBOR_DISCOVERY_H__
|
||||||
|
|
||||||
#include "net/rime/ibc.h"
|
#include "net/rime/ibc.h"
|
||||||
|
|
||||||
struct nbh_conn;
|
struct neighbor_discovery_conn;
|
||||||
|
|
||||||
struct nbh_callbacks {
|
struct neighbor_discovery_callbacks {
|
||||||
void (* recv)(struct nbh_conn *c, rimeaddr_t *from, uint16_t val);
|
void (* recv)(struct neighbor_discovery_conn *c, rimeaddr_t *from, uint16_t val);
|
||||||
void (* sent)(struct nbh_conn *c);
|
void (* sent)(struct neighbor_discovery_conn *c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nbh_conn {
|
struct neighbor_discovery_conn {
|
||||||
struct ibc_conn c;
|
struct ibc_conn c;
|
||||||
const struct nbh_callbacks *u;
|
const struct neighbor_discovery_callbacks *u;
|
||||||
struct ctimer t;
|
struct ctimer t;
|
||||||
uint16_t val;
|
uint16_t val;
|
||||||
};
|
};
|
||||||
|
|
||||||
void nbh_open(struct nbh_conn *c, uint16_t channel,
|
void neighbor_discovery_open(struct neighbor_discovery_conn *c, uint16_t channel,
|
||||||
const struct nbh_callbacks *u);
|
const struct neighbor_discovery_callbacks *u);
|
||||||
void nbh_close(struct nbh_conn *c);
|
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__ */
|
Loading…
Add table
Reference in a new issue