#include "StdAfx.h" #include "WheelOemDevice.h" #define CRTDBG_MAP_ALLOC #include #include //------------------OEM device---------------------------- Wheel_OemDevice::Wheel_OemDevice(void) { } Wheel_OemDevice::~Wheel_OemDevice(void) { } //Data Access int Wheel_OemDevice::GetStatus(bool &status) { //two way to get status //interrupt way,just get data return WheelUnitLogic::GetStatus(status); //循环读取的方法,get it from device,and update data } int Wheel_OemDevice::SetStatus(bool status) { return WheelUnitLogic::SetStatus(status); } //Actions int Wheel_OemDevice::StartRoll() { int m_Round = 1; TPRINTA_TRACE("Trace:Round %d Start-----------------------------", m_Round++); TPRINTA_DEBUG("Debug:Round %d Start-----------------------------", m_Round++); TPRINTA_INFO("Info:Round %d Start-----------------------------", m_Round++); TPRINTA_WARN("Warning:Round %d Start-----------------------------", m_Round++); TPRINTA_ERROR("Error:Round %d Start-----------------------------", m_Round++); TPRINTA_FATAL("Fatal:Round %d Start-----------------------------", m_Round++); //make warning&errors return SetStatus(true); } int Wheel_OemDevice::StopRoll() { //make warning&errors return SetStatus(false); } //we need check each action resource is Support or not //return yes or no inside of OEM module bool Wheel_OemDevice::Support_GetStatus() { return false; } bool Wheel_OemDevice::Support_SetStatus() { return false; } bool Wheel_OemDevice::Support_StartRoll() { return true; } bool Wheel_OemDevice::Support_StopRoll() { return true; } int DEVICE_ACTION Wheel_OemDevice::ChangeStatus(bool PARAM_IN st) { RET_STATUS ret = RET_SUCCEED; bool status; GetStatus(status); if (st) { ret = (RET_STATUS)SetStatus(!status); } return ret; } bool DEVICE_SUPPORT Wheel_OemDevice::Support_ChangeStatus() { return true; }