Merge pull request #307 from simonduq/contrib/tsch-print-schedule

TSCH schedule printout
This commit is contained in:
George Oikonomou 2018-02-25 21:57:38 +00:00 committed by GitHub
commit 2138eb08d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 8 deletions

View File

@ -3,9 +3,12 @@ all: $(CONTIKI_PROJECT)
CONTIKI=../../..
MAKE_WITH_ORCHESTRA ?= 0 # force Orchestra from command line
MAKE_WITH_SECURITY ?= 0 # force Security from command line
MAKE_WITH_PERIODIC_ROUTES_PRINT ?= 0 # print #routes periodically, used for regression tests
# force Orchestra from command line
MAKE_WITH_ORCHESTRA ?= 0
# force Security from command line
MAKE_WITH_SECURITY ?= 0
# print #routes periodically, used for regression tests
MAKE_WITH_PERIODIC_ROUTES_PRINT ?= 0
MAKE_MAC = MAKE_MAC_TSCH
MODULES += os/services/shell

View File

@ -452,16 +452,15 @@ tsch_schedule_print(void)
if(!tsch_is_locked()) {
struct tsch_slotframe *sf = list_head(slotframe_list);
printf("Schedule: slotframe list\n");
LOG_PRINT("----- start slotframe list -----\n");
while(sf != NULL) {
struct tsch_link *l = list_head(sf->links_list);
printf("[Slotframe] Handle %u, size %u\n", sf->handle, sf->size.val);
printf("List of links:\n");
LOG_PRINT("Slotframe Handle %u, size %u\n", sf->handle, sf->size.val);
while(l != NULL) {
printf("[Link] Options %02x, type %u, timeslot %u, channel offset %u, address %u\n",
LOG_PRINT("* Link Options %02x, type %u, timeslot %u, channel offset %u, address %u\n",
l->link_options, l->link_type, l->timeslot, l->channel_offset, l->addr.u8[7]);
l = list_item_next(l);
}
@ -469,7 +468,7 @@ tsch_schedule_print(void)
sf = list_item_next(sf);
}
printf("Schedule: end of slotframe list\n");
LOG_PRINT("----- end slotframe list -----\n");
}
}
/*---------------------------------------------------------------------------*/

View File

@ -145,21 +145,25 @@ extern struct log_module all_modules[];
} while (0)
/* More compact versions of LOG macros */
#define LOG_PRINT(...) LOG(1, 0, "PRI", __VA_ARGS__)
#define LOG_ERR(...) LOG(1, LOG_LEVEL_ERR, "ERR", __VA_ARGS__)
#define LOG_WARN(...) LOG(1, LOG_LEVEL_WARN, "WARN", __VA_ARGS__)
#define LOG_INFO(...) LOG(1, LOG_LEVEL_INFO, "INFO", __VA_ARGS__)
#define LOG_DBG(...) LOG(1, LOG_LEVEL_DBG, "DBG", __VA_ARGS__)
#define LOG_PRINT_(...) LOG(0, 0, "PRI", __VA_ARGS__)
#define LOG_ERR_(...) LOG(0, LOG_LEVEL_ERR, "ERR", __VA_ARGS__)
#define LOG_WARN_(...) LOG(0, LOG_LEVEL_WARN, "WARN", __VA_ARGS__)
#define LOG_INFO_(...) LOG(0, LOG_LEVEL_INFO, "INFO", __VA_ARGS__)
#define LOG_DBG_(...) LOG(0, LOG_LEVEL_DBG, "DBG", __VA_ARGS__)
#define LOG_PRINT_LLADDR(...) LOG_LLADDR(0, __VA_ARGS__)
#define LOG_ERR_LLADDR(...) LOG_LLADDR(LOG_LEVEL_ERR, __VA_ARGS__)
#define LOG_WARN_LLADDR(...) LOG_LLADDR(LOG_LEVEL_WARN, __VA_ARGS__)
#define LOG_INFO_LLADDR(...) LOG_LLADDR(LOG_LEVEL_INFO, __VA_ARGS__)
#define LOG_DBG_LLADDR(...) LOG_LLADDR(LOG_LEVEL_DBG, __VA_ARGS__)
#define LOG_PRINT_6ADDR(...) LOG_6ADDR(0, __VA_ARGS__)
#define LOG_ERR_6ADDR(...) LOG_6ADDR(LOG_LEVEL_ERR, __VA_ARGS__)
#define LOG_WARN_6ADDR(...) LOG_6ADDR(LOG_LEVEL_WARN, __VA_ARGS__)
#define LOG_INFO_6ADDR(...) LOG_6ADDR(LOG_LEVEL_INFO, __VA_ARGS__)