mandulaj / PZEM-004T-v30

Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter
MIT License
256 stars 108 forks source link

Update API for HW and SoftwareSerial interface #68

Closed mandulaj closed 2 years ago

mandulaj commented 2 years ago

Getting SoftwareSerial to work across multiple platforms is a pain. And atempting to abstract everything from the user turned out to be a source of many problems. Such as #21 #41 #61 and #65 to name a few...

As a result, the library will move away from handling its own instance of SoftwareSerial and instead utilize the Stream interface. During instantiation, user will pass the SWSerial object as a reference which will be cased to a Stream.

The HW inteface is also updated to utilize references instead of pointers in order to make the API more streamlined. In the future passing pointers will be completely deprecated.