Changed the way the filter system works in the CAN connection objects - now used only for sending frames immediately to relevant objects. Tested to work in firmware updater. Currently broken elsewhere. Also switched main frame update interval from 4 times per second to 8 to make things smoother.

This commit is contained in:
Collin Kidder
2016-12-29 19:13:51 -05:00
parent 96523cc082
commit beea680106
11 changed files with 172 additions and 87 deletions
+19 -1
View File
@@ -36,12 +36,30 @@ public:
//just the multi-frame version of above function.
bool sendFrames(const QList<CANFrame>& pFrames);
/**
* @brief Add a new filter for the targetted frames. If a frame matches it will immediately be sent via the targettedFrameReceived signal
* @param pBusId - Which bus to bond to. -1 for any, otherwise a bitfield of buses (but 0 = first bus, etc)
* @param target - The filter to use for selected targetted frames
* @return true if filter was able to be added, false otherwise.
*/
bool addTargettedFrame(int pBusId, const CANFlt &target);
/**
* @brief Try to find a matching filter in the list and remove it, no longer targetting those frames
* @param pBusId - Which bus to bond to. Doesn't have to match the call to addTargettedFrame exactly. You could disconnect just one bus for instance.
* @param target - The filter that was set
* @return true if filter was found and deleted, false otherwise.
*/
bool removeTargettedFrame(int pBusId, const CANFlt &target);
signals:
void framesReceived(CANConnection* pConn_p, QVector<CANFrame>& pFrames);
void targettedFrameReceived(CANFrame frame);
void connectionStatusUpdated(int conns);
private slots:
void refreshCanList();
void refreshCanList();
void gotTargettedFrame(CANFrame frame);
private:
explicit CANConManager(QObject *parent = 0);