28 void showInfo(
const char* sensorName)
const override;
31template <
typename TStorage,
int TScale>
45 const auto scaler =
reinterpret_cast<const scaled_channel<TStorage, TScale>*
>(dataLocation);
48 float value = *scaler;
58template <
int Size,
int Offset>
64 this->
Scale = p_Scale;
74 iValue = frame.
data8[3] * 256 + frame.
data8[4];
76 iValue = frame.
data8[3];
79 float fValue = (1.0 * iValue /
Scale) - Offset;
87 msg[1] = OBD_CURRENT_DATA;
92 chThdSleepMilliseconds(300);
virtual CanListener * request()
void showInfo(const char *sensorName) const override
CanSensorBase(uint32_t eid, SensorType type, efidur_t timeout)
void decodeFrame(const CANRxFrame &frame, efitick_t nowNt) override
CanSensor(uint32_t eid, uint8_t offset, SensorType type, efidur_t timeout)
CanListener * request() override
ObdCanSensor(int p_PID, float p_Scale, SensorType type)
void decodeFrame(const CANRxFrame &frame, efitick_t nowNt) override
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
void setValidValue(float value, efitick_t timestamp)
Base class for a sensor that has its value asynchronously set, then later retrieved by a consumer.
uint8_t data8[8]
Frame data.