Files

35 lines
846 B
C++
Raw Permalink Normal View History

2026-09-22 09:38:26 +08:00
/*
* 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