Refactored the mesh code by splitting multi-hop forwarding and route discovery. The mesh module is now much simpler than before

This commit is contained in:
adamdunkels 2007-03-22 17:34:16 +00:00
parent c914d268ca
commit 2ef8c91bbc
4 changed files with 393 additions and 240 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: mesh.h,v 1.4 2007/03/19 22:10:17 adamdunkels Exp $
* $Id: mesh.h,v 1.5 2007/03/22 17:34:16 adamdunkels Exp $
*/
/**
@ -42,18 +42,30 @@
#define __MESH_H__
#include "net/rime.h"
#include "net/rime/mh.h"
#include "net/rime/route-discovery.h"
struct mesh_conn;
struct mesh_callbacks {
void (* sent)(void);
void (* recv)(rimeaddr_t *from);
void (* recv)(struct mesh_conn *c, rimeaddr_t *from);
void (* sent)(struct mesh_conn *c);
void (* timedout)(struct mesh_conn *c);
};
void mesh_open(const struct mesh_callbacks *callbacks,
void (* data_send_function)(rimeaddr_t *next));
int mesh_send(rimeaddr_t *dest);
struct mesh_conn {
struct mh_conn mh;
struct route_discovery_conn route_discovery_conn;
struct queuebuf *queued_data;
rimeaddr_t queued_data_dest;
const struct mesh_callbacks *cb;
};
void mesh_data_received(rimeaddr_t *from);
void mesh_open(struct mesh_conn *c, u16_t channels,
const struct mesh_callbacks *callbacks);
void mesh_close(void);
int mesh_send(struct mesh_conn *c, rimeaddr_t *dest);
void mesh_close(struct mesh_conn *c);
#endif /* __MESH_H__ */