diff --git a/core/net/rime/abc.c b/core/net/rime/abc.c index 9bf0756be..e3b2f89d0 100644 --- a/core/net/rime/abc.c +++ b/core/net/rime/abc.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: abc.c,v 1.5 2007/03/19 19:24:36 adamdunkels Exp $ + * $Id: abc.c,v 1.6 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -65,6 +65,12 @@ abc_open(struct abc_conn *c, u16_t channel, list_add(channels, c); } /*---------------------------------------------------------------------------*/ +void +abc_close(struct abc_conn *c) +{ + list_remove(channels, c); +} +/*---------------------------------------------------------------------------*/ int abc_send(struct abc_conn *c) { diff --git a/core/net/rime/abc.h b/core/net/rime/abc.h index bc095acff..108d20aaa 100644 --- a/core/net/rime/abc.h +++ b/core/net/rime/abc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: abc.h,v 1.6 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: abc.h,v 1.7 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -80,6 +80,8 @@ struct abc_conn { void abc_open(struct abc_conn *c, u16_t channel, const struct abc_callbacks *u); +void abc_close(struct abc_conn *c); + /** * \brief Send an anonymous best-effort broadcast packet * \param c The abc connection on which the packet should be sent diff --git a/core/net/rime/ccsabc.c b/core/net/rime/ccsabc.c index f16d741f0..e99e2fbc4 100644 --- a/core/net/rime/ccsabc.c +++ b/core/net/rime/ccsabc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ccsabc.c,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ccsabc.c,v 1.4 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -71,6 +71,12 @@ ccsabc_open(struct ccsabc_conn *c, u16_t channel, sabc_open(&c->c, channel, &ccsabc); } /*---------------------------------------------------------------------------*/ +void +ccsabc_close(struct ccsabc_conn *c) +{ + sabc_close(&c->c); +} +/*---------------------------------------------------------------------------*/ int ccsabc_send_stubborn(struct ccsabc_conn *c, clock_time_t t) { diff --git a/core/net/rime/ccsabc.h b/core/net/rime/ccsabc.h index 5d237becb..76354016e 100644 --- a/core/net/rime/ccsabc.h +++ b/core/net/rime/ccsabc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ccsabc.h,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ccsabc.h,v 1.4 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -60,6 +60,7 @@ struct ccsabc_conn { void ccsabc_open(struct ccsabc_conn *c, u16_t channel, const struct ccsabc_callbacks *u); +void ccsabc_close(struct ccsabc_conn *c); int ccsabc_send_stubborn(struct ccsabc_conn *c, clock_time_t t); void ccsabc_cancel(struct ccsabc_conn *c); diff --git a/core/net/rime/ibc.c b/core/net/rime/ibc.c index c059259f9..b08ebd579 100644 --- a/core/net/rime/ibc.c +++ b/core/net/rime/ibc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ibc.c,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ibc.c,v 1.5 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -71,6 +71,12 @@ ibc_open(struct ibc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +ibc_close(struct ibc_conn *c) +{ + abc_close(&c->c); +} +/*---------------------------------------------------------------------------*/ int ibc_send(struct ibc_conn *c) { diff --git a/core/net/rime/ibc.h b/core/net/rime/ibc.h index 3b94ead96..9841e4475 100644 --- a/core/net/rime/ibc.h +++ b/core/net/rime/ibc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ibc.h,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ibc.h,v 1.5 2007/03/19 22:10:16 adamdunkels Exp $ */ /** @@ -57,6 +57,7 @@ struct ibc_conn { void ibc_open(struct ibc_conn *c, u16_t channel, const struct ibc_callbacks *u); +void ibc_close(struct ibc_conn *c); int ibc_send(struct ibc_conn *c); #endif /* __IBC_H__ */ diff --git a/core/net/rime/mesh.c b/core/net/rime/mesh.c index ddae7fe3c..9200ea2e0 100644 --- a/core/net/rime/mesh.c +++ b/core/net/rime/mesh.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: mesh.c,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: mesh.c,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -292,6 +292,14 @@ mesh_open(const struct mesh_callbacks *callbacks, send_datapacket_handler = send_datapacket; } /*---------------------------------------------------------------------------*/ +void +mesh_close(void) +{ + uc_close(&mc.dataconn); + uc_close(&mc.rrepconn); + nf_close(&mc.rreqconn); +} +/*---------------------------------------------------------------------------*/ int mesh_send(rimeaddr_t *to) { diff --git a/core/net/rime/mesh.h b/core/net/rime/mesh.h index de48c7db1..c1086cfa9 100644 --- a/core/net/rime/mesh.h +++ b/core/net/rime/mesh.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: mesh.h,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: mesh.h,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -54,4 +54,6 @@ int mesh_send(rimeaddr_t *dest); void mesh_data_received(rimeaddr_t *from); +void mesh_close(void); + #endif /* __MESH_H__ */ diff --git a/core/net/rime/nf.c b/core/net/rime/nf.c index bbfb20a37..ee6eeb871 100644 --- a/core/net/rime/nf.c +++ b/core/net/rime/nf.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: nf.c,v 1.5 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: nf.c,v 1.6 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -157,6 +157,12 @@ nf_open(struct nf_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +nf_close(struct nf_conn *c) +{ + ibc_close(&c->c); +} +/*---------------------------------------------------------------------------*/ int nf_send(struct nf_conn *c) { diff --git a/core/net/rime/nf.h b/core/net/rime/nf.h index e09fe7081..bed3d0c63 100644 --- a/core/net/rime/nf.h +++ b/core/net/rime/nf.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: nf.h,v 1.5 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: nf.h,v 1.6 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -65,6 +65,7 @@ struct nf_conn { void nf_open(struct nf_conn *c, u16_t channel, const struct nf_callbacks *u); +void nf_close(struct nf_conn *c); int nf_send(struct nf_conn *c); diff --git a/core/net/rime/ruc.c b/core/net/rime/ruc.c index faff70b4c..e5b00b3f2 100644 --- a/core/net/rime/ruc.c +++ b/core/net/rime/ruc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ruc.c,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ruc.c,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -120,6 +120,12 @@ ruc_open(struct ruc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +ruc_close(struct ruc_conn *c) +{ + suc_close(&c->c); +} +/*---------------------------------------------------------------------------*/ int ruc_send(struct ruc_conn *c, rimeaddr_t *receiver) { diff --git a/core/net/rime/ruc.h b/core/net/rime/ruc.h index 959a77a8e..737c7abfd 100644 --- a/core/net/rime/ruc.h +++ b/core/net/rime/ruc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ruc.h,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: ruc.h,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -58,6 +58,7 @@ struct ruc_conn { void ruc_open(struct ruc_conn *c, u16_t channel, const struct ruc_callbacks *u); +void ruc_close(struct ruc_conn *c); int ruc_send(struct ruc_conn *c, rimeaddr_t *receiver); diff --git a/core/net/rime/sabc.c b/core/net/rime/sabc.c index f99306216..63fb233e1 100644 --- a/core/net/rime/sabc.c +++ b/core/net/rime/sabc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sabc.c,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: sabc.c,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -64,6 +64,13 @@ sabc_open(struct sabc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +sabc_close(struct sabc_conn *c) +{ + abc_close(&c->c); + ctimer_setop(&c->t); +} +/*---------------------------------------------------------------------------*/ static void send(void *ptr) { diff --git a/core/net/rime/sabc.h b/core/net/rime/sabc.h index d05c14d82..9fee305ba 100644 --- a/core/net/rime/sabc.h +++ b/core/net/rime/sabc.h @@ -44,7 +44,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sabc.h,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: sabc.h,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -98,7 +98,7 @@ struct sabc_conn { */ void sabc_open(struct sabc_conn *c, u16_t channel, const struct sabc_callbacks *u); - +void sabc_close(struct sabc_conn *c); /** * \brief Send a stubborn message. diff --git a/core/net/rime/sibc.c b/core/net/rime/sibc.c index 3229da3ae..d3f818a98 100644 --- a/core/net/rime/sibc.c +++ b/core/net/rime/sibc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sibc.c,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: sibc.c,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -63,6 +63,13 @@ sibc_open(struct sibc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +sibc_close(struct sibc_conn *c) +{ + ibc_close(&c->c); + ctimer_stop(&c->t); +} +/*---------------------------------------------------------------------------*/ static void send(void *ptr) { diff --git a/core/net/rime/sibc.h b/core/net/rime/sibc.h index 270e1c239..de0116b10 100644 --- a/core/net/rime/sibc.h +++ b/core/net/rime/sibc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sibc.h,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: sibc.h,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -61,6 +61,7 @@ struct sibc_conn { void sibc_open(struct sibc_conn *c, u16_t channel, const struct sibc_callbacks *u); +void sibc_close(struct sibc_conn *c); int sibc_send_stubborn(struct sibc_conn *c, clock_time_t t); void sibc_cancel(struct sibc_conn *c); diff --git a/core/net/rime/suc.c b/core/net/rime/suc.c index 15b6e7bcc..f31632f7f 100644 --- a/core/net/rime/suc.c +++ b/core/net/rime/suc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: suc.c,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: suc.c,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -63,6 +63,13 @@ suc_open(struct suc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +suc_close(struct suc_conn *c) +{ + uc_close(&c->c); + ctimer_stop(&c->t); +} +/*---------------------------------------------------------------------------*/ static void send(void *ptr) { diff --git a/core/net/rime/suc.h b/core/net/rime/suc.h index eabf068fd..90ece4c69 100644 --- a/core/net/rime/suc.h +++ b/core/net/rime/suc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: suc.h,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: suc.h,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -62,6 +62,7 @@ struct suc_conn { void suc_open(struct suc_conn *c, u16_t channel, const struct suc_callbacks *u); +void suc_close(struct suc_conn *c); int suc_send_stubborn(struct suc_conn *c, rimeaddr_t *receiver); void suc_cancel(struct suc_conn *c); diff --git a/core/net/rime/tree.c b/core/net/rime/tree.c index 006fbc8ad..5f5bb2427 100644 --- a/core/net/rime/tree.c +++ b/core/net/rime/tree.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: tree.c,v 1.3 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: tree.c,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -193,6 +193,13 @@ tree_open(const struct tree_callbacks *cb) } /*---------------------------------------------------------------------------*/ void +tree_close(void) +{ + sibc_close(&sibc_conn); + ruc_close(&ruc_conn); +} +/*---------------------------------------------------------------------------*/ +void tree_set_sink(int should_be_sink) { if(should_be_sink) { diff --git a/core/net/rime/tree.h b/core/net/rime/tree.h index 7338cd4b1..3a4a5afdb 100644 --- a/core/net/rime/tree.h +++ b/core/net/rime/tree.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: tree.h,v 1.2 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: tree.h,v 1.3 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -47,6 +47,7 @@ struct tree_callbacks { }; void tree_open(const struct tree_callbacks *callbacks); +void tree_close(void); void tree_send(void); diff --git a/core/net/rime/uc.c b/core/net/rime/uc.c index b06cdfbed..2d7634bd5 100644 --- a/core/net/rime/uc.c +++ b/core/net/rime/uc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uc.c,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: uc.c,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -70,6 +70,12 @@ uc_open(struct uc_conn *c, u16_t channel, c->u = u; } /*---------------------------------------------------------------------------*/ +void +uc_close(struct uc_conn *c) +{ + ibc_close(&c->c); +} +/*---------------------------------------------------------------------------*/ int uc_send(struct uc_conn *c, rimeaddr_t *receiver) { diff --git a/core/net/rime/uc.h b/core/net/rime/uc.h index ede96a8d8..1d52338b4 100644 --- a/core/net/rime/uc.h +++ b/core/net/rime/uc.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uc.h,v 1.4 2007/03/19 19:24:37 adamdunkels Exp $ + * $Id: uc.h,v 1.5 2007/03/19 22:10:17 adamdunkels Exp $ */ /** @@ -56,6 +56,8 @@ struct uc_conn { void uc_open(struct uc_conn *c, u16_t channel, const struct uc_callbacks *u); +void uc_close(struct uc_conn *c); + int uc_send(struct uc_conn *c, rimeaddr_t *receiver); #endif /* __UC_H__ */