@@ -63,35 +63,35 @@ int LoRaConnectionHandler::write(const uint8_t *buf, size_t size) {
6363 if (err != size) {
6464 switch (err) {
6565 case LoRaCommunicationError::LORA_ERROR_ACK_NOT_RECEIVED : {
66- Serial. println ( " Message ack was not received, the message could not be delivered" );
66+ Debug. print ( DBG_ERROR , " Message ack was not received, the message could not be delivered" );
6767 } break ;
6868 case LoRaCommunicationError::LORA_ERROR_GENERIC : {
69- Serial. println ( " LoRa generic error (LORA_ERROR)" );
69+ Debug. print ( DBG_ERROR , " LoRa generic error (LORA_ERROR)" );
7070 } break ;
7171 case LoRaCommunicationError::LORA_ERROR_WRONG_PARAM : {
72- Serial. println ( " LoRa malformed param error (LORA_ERROR_PARAM" );
72+ Debug. print ( DBG_ERROR , " LoRa malformed param error (LORA_ERROR_PARAM" );
7373 } break ;
7474 case LoRaCommunicationError::LORA_ERROR_COMMUNICATION_BUSY : {
75- Serial. println ( " LoRa chip is busy (LORA_ERROR_BUSY)" );
75+ Debug. print ( DBG_ERROR , " LoRa chip is busy (LORA_ERROR_BUSY)" );
7676 } break ;
7777 case LoRaCommunicationError::LORA_ERROR_MESSAGE_OVERFLOW : {
78- Serial. println ( " LoRa chip overflow error (LORA_ERROR_OVERFLOW)" );
78+ Debug. print ( DBG_ERROR , " LoRa chip overflow error (LORA_ERROR_OVERFLOW)" );
7979 } break ;
8080 case LoRaCommunicationError::LORA_ERROR_NO_NETWORK_AVAILABLE : {
81- Serial. println ( " LoRa no network error (LORA_ERROR_NO_NETWORK)" );
81+ Debug. print ( DBG_ERROR , " LoRa no network error (LORA_ERROR_NO_NETWORK)" );
8282 } break ;
8383 case LoRaCommunicationError::LORA_ERROR_RX_PACKET : {
84- Serial. println ( " LoRa rx error (LORA_ERROR_RX)" );
84+ Debug. print ( DBG_ERROR , " LoRa rx error (LORA_ERROR_RX)" );
8585 } break ;
8686 case LoRaCommunicationError::LORA_ERROR_REASON_UNKNOWN : {
87- Serial. println ( " LoRa unknown error (LORA_ERROR_UNKNOWN)" );
87+ Debug. print ( DBG_ERROR , " LoRa unknown error (LORA_ERROR_UNKNOWN)" );
8888 } break ;
8989 case LoRaCommunicationError::LORA_ERROR_MAX_PACKET_SIZE : {
90- Serial. println ( " Message length is bigger than max LoRa packet!" );
90+ Debug. print ( DBG_ERROR , " Message length is bigger than max LoRa packet!" );
9191 } break ;
9292 }
9393 } else {
94- Serial. println ( " Message sent correctly!" );
94+ Debug. print ( DBG_INFO , " Message sent correctly!" );
9595 }
9696 return err;
9797}
0 commit comments