BC127 Bluetooth Audio Chip - Library Port Help

I’m using this Bluetooth chip as an Audio receiver for a project that has an Amp and speakers built in for music and audible system status alerts. This chip has tested out to work great and has many other features that I’m not currently using.

I’m trying to port the Arduino library for this and it’s using software serial and I need some help changing that to the Photons UART TX and RX pins.

The library author says he used Software Serial to make uploading new code easier which makes sense :slight_smile:

// Include the two libraries we need to use this; I'm using a software serial port
//  because time-sharing the hardware port with uploading code is a pain.
#include <SparkFunbc127.h>
#include <SoftwareSerial.h>

// Create a software serial port.
SoftwareSerial swPort(3,2);  // RX, TX
// Create a BC127 and attach the software serial port to it.
BC127 BTModu(&swPort);

Now the SoftwareSerial swPort(3,2); //RX,TX line gets handled by this function in the SparkFunbc127.cpp file which is the other part of the code I think needs to changed.

// Constructor. All we really need to do is link the user's Stream instance to
//  our local reference.
BC127::BC127(Stream *sp)
  _serialPort = sp;
  _numAddresses = -1;

The GitHub library is here if it helps to see it all.

I think all that needs to be changed is to direct the Software Serial data flow to the Photons UART Serial pins. I’m no expert on this though so that’s why I’m asking the experts :wink:

Any help is apperciated!

You can use my ParticleSoftSerial library if you want tho’

And since Serial1 is also derived from Stream you should still be able to just pass a pointer to that.

Got this working by removing the SoftwareSerial and just declaring Serial1 as the serial port. Then I had to change all the swserial calls to Serial1.

#include <bc127.h>
BC127 BC127Module(&Serial1);