LLAP Library for Ciseco wireless products.
Dependents: Ciseco_LLAP_Test Ciseco_SRF_Shield
Library for Ciseco wireless modules http://shop.ciseco.co.uk/rf-module-range/
Tested with Nucleo F401RE and http://shop.ciseco.co.uk/srf-shield-wireless-transciever-for-all-arduino-type-boards/
Diff: LLAPSerial.cpp
- Revision:
- 6:0745fb4dbd8c
- Parent:
- 3:08f5e8989688
- Child:
- 7:51c8887d6822
--- a/LLAPSerial.cpp Wed Apr 16 19:41:30 2014 +0000 +++ b/LLAPSerial.cpp Wed Apr 16 20:28:18 2014 +0000 @@ -45,16 +45,20 @@ #include "mbed.h" #include "LLAPSerial.h" - -// Constructors to pass in Tx/Rx pins and optional ID, default is -- as defined in LLAPSerial.h -LLAPSerial::LLAPSerial(PinName txPin, PinName rxPin, bool checkDevIDin, char *dID) : srf(txPin, rxPin) +// Constructors to pass in Tx/Rx, enable pins and optional ID, default is -- as defined in LLAPSerial.h +LLAPSerial::LLAPSerial(PinName txPin, PinName rxPin, PinName enableSRF, bool checkDevIDin, char *dID) : srf(txPin, rxPin), srfEnable( enableSRF ) { srf.baud(115200); + bMsgReceived = false; setDeviceId(dID); cMessage[12]=0; // ensure terminated inPtr = cMessage; checkDevID = checkDevIDin; + + // Enable the SRF + srfEnable = 1; + // Attach the receive interrupt handler srf.attach( this,&LLAPSerial::SerialEvent ); }