Classic bluetooth serial - modifying an existing library

Doz1971
Posts: 1
Joined: Wed Jun 09, 2021 3:18 pm

Classic bluetooth serial - modifying an existing library

Postby Doz1971 » Wed Jun 09, 2021 3:28 pm

Hello. Thanks for having me.

I have an issue (which is why I'm here)

I am attempting to modify this library https://github.com/skyforcetw/Garminuin ... /GarminHUD

to work with ESP32's serial.BT

I've created a simple script which allows me to connect, and that works.

Obviously this library was never intended to work with ESP32's inbuilt bluetooth, so i *think* the parts I need to change are here, probably adding a bit in which uses serial.BT rather than either the inbuilt serial, or software serial on teensy or uno, for example.

I'm not here to ask someone to do this for me, but an explanation of what needs to happen, so I can learn. Google has sent me down a good few blind alleys so far.

Thanks in advance,
Doz.

Code: Select all

class GarminHUD: public GarminHUDInterface{
	protected:
#ifdef TEENSYDUINO
	HardwareSerial _serial;
#else
	HardwareSerial* _serial;
#endif
	SoftwareSerial* softserial;
	bool inSoftSerial = false;

	virtual int SendPacket(const char* pBuf, int nLen);
public:
	GarminHUD() : GarminHUDInterface()  {};
	
#ifdef TEENSYDUINO	
	bool Init(HardwareSerial serial);
#else
	bool Init(HardwareSerial* serial);
#endif
	bool Init(SoftwareSerial* serial);
	virtual ~GarminHUD();
	bool isInSoftSerial() {
		return inSoftSerial;
	}
};

#endif

Who is online

Users browsing this forum: No registered users and 83 guests