Skip to content

Commit 2a18f53

Browse files
authored
Merge pull request #738 from Evsdd/master
Fixed: AtagOne deviceId error due to webpage change
2 parents b29b372 + f30647e commit 2a18f53

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hardware/AtagOne.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,18 @@ bool CAtagOne::StopHardware()
117117
std::string GetFirstDeviceID(const std::string &shtml)
118118
{
119119
std::string sResult = shtml;
120-
// <tr onclick="javascript:changeDeviceAndRedirect('/Home/Index/{0}','6808-1401-3109_15-30-001-544');">
121-
size_t tpos = sResult.find("javascript:changeDeviceAndRedirect(");
120+
// Evsdd - Updated string due to webpage change
121+
// Original format: <tr onclick="javascript:changeDeviceAndRedirect('/Home/Index/{0}','6808-1401-3109_15-30-001-544');">
122+
// New format: "/Home/Index/6808-1401-3109_15-30-001-544"
123+
size_t tpos = sResult.find("/Home/Index");
122124
if (tpos == std::string::npos)
123125
return "";
124126
sResult = sResult.substr(tpos);
125-
tpos = sResult.find(",'");
127+
tpos = sResult.find("x/");
126128
if (tpos == std::string::npos)
127129
return "";
128130
sResult = sResult.substr(tpos + 2);
129-
tpos = sResult.find("');");
131+
tpos = sResult.find("\"");
130132
if (tpos == std::string::npos)
131133
return "";
132134
sResult = sResult.substr(0, tpos);

0 commit comments

Comments
 (0)