arduino icon indicating copy to clipboard operation
arduino copied to clipboard

Import Arduino.h rather than Stream.h

Open soundanalogous opened this issue 5 years ago • 3 comments

Per this note in the Steam.h header file. I'm still trying to understand what led to this change on the Arduino side. Apparently Arduino is using a common core library and if you try to compile against an board from one of the 4 cores referenced in the readme, then you'll get an error regarding Stream.h not being found. Changing to Arduino.h per the note in the Stream.h header seemed to have resolved the issue. Not sure yet if there are other potential issues to be aware of per these changes.

soundanalogous avatar Aug 19 '20 22:08 soundanalogous

To repro the error I encountered, install the Arduino megaAVR boards package from the Boards Manager, then try to compile StandardFirmata (latest version in the master branch).

soundanalogous avatar Aug 19 '20 22:08 soundanalogous

Sounds good.

soundanalogous avatar Aug 21 '20 05:08 soundanalogous

Okay, I did a little research this weekend. Unfortunately, my quick fix will not appease the compiler, or address the larger problem of deprecation.

I propose that we leverage an interface to Stream, and/or use dependency injection. Unfortunately, doing so will break the FirmataMarshaller public API. Although, I don't really think we make guarantees about it, but I do believe people are using it.

Not only can we not support the megaAVR boards, but Arduino is forcing our hand with the deprecation of Stream. We definitely need to do something. @soundanalogous What are your feelings on breaking the FirmataMarshaller public API, specifically the .begin(Stream &s) method?

zfields avatar Aug 31 '20 11:08 zfields