-
Notifications
You must be signed in to change notification settings - Fork 0
MiPDebug
Telnet and Serial debug server for real-time remote diagnostics.
Inherits from Arduino's Print class to support formatted output methods (print, println, printf) over telnet network connections and optional hardware Serial.
Signature: void begin(String hostname, uint8_t startingDebugLevel=VERBOSE)
Summary: Initializes and starts the telnet debug server.
Parameters:
| Parameter | Description |
|---|---|
hostname |
Hostname broadcast by the telnet service. |
startingDebugLevel |
Initial active debug threshold (default: VERBOSE). |
Signature: void stop()
Summary: Stops the telnet debug server and disconnects active clients.
Signature: void handle()
Summary: Service loop handler for maintaining telnet client connections and processing commands.
Signature: void setSerialEnabled(bool enable)
Summary: Configures whether debug messages are echoed to HardwareSerial.
Parameters:
| Parameter | Description |
|---|---|
enable |
true to duplicate output to Serial, false to route to telnet only. |
Signature: void setResetCmdEnabled(bool enable)
Summary: Configures whether the telnet server allows remote system reset commands.
Parameters:
| Parameter | Description |
|---|---|
enable |
true to allow remote ESP8266 reset via telnet command, false to disallow. |
Signature: void setHelpProjectsCmds(String help)
Summary: Sets custom project help text displayed when a telnet client sends the help command.
Parameters:
| Parameter | Description |
|---|---|
help |
Formatting string detailing sketch-specific commands. |
Signature: void setCallBackProjectCmds(void(*callback)())
Summary: Registers a callback handler for custom sketch/project telnet commands.
Parameters:
| Parameter | Description |
|---|---|
callback |
Function pointer executed when a custom command is received. |
Signature: String getLastCommand()
Summary: Retrieves the last command string received from the connected telnet client.
Returns: String containing the command text.
Signature: void clearLastCommand()
Summary: Clears the internal last-command buffer string.
Signature: void showTime(bool show)
Summary: Configures whether timestamps (in milliseconds) are prepended to log outputs.
Parameters:
| Parameter | Description |
|---|---|
show |
true to show timestamps, false to omit. |
Signature: void showProfiler(bool show, uint32_t minTime=0)
Summary: Configures execution profiler logging between consecutive prints.
Parameters:
| Parameter | Description |
|---|---|
show |
true to show elapsed execution time, false to omit. |
minTime |
Minimum elapsed time threshold in milliseconds required to trigger profiler output. |
Signature: void showDebugLevel(bool show)
Summary: Configures whether debug severity tags ([INFO], [DEBUG], etc.) are prepended to messages.
Parameters:
| Parameter | Description |
|---|---|
show |
true to show level tags, false to omit. |
Signature: void showColors(bool show)
Summary: Configures whether ANSI color codes are included in telnet log output.
Parameters:
| Parameter | Description |
|---|---|
show |
true to enable color codes, false for plain text. |
Signature: void autoProfilerLevel(uint32_t millisElapsed)
Summary: Automatically switches logging level to PROFILER if elapsed time exceeds threshold.
Parameters:
| Parameter | Description |
|---|---|
millisElapsed |
Threshold duration in milliseconds between loop iterations. |
Signature: void setFilter(String filter)
Summary: Applies a text filter string to debug outputs.
Parameters:
| Parameter | Description |
|---|---|
filter |
Substring filter; only log lines containing this string will be printed. |
Signature: void setNoFilter()
Summary: Removes any active text filter string.
Signature: bool isActive(uint8_t debugLevel=DEBUG)
Summary: Checks if logging output is active for the specified debug level.
Parameters:
| Parameter | Description |
|---|---|
debugLevel |
Target debug level to check (default: DEBUG). |
Returns: true if specified level meets or exceeds active threshold; false otherwise.
Signature: size_t write(uint8_t byte) override
Summary: Writes a single byte to active debug channels (Stream/Print override).
Parameters:
| Parameter | Description |
|---|---|
byte |
Character byte to output. |
Returns: Number of bytes written (1 on success).
Signature: size_t write(const uint8_t *buffer, size_t size) override
Summary: Writes a byte buffer to active debug channels (Stream/Print override).
Parameters:
| Parameter | Description |
|---|---|
buffer |
Pointer to character array to output. |
size |
Number of bytes in buffer. |
Returns: Number of bytes successfully written.
Signature: String expand(String string)
Summary: Helper method to expand CR/LF control characters into literal "\r" and "\n" strings.
Parameters:
| Parameter | Description |
|---|---|
string |
Input string containing raw control characters. |
Returns: String with CR/LF replaced by escaped representations.
Signature: const uint8_t PROFILER
Details:
Used to display execution timing of code sections (profiler).
Signature: const uint8_t VERBOSE
Details:
Used to display detailed verbose messages.
Signature: const uint8_t DEBUG
Details:
Used to display standard debug messages.
Signature: const uint8_t INFO
Details:
Used to display informational status messages.
Signature: const uint8_t WARNING
Details:
Used to display warning messages.
Signature: const uint8_t ERROR
Details:
Used to display critical error messages.
Signature: const uint8_t ANY
Details:
Used to display messages unconditionally at any active level.
🔗 Quick Links: Main Repository • Report an Issue • Wiki Home
An open-source API for the WowWee MiP Robot. Licensed under Apache-2.0.
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi