SparkFun Iridium 9604  v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
Loading...
Searching...
No Matches
sfe_debug.h
Go to the documentation of this file.
1
28#pragma once
29
30#include "sfe_platform.h"
31#include "sfe_bus.h"
32
34{
35
38 {
39 public:
41 void debugPrint(const char *message, bool important = false);
43 void debugPrint(int value, bool important = false);
45 void debugPrint(int value, int printBase, bool important = false);
47 void debugPrint(unsigned int value, bool important = false);
49 void debugPrint(unsigned int value, int printBase, bool important = false);
51 void debugPrint(long value, bool important = false);
53 void debugPrint(long value, int printBase, bool important = false);
55 void debugPrint(unsigned long value, bool important = false);
57 void debugPrint(unsigned long value, int printBase, bool important = false);
59 void debugPrintDouble(double value, int decimalPlaces, bool important = false);
60
62 void debugPrintln(const char *message, bool important = false);
64 void debugPrintln(int value, bool important = false);
66 void debugPrintln(int value, int printBase, bool important = false);
68 void debugPrintln(unsigned int value, bool important = false);
70 void debugPrintln(unsigned int value, int printBase, bool important = false);
72 void debugPrintln(long value, bool important = false);
74 void debugPrintln(long value, int printBase, bool important = false);
76 void debugPrintln(unsigned long value, bool important = false);
78 void debugPrintln(unsigned long value, int printBase, bool important = false);
80 void debugPrintln(void);
81
83 void debugWrite(char c, bool important = false);
84
86 void atDebugPrint(const char *message);
88 void atDebugWrite(const char *buffer, size_t length);
90 void atDebugWrite(char c);
91
93 bool debugEnabled(void) const { return _printDebug; }
95 bool atDebugEnabled(void) const { return _printAtDebug; }
96
106 {
108 _printDebug = other._printDebug;
112 }
113
114 protected:
115 SfePrint _debugSerial;
116 bool _printDebug = false;
117 bool _printLimitedDebug = false;
118 SfePrint _debugAtSerial;
119 bool _printAtDebug = false;
120 };
121
122} // namespace SparkFun_Iridium_9604
Debug printing: replaces the SARA-R5 library _debugPort prints. A base class of DevIridium9604 and th...
Definition: sfe_debug.h:38
void debugWrite(char c, bool important=false)
Write a single raw character to the debug port, if debugging is enabled.
Definition: sfe_debug.cpp:151
bool _printLimitedDebug
Flag to print limited (important only) debug messages.
Definition: sfe_debug.h:117
bool atDebugEnabled(void) const
true if AT-traffic debug messages are enabled.
Definition: sfe_debug.h:95
void atDebugPrint(const char *message)
Echo raw AT traffic to the AT debug port, if AT debugging is enabled (enableAtDebugging).
Definition: sfe_debug.cpp:157
void atDebugWrite(const char *buffer, size_t length)
Echo raw AT traffic (binary-safe) to the AT debug port, if AT debugging is enabled.
Definition: sfe_debug.cpp:162
void debugPrintDouble(double value, int decimalPlaces, bool important=false)
Print a floating point debug value with the given number of decimal places, if debugging is enabled.
Definition: sfe_debug.cpp:70
SfePrint _debugAtSerial
The stream to echo the AT traffic to if enabled.
Definition: sfe_debug.h:118
void debugPrintln(void)
Print a blank debug line, if debugging is enabled and not in limited-debug mode.
Definition: sfe_debug.cpp:145
bool _printDebug
Flag to print the debug messages.
Definition: sfe_debug.h:116
SfePrint _debugSerial
The stream to send debug messages to if enabled.
Definition: sfe_debug.h:115
void debugPrint(const char *message, bool important=false)
Print a debug message (no trailing newline), if debugging is enabled.
Definition: sfe_debug.cpp:25
void copyDebugStateFrom(const SfeDebugPrint &other)
Copy debug state (output streams and enabled flags) from another SfeDebugPrint.
Definition: sfe_debug.h:105
bool _printAtDebug
Flag to echo the AT traffic.
Definition: sfe_debug.h:119
bool debugEnabled(void) const
true if debug messages are enabled.
Definition: sfe_debug.h:93
Definition: nmeaMessage.h:30