@@ -69,6 +69,7 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
69
69
#include "lwip/apps/sntp.h"
70
70
#include "utils/interrupt_char.h"
71
71
#include "py/obj.h"
72
+ #include "py/mpprint.h"
72
73
#include "modmachine.h"
73
74
74
75
/* -------------------------------------------------------------------------- */
@@ -1236,7 +1237,7 @@ void TASK_lora_gw(void *pvParameters) {
1236
1237
}
1237
1238
1238
1239
machine_pygate_set_status (PYGATE_STARTED );
1239
- printf ( "LoRa GW started\n" );
1240
+ mp_printf ( & mp_plat_print , "LoRa GW started\n" );
1240
1241
1241
1242
/* main loop task : statistics collection */
1242
1243
while (!exit_sig && !quit_sig ) {
@@ -1325,32 +1326,32 @@ void TASK_lora_gw(void *pvParameters) {
1325
1326
#if DEBUG_LEVEL >= INFO_
1326
1327
if ( debug_level >= INFO_ ){
1327
1328
MSG_INFO ("[main] report\n##### %s #####\n" , stat_timestamp );
1328
- printf ( "### [UPSTREAM] ###\n" );
1329
- printf ( "# RF packets received by concentrator: %u\n" , cp_nb_rx_rcv );
1330
- printf ( "# CRC_OK: %.2f%%, CRC_FAIL: %.2f%%, NO_CRC: %.2f%%\n" , 100.0 * rx_ok_ratio , 100.0 * rx_bad_ratio , 100.0 * rx_nocrc_ratio );
1331
- printf ( "# RF packets forwarded: %u (%u bytes)\n" , cp_up_pkt_fwd , cp_up_payload_byte );
1332
- printf ( "# PUSH_DATA datagrams sent: %u (%u bytes)\n" , cp_up_dgram_sent , cp_up_network_byte );
1333
- printf ( "# PUSH_DATA acknowledged: %.2f%%\n" , 100.0 * up_ack_ratio );
1334
- printf ( "### [DOWNSTREAM] ###\n" );
1335
- printf ( "# PULL_DATA sent: %u (%.2f%% acknowledged)\n"
8000
, cp_dw_pull_sent , 100.0 * dw_ack_ratio );
1336
- printf ( "# PULL_RESP(onse) datagrams received: %u (%u bytes)\n" , cp_dw_dgram_rcv , cp_dw_network_byte );
1337
- printf ( "# RF packets sent to concentrator: %u (%u bytes)\n" , (cp_nb_tx_ok + cp_nb_tx_fail ), cp_dw_payload_byte );
1338
- printf ( "# TX errors: %u\n" , cp_nb_tx_fail );
1329
+ mp_printf ( & mp_plat_print , "### [UPSTREAM] ###\n" );
1330
+ mp_printf ( & mp_plat_print , "# RF packets received by concentrator: %u\n" , cp_nb_rx_rcv );
1331
+ mp_printf ( & mp_plat_print , "# CRC_OK: %.2f%%, CRC_FAIL: %.2f%%, NO_CRC: %.2f%%\n" , 100.0 * rx_ok_ratio , 100.0 * rx_bad_ratio , 100.0 * rx_nocrc_ratio );
1332
+ mp_printf ( & mp_plat_print , "# RF packets forwarded: %u (%u bytes)\n" , cp_up_pkt_fwd , cp_up_payload_byte );
1333
+ mp_printf ( & mp_plat_print , "# PUSH_DATA datagrams sent: %u (%u bytes)\n" , cp_up_dgram_sent , cp_up_network_byte );
1334
+ mp_printf ( & mp_plat_print , "# PUSH_DATA acknowledged: %.2f%%\n" , 100.0 * up_ack_ratio );
1335
+ mp_printf ( & mp_plat_print , "### [DOWNSTREAM] ###\n" );
1336
+ mp_printf ( & mp_plat_print , "# PULL_DATA sent: %u (%.2f%% acknowledged)\n" , cp_dw_pull_sent , 100.0 * dw_ack_ratio );
1337
+ mp_printf ( & mp_plat_print , "# PULL_RESP(onse) datagrams received: %u (%u bytes)\n" , cp_dw_dgram_rcv , cp_dw_network_byte );
1338
+ mp_printf ( & mp_plat_print , "# RF packets sent to concentrator: %u (%u bytes)\n" , (cp_nb_tx_ok + cp_nb_tx_fail ), cp_dw_payload_byte );
1339
+ mp_printf ( & mp_plat_print , "# TX errors: %u\n" , cp_nb_tx_fail );
1339
1340
if (cp_nb_tx_requested != 0 ) {
1340
- printf ( "# TX rejected (collision packet): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_collision_packet / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_collision_packet );
1341
- printf ( "# TX rejected (collision beacon): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_collision_beacon / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_collision_beacon );
1342
- printf ( "# TX rejected (too late): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_too_late / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_too_late );
1343
- printf ( "# TX rejected (too early): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_too_early / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_too_early );
1341
+ mp_printf ( & mp_plat_print , "# TX rejected (collision packet): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_collision_packet / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_collision_packet );
1342
+ mp_printf ( & mp_plat_print , "# TX rejected (collision beacon): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_collision_beacon / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_collision_beacon );
1343
+ mp_printf ( & mp_plat_print , "# TX rejected (too late): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_too_late / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_too_late );
1344
+ mp_printf ( & mp_plat_print , "# TX rejected (too early): %.2f%% (req:%u, rej:%u)\n" , 100.0 * cp_nb_tx_rejected_too_early / cp_nb_tx_requested , cp_nb_tx_requested , cp_nb_tx_rejected_too_early );
1344
1345
}
1345
- printf ( "### [JIT] ###\n" );
1346
+ mp_printf ( & mp_plat_print , "### [JIT] ###\n" );
1346
1347
jit_print_queue (& jit_queue , false);
1347
- printf ( "### [GPS] ###\n" );
1348
+ mp_printf ( & mp_plat_print , "### [GPS] ###\n" );
1348
1349
if (gps_fake_enable == true) {
1349
- printf ( "# GPS *FAKE* coordinates: latitude %.5f, longitude %.5f, altitude %i m\n" , cp_gps_coord .lat , cp_gps_coord .lon , cp_gps_coord .alt );
1350
+ mp_printf ( & mp_plat_print , "# GPS *FAKE* coordinates: latitude %.5f, longitude %.5f, altitude %i m\n" , cp_gps_coord .lat , cp_gps_coord .lon , cp_gps_coord .alt );
1350
1351
} else {
1351
- printf ( "# GPS sync is disabled\n" );
1352
+ mp_printf ( & mp_plat_print , "# GPS sync is disabled\n" );
1352
1353
}
1353
- printf ( "##### END #####\n" );
1354
+ mp_printf ( & mp_plat_print , "##### END #####\n" );
1354
1355
}
1355
1356
#endif
1356
1357
0 commit comments