More work on supporting swcan - it's there now! Untested as of yet.

This commit is contained in:
Collin Kidder
2017-10-22 20:42:02 -04:00
parent ac976643f4
commit 0519e2d2c9
3 changed files with 72 additions and 22 deletions
+5 -1
View File
@@ -31,6 +31,7 @@ void SocketCan::piStarted()
mTimer.setInterval(1000);
mTimer.setSingleShot(false); //keep ticking
mTimer.start();
mBusData[0].mBus.setEnabled(true);
}
@@ -59,6 +60,7 @@ bool SocketCan::piGetBusSettings(int pBusIdx, CANBus& pBus)
void SocketCan::piSetBusSettings(int pBusIdx, CANBus bus)
{
CANConStatus stats;
/* sanity checks */
if(0 != pBusIdx)
return;
@@ -109,7 +111,6 @@ bool SocketCan::piSendFrame(const CANFrame& pFrame)
/* sanity checks */
if(0 != pFrame.bus || pFrame.len>8)
return false;
if (!mDev_p) return false;
/* fill frame */
@@ -232,7 +233,10 @@ void SocketCan::testConnection() {
/* try to reconnect */
CANBus bus;
if(getBusConfig(0, bus))
{
bus.setEnabled(true);
setBusSettings(0, bus);
}
}
/* disconnect test instance */
dev_p->disconnectDevice();