Processing data in byte form
This commit is contained in:
@@ -5,13 +5,15 @@
|
||||
#include <mcp_can.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
class CommObd2Can : public CommInterface {
|
||||
|
||||
protected:
|
||||
const uint8_t pinCanInt = 15;
|
||||
const uint8_t pinCanCs = 12;
|
||||
std::unique_ptr <MCP_CAN> CAN;
|
||||
std::unique_ptr <MCP_CAN> CAN;
|
||||
long unsigned int rxId;
|
||||
unsigned char rxLen = 0;
|
||||
uint8_t rxBuf[32];
|
||||
@@ -20,6 +22,11 @@ class CommObd2Can : public CommInterface {
|
||||
char msgString[128]; // Array to store serial string
|
||||
uint16_t lastPid;
|
||||
unsigned long lastDataSent = 0;
|
||||
|
||||
std::vector<uint8_t> mergedData;
|
||||
typedef std::vector<uint8_t> frameData_t;
|
||||
std::unordered_map<uint16_t, frameData_t> dataRows;
|
||||
|
||||
public:
|
||||
void connectDevice() override;
|
||||
void disconnectDevice() override;
|
||||
@@ -30,6 +37,7 @@ class CommObd2Can : public CommInterface {
|
||||
void sendPID(const uint16_t pid, const String& cmd);
|
||||
void sendFlowControlFrame();
|
||||
uint8_t receivePID();
|
||||
bool processFrameBytes();
|
||||
bool processFrame();
|
||||
void processMergedResponse();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user