adafruit / Adafruit_nRF8001

Drivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout
109 stars 53 forks source link

Properly override Stream multi-byte write() method #21

Open alexozer opened 7 years ago

alexozer commented 7 years ago

Previously, the write() method for uint8_t buffers didn't quite have the right signature to override the method in the Stream class, which made it impossible to call from a Stream pointer.

Also, C++11 override keywords were added to make overriding Stream methods more explicit and compiler-checked.

One possible complication that may arise is that in order to accept a const uint8_t* argument, write() must cast it to uint8_t* to pass it to the aci library, which may modify the buffer as unexpected by the new const method signature.