From 56a8a7465ce8a02148a0e6b1bae4d3d7062c78fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 17 Mar 2014 17:18:59 +0100 Subject: Add protocol debug functions --- include/gmrf/gmrf.h | 9 +++++++++ mmss/gmrf.cpp | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/gmrf/gmrf.h b/include/gmrf/gmrf.h index 19f115a..54e9e90 100644 --- a/include/gmrf/gmrf.h +++ b/include/gmrf/gmrf.h @@ -73,6 +73,15 @@ typedef void (*gmrf_scheduled_func)(gmrf_context_t *ctx, void *arg); void gmrf_schedule(gmrf_t *gmrf, gmrf_scheduled_func f, void *arg, unsigned delay); +/* debug and simulation functions */ +void gmrf_debug_init(gmrf_t *gmrf, const uint8_t *node_id, size_t len); + +void gmrf_debug_neigh(gmrf_t *gmrf, gmrf_iface_t *iface, const gmrf_addr_t *addr, float rxcost, float txcost); +void gmrf_debug_neigh_lost(gmrf_t *gmrf, gmrf_iface_t *iface, const gmrf_addr_t *addr); + +void gmrf_debug_route(gmrf_t *gmrf, const uint8_t *node_id, size_t len, gmrf_iface_t *iface, const gmrf_addr_t *addr, int metric); +void gmrf_debug_route_lost(gmrf_t *gmrf, const uint8_t *node_id, size_t len); + /* implemented by protocol */ extern const char *gmrf_protocol_name; extern const char *gmrf_protocol_version; diff --git a/mmss/gmrf.cpp b/mmss/gmrf.cpp index b97f1e5..9db3c43 100644 --- a/mmss/gmrf.cpp +++ b/mmss/gmrf.cpp @@ -86,4 +86,19 @@ void gmrf_logf(gmrf_t *gmrf, int priority, const char *format, ...) { va_end(ap); } +void gmrf_debug_init(gmrf_t *gmrf, const uint8_t *node_id, size_t len) { +} + +void gmrf_debug_neigh(gmrf_t *gmrf, gmrf_iface_t *iface, const gmrf_addr_t *addr, float rxcost, float txcost) { +} + +void gmrf_debug_neigh_lost(gmrf_t *gmrf, gmrf_iface_t *iface, const gmrf_addr_t *addr) { +} + +void gmrf_debug_route(gmrf_t *gmrf, const uint8_t *node_id, size_t len, gmrf_iface_t *iface, const gmrf_addr_t *addr, int metric) { +} + +void gmrf_debug_route_lost(gmrf_t *gmrf, const uint8_t *node_id, size_t len) { +} + } -- cgit v1.2.3