-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSensorData.h
More file actions
43 lines (35 loc) · 928 Bytes
/
SensorData.h
File metadata and controls
43 lines (35 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef SENSORDATA_H
#define SENSORDATA_H
#include <iostream>
#include <Arduino.h>
#include <FlexCAN_T4.h>
class SensorData {
protected:
// Instantiate attributes
int id;
int* data;
unsigned long timeStamp;
int dataLength;
public:
// Default Constructor
SensorData();
// Constructor
SensorData(int id, int* data, int dataLength, unsigned long timeStamp);
// Constructor from CAN_message_t
SensorData(CAN_message_t canMessage);
// Destructor
~SensorData();
int getTimeStamp() const;
int getId() const;
int getPriority() const;
int* getData() const;
int length() const;
void setId(int id);
void setData(int* data);
// For changing timestamp
void setTimeStamp(unsigned long timeStamp);
// Converts SensorData object to a CAN_message_t object
CAN_message_t formatCAN() const;
void toString() const;
};
#endif // SENSORDATA_H