Fix namespace conflicts in TankAlarm 112025 Arduino sketches #166
+8
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Arduino compilation failed for all three TankAlarm-112025 sketches due to namespace conflicts between
arduino::Streamandmbed::Streamon the Mbed OS platform.Root Cause
The shared library used
using namespace mbed;, which broughtmbed::Streaminto the global namespace. Third-party libraries (Notecard, ArduinoJson) expectedarduino::Streamin the global namespace, causing ambiguity:Additionally, sketches redundantly included libraries already pulled in by the shared header, and the Client sketch redefined constants already declared in
TankAlarm_Common.h.Changes
TankAlarm-112025-Common/src/TankAlarm_Platform.h
using namespace mbed;with specific type declarationsusing arduino::Stream;andusing arduino::Print;for library compatibilityAll three sketches
#include <Notecard.h>and#include <ArduinoJson.h>NOTECARD_I2C_ADDRESSandNOTECARD_I2C_FREQUENCYconstant definitions from Client sketchAll sketches now compile successfully for Arduino Opta.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.