Open RobertGnz opened 11 months ago
Also see https://github.com/plerup/espsoftwareserial/issues/301
edit: nvm the code snippet, enum does not work like that (sadly)
Can't use 3.1.2 release because it should oblige to change all existing applications.
Also see plerup/espsoftwareserial#301
edit: nvm the code snippet, enum does not work like that (sadly)
The problem comes from the directive: " using namespace EspSoftwareSerial; " line 433 which is not a good pratice in terms of programming because it may lead to collision problem.
Please have a look at this page https://learn.microsoft.com/en-us/cpp/cpp/namespaces-cpp?view=msvc-170 and pay a special attention to the note in chapter "Using directives"
What I mean, the fix should happen upstream first. Please re-read the issue I linked, swserial is an external lib :>
What I mean, the fix should happen upstream first. Please re-read the issue I linked, swserial is an external lib :>
You just linked back to this issue and nothing else.
EspSoftwareSerial is external library, so @mcspr tries to say that you are barking on wrong tree here - please report the error in the original one, because the original repository has to be changed first (it's used as submodule).
EspSoftwareSerial is external library, so @mcspr tries to say that you are barking on wrong tree here - please report the error in the original one, because the original repository has to be changed first (it's used as submodule).
Where is the original repository ?
Did you try to click https://github.com/esp8266/Arduino/tree/master/libraries at the library? It leads to https://github.com/plerup/espsoftwareserial/tree/bcfd6d10e6a45a0d07705d08728f293defe9cc1d ...
Did you try to click https://github.com/esp8266/Arduino/tree/master/libraries at the library? It leads to https://github.com/plerup/espsoftwareserial/tree/bcfd6d10e6a45a0d07705d08728f293defe9cc1d ...
The problem comes because of the directive using namespace EspSoftwareSerial wich leads to a global pollution.
Yes, exactly described here https://github.com/plerup/espsoftwareserial/issues/301 as @mcspr told you... This is wrong repository as it has nothing to do with the issue.
In version 3.1.1 of SoftwareSerial.h we have:
enum SoftwareSerialConfig { SWSERIAL_5N1 = SWSERIAL_PARITY_NONE, etc...
this was changed in version 3.1.2 with:
enum Config { SWSERIAL_5N1 = SWSERIAL_PARITY_NONE, etc...
which lead to a conflicting name problem when Config is used in an application program but with another definition despite the namespace statement added in SoftwareSerial.h version 3.1.2