Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass Stream object instead of integer reference #17

Closed
4-20ma opened this issue May 22, 2015 · 0 comments
Closed

Pass Stream object instead of integer reference #17

4-20ma opened this issue May 22, 2015 · 0 comments

Comments

@4-20ma
Copy link
Owner

4-20ma commented May 22, 2015

Per Arduino style guide:

When using serial communication, allow the user to specify any Stream object, rather than hard-coding "Serial". This will make your library compatible all serial ports on Mega and the Due, and can also use alternate interfaces like SoftwareSerial. The Stream object can be passed to your library's constructor or to a begin() function (as a reference, not a pointer). See Firmata 2.3 or XBee 0.4 for examples of each approach.

Refer to http://www.arduino.cc/en/Reference/APIStyleGuide.

Changes:

  • update ModbusMaster.h, ModbusMaster.cpp interface, documentation
  • update examples

Test with real hardware and signal tracer

@4-20ma 4-20ma added this to the 1.0.0 milestone May 22, 2015
@4-20ma 4-20ma added the style label May 22, 2015
4-20ma added a commit that referenced this issue May 24, 2015
- BREAK: This is a breaking change to the interface. ModbusMaster now takes a
  serial object which has been initialized with the appropriate baud rate.
  Any Stream object may be used, including SoftwareSerial.
- As a byproduct of these changes, the library should now be able to be used
  on other architectures besides AVR and SAM.
4-20ma added a commit that referenced this issue May 24, 2015
- BREAK: This is a breaking change to the interface. ModbusMaster now takes a
  serial object which has been initialized with the appropriate baud rate.
  Any Stream object may be used, including SoftwareSerial.
- As a byproduct of these changes, the library should now be able to be used
  on other architectures besides AVR and SAM.
@4-20ma 4-20ma closed this as completed in 9e611e3 Sep 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant