35 lines
846 B
C++
35 lines
846 B
C++
/*
|
|||
|
|
* ThermalActionCPTraceBack.cpp
|
||
|
|
*
|
||
|
|
* Copyright (C) 2016 Spreadtrum Communications Inc.
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include "ThermalActionCPTraceBack.h"
|
||
|
|
#include "alog.h"
|
||
|
|
|
||
|
|
#undef LOG_TAG
|
||
|
|
#define LOG_TAG "ThermalActionCPTraceBack"
|
||
|
|
|
||
|
|
namespace android {
|
||
|
|
ThermalActionCPTraceBack::ThermalActionCPTraceBack() {}
|
||
|
|
|
||
|
|
void ThermalActionCPTraceBack::setEnable(bool en) {
|
||
|
|
enable = en;
|
||
|
|
ALOGI("%s setEnable: %d!", this->getName(), en);
|
||
|
|
}
|
||
|
|
void ThermalActionCPTraceBack::doAction() {
|
||
|
|
char atRes[24] = {0};
|
||
|
|
int phoneId = 0;
|
||
|
|
if (enable) {
|
||
|
|
const char* mAtCmd = mArg.c_str();
|
||
|
|
ALOGI("do,===>%s, mArg:%s, mFileNode:%s", mDevice.c_str(), mArg.c_str(),
|
||
|
|
mFileNode.c_str());
|
||
|
|
sendAt(phoneId, mAtCmd, atRes, sizeof(atRes)-1);
|
||
|
|
ALOGI("AT command return value:%s", atRes);
|
||
|
|
} else {
|
||
|
|
ALOGI("PA_sensor has been turn off");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}; // namespace android
|