Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX MODSERIAL mbed-rtos mbed
OilTemperature.cpp
00001 #include "OilTemperature.h" 00002 00003 const char OilTemperature::REQUEST_DATA[8] = {0x02, 0x21, 0x01, 0, 0, 0, 0, 0}; 00004 const char OilTemperature::SECOND_MESSAGE[8] = {0x30, 0, 0, 0, 0, 0, 0, 0}; 00005 00006 OilTemperature::OilTemperature() 00007 : PidValue("Oil Temp", "C") 00008 { 00009 } 00010 00011 bool OilTemperature::decode(const uint8_t* data, uint16_t length) 00012 { 00013 if (length < 2) 00014 { 00015 return false; 00016 } 00017 00018 if ((length != 31) || (data[0] != 0x61) || (data[1] != 0x01)) 00019 { 00020 return false; 00021 } 00022 00023 m_value = data[30] - 40; // deg C 00024 return true; 00025 }
Generated on Tue Jul 12 2022 21:25:01 by
1.7.2