|
@@ -157,7 +157,7 @@ DWORD CSATDevices::WorkThread(LPVOID lpVoid)
|
|
#ifdef _DEBUG
|
|
#ifdef _DEBUG
|
|
printf("IsDevicesOffline\n");
|
|
printf("IsDevicesOffline\n");
|
|
#endif
|
|
#endif
|
|
- if ( GetTickCount64() - it->ulOfflineTime > GLOBAL::g_stSATConfig.dwAdbTimeout ) {
|
|
|
|
|
|
+ if ( (GetTickCount64() - it->ulOfflineTime) > GLOBAL::g_stSATConfig.dwAdbTimeout ) {
|
|
GLOBAL::WriteTextLog("移除设备->设备类型:%d, 设备名称:%s, 状态:%d", it->nType, it->strName.c_str(), it->nStatus);
|
|
GLOBAL::WriteTextLog("移除设备->设备类型:%d, 设备名称:%s, 状态:%d", it->nType, it->strName.c_str(), it->nStatus);
|
|
// 移除设备(需要线程加锁);
|
|
// 移除设备(需要线程加锁);
|
|
it = s_vtDevices.erase(it);
|
|
it = s_vtDevices.erase(it);
|
|
@@ -451,15 +451,12 @@ int CSATDevices::AttachDeviceName2Buffer(SATPROTO::Device (&pbuff)[SATPROTO::MAX
|
|
|
|
|
|
void CSATDevices::SaveDeviceStatus2Config(SATDEV::STDevice &stDevice)
|
|
void CSATDevices::SaveDeviceStatus2Config(SATDEV::STDevice &stDevice)
|
|
{
|
|
{
|
|
- if ( stDevice.nType == SATDEV::Usb ) {
|
|
|
|
- // 如果是usb设备重连成功,写入文件中;
|
|
|
|
- TCHAR szIniPath[MAX_PATH] = {0};
|
|
|
|
- _stprintf_s(szIniPath, _T("%s%s"), GLOBAL::g_szPython27Dir, "Lib\\site-packages\\ssat_sdk\\config\\resource_run.cfg");
|
|
|
|
- if ( stDevice.nStatus == SATDEV::Online )
|
|
|
|
- WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Online"), szIniPath);
|
|
|
|
- else if ( stDevice.nStatus == SATDEV::Offline )
|
|
|
|
- WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Offline"), szIniPath);
|
|
|
|
- else if ( stDevice.nStatus == SATDEV::Dropline )
|
|
|
|
- WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Dropline"), szIniPath);
|
|
|
|
- }
|
|
|
|
|
|
+ TCHAR szIniPath[MAX_PATH] = {0};
|
|
|
|
+ _stprintf_s(szIniPath, _T("%s%s"), GLOBAL::g_szPython27Dir, "Lib\\site-packages\\ssat_sdk\\config\\resource_run.cfg");
|
|
|
|
+ if ( stDevice.nStatus == SATDEV::Online )
|
|
|
|
+ WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Online"), szIniPath);
|
|
|
|
+ else if ( stDevice.nStatus == SATDEV::Offline )
|
|
|
|
+ WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Offline"), szIniPath);
|
|
|
|
+ else if ( stDevice.nStatus == SATDEV::Dropline )
|
|
|
|
+ WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Dropline"), szIniPath);
|
|
}
|
|
}
|