Changeset 406874
- Timestamp:
- 01/11/12 16:16:31 (4 months ago)
- Branches:
- ('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
- Children:
- b0f092e98d602301ead905292420777c5da7640e
- Parents:
- d7cce515ff9fca11b5be98bf926bcc355c949294
- git-author:
- Stefan Persson <stefan.persson@telldus.se>2012-01-11 16:16:31+01:00
- git-committer:
- Stefan Persson <stefan.persson@telldus.se>2012-01-11 16:16:31+01:00
- Location:
- telldus-core/service
- Files:
-
- 2 edited
-
SettingsWinRegistry.cpp (modified) (1 diff)
-
TellStick_ftd2xx.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
telldus-core/service/SettingsWinRegistry.cpp
r86554b r406874 158 158 } 159 159 160 std::wstring Settings::getSetting(const std::wstring &strName) const{ 161 std::wstring strReturn; 162 HKEY hk; 163 164 std::wstring strCompleteRegPath = d->strRegPath; 165 long lnExists = RegOpenKeyEx(d->rootKey, strCompleteRegPath.c_str(), 0, KEY_QUERY_VALUE, &hk); 166 167 if(lnExists == ERROR_SUCCESS){ 168 wchar_t* Buff = new wchar_t[intMaxRegValueLength]; 169 DWORD dwLength = sizeof(wchar_t)*intMaxRegValueLength; 170 long lngStatus = RegQueryValueEx(hk, strName.c_str(), NULL, NULL, (LPBYTE)Buff, &dwLength); 171 172 if(lngStatus == ERROR_MORE_DATA){ 173 //The buffer is to small, recreate it 174 delete Buff; 175 Buff = new wchar_t[dwLength]; 176 lngStatus = RegQueryValueEx(hk, strName.c_str(), NULL, NULL, (LPBYTE)Buff, &dwLength); 177 } 178 if (lngStatus == ERROR_SUCCESS) { 179 strReturn = Buff; 180 } 181 delete Buff; 182 } 183 RegCloseKey(hk); 184 return strReturn; 185 } 186 160 187 std::wstring Settings::getStringSetting(int intDeviceId, const std::wstring &name, bool parameter) const { 161 188 std::wstring strReturn; -
telldus-core/service/TellStick_ftd2xx.cpp
r0c8de2 r406874 12 12 #include "TellStick.h" 13 13 #include "Mutex.h" 14 #include "Settings.h" 14 15 #include "Strings.h" 15 16 #include "Log.h" … … 22 23 class TellStick::PrivateData { 23 24 public: 24 bool open, running ;25 bool open, running, ignoreControllerConfirmation; 25 26 int vid, pid, fwVersion; 26 27 std::string serial, message; … … 55 56 d->fwVersion = 0; 56 57 d->serial = td.serial; 58 Settings set; 59 d->ignoreControllerConfirmation = set.getSetting(L"ignoreControllerConfirmation")==L"true"; 57 60 58 61 char *tempSerial = new char[td.serial.size()+1]; … … 227 230 ftStatus = FT_Write(d->ftHandle, tempMessage, (DWORD)strMessage.length(), &bytesWritten); 228 231 free(tempMessage); 229 if(strMessage == "noop"){ 232 233 if(d->ignoreControllerConfirmation || (strMessage == "N+" && ((pid() == 0x0C31 && firmwareVersion() < 5) || (pid() == 0x0C30 && firmwareVersion() < 6)))){ 234 //these firmware versions doesn't implement ack to noop, just check that the noop can be sent correctly 230 235 if(c){ 231 236 return TELLSTICK_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.
