From d4c4ab82ea4820768fb87744d15d2de450e77abf Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 7 Dec 2016 21:48:37 +0100 Subject: [PATCH] Fix debug message, add test sketch (#682) --- core/MySensorsCore.cpp | 6 +++-- core/MySensorsCore.h | 2 +- ...serial_gateway_no_transport_full_debug.ino | 24 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 tests/Arduino/sketches/serial_gateway_no_transport_full_debug/serial_gateway_no_transport_full_debug.ino diff --git a/core/MySensorsCore.cpp b/core/MySensorsCore.cpp index 606fb31..be567a5 100644 --- a/core/MySensorsCore.cpp +++ b/core/MySensorsCore.cpp @@ -145,9 +145,11 @@ void _begin(void) { CORE_DEBUG(PSTR("MCO:BGN:STP\n")); // setup callback setup(); } - +#if defined(MY_SENSOR_NETWORK) CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=%d\n"), isTransportReady()); - +#else + CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=NA\n")); +#endif // reset wdt before handing over to loop hwWatchdogReset(); } diff --git a/core/MySensorsCore.h b/core/MySensorsCore.h index 7eda5d1..1c82e0b 100644 --- a/core/MySensorsCore.h +++ b/core/MySensorsCore.h @@ -43,7 +43,7 @@ * | | MCO | BGN | BFR | Callback before() * | | MCO | BGN | MTR | MY_TRANSPORT_RELAXED enabled * | | MCO | BGN | STP | Callback setup() - * | | MCO | BGN | INIT OK,TSP=%%d | Core initialised, transport status (TSP), 1=initialised, 0=not initialised + * | | MCO | BGN | INIT OK,TSP=%%d | Core initialised, transport status (TSP), 1=initialised, 0=not initialised, NA=not available * | | MCO | BGN | NODE UNLOCKED | Node successfully unlocked (see signing chapter) * |!| MCO | BGN | TSP FAIL | Transport initialization failed * | | MCO | REG | REQ | Registration request diff --git a/tests/Arduino/sketches/serial_gateway_no_transport_full_debug/serial_gateway_no_transport_full_debug.ino b/tests/Arduino/sketches/serial_gateway_no_transport_full_debug/serial_gateway_no_transport_full_debug.ino new file mode 100644 index 0000000..4db3a70 --- /dev/null +++ b/tests/Arduino/sketches/serial_gateway_no_transport_full_debug/serial_gateway_no_transport_full_debug.ino @@ -0,0 +1,24 @@ +/* + * The MySensors Arduino library handles the wireless radio link and protocol + * between your home built sensors/actuators and HA controller of choice. + * The sensors forms a self healing radio network with optional repeaters. Each + * repeater and gateway builds a routing tables in EEPROM which keeps track of the + * network topology allowing messages to be routed to nodes. + * + * Created by Henrik Ekblad + * Copyright (C) 2013-2016 Sensnology AB + * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors + * + * Documentation: http://www.mysensors.org + * Support Forum: http://forum.mysensors.org + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + ******************************* + */ + +#define MY_DEBUG +#define MY_GATEWAY_SERIAL +#include \ No newline at end of file