forked from collin80/GEVCU6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCANIODevice.cpp
More file actions
94 lines (74 loc) · 1.42 KB
/
CANIODevice.cpp
File metadata and controls
94 lines (74 loc) · 1.42 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "CANIODevice.h"
CANIODevice::CANIODevice(void)
{
numDigitalOutputs = 0;
numAnalogOutputs = 0;
numDigitalInputs = 0;
numAnalogInputs = 0;
}
void CANIODevice::setup()
{
Device::setup();
}
void CANIODevice::tearDown()
{
//Device::tearDown();
}
DeviceType CANIODevice::getType()
{
return DEVICE_IO;
}
void CANIODevice::handleCanFrame(CAN_FRAME *frame)
{
}
void CANIODevice::handleMessage(uint32_t msg, void* data)
{
Device::handleMessage(msg, data);
}
int CANIODevice::getDigitalOutputCount()
{
return numDigitalOutputs;
}
int CANIODevice::getAnalogOutputCount()
{
return numAnalogOutputs;
}
int CANIODevice::getDigitalInputCount()
{
return numDigitalInputs;
}
int CANIODevice::getAnalogInputCount()
{
return numAnalogInputs;
}
//a bunch of do nothing implementations of these functions so derived classes that don't support certain
//I/O types and modes can just ignore them
void CANIODevice::setDigitalOutput(int which, bool hi)
{
//do nothing if this version gets called
}
bool CANIODevice::getDigitalOutput(int which)
{
return false;
}
void CANIODevice::setAnalogOutput(int which, int value)
{
}
int16_t CANIODevice::getAnalogOutput(int which)
{
return 0;
}
bool CANIODevice::getDigitalInput(int which)
{
return false;
}
int16_t CANIODevice::getAnalogInput(int which)
{
return 0;
}
void CANIODevice::setLatchingMode(int which, LatchModes::LATCHMODE mode)
{
}
void CANIODevice::unlockLatch(int which)
{
}