Changeset d7cce5


Ignore:
Timestamp:
01/11/12 14:53:46 (4 months ago)
Author:
Stefan Persson <stefan.persson@…>
Branches:
('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
Children:
4068742b254f2b7a11aba2fee7294d136447aa9b
Parents:
8d22eff5da33b1ab94e7459832a33e1f1ab6587c
git-author:
Stefan Persson <stefan.persson@telldus.se>2012-01-11 14:53:46+01:00
git-committer:
Stefan Persson <stefan.persson@telldus.se>2012-01-11 14:53:46+01:00
Message:

Added setting for 'Not wait for confirmation from TellStick', see ticket 98, in Linux

Location:
telldus-core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • telldus-core/client/Client.cpp

    r86554b rd7cce5  
    297297                s.connect(L"TelldusClient"); 
    298298                if (!s.isConnected()) { //Connection failed 
     299                        printf("Connection failed\n\r"); 
    299300                        msleep(500); 
    300301                        continue; //retry 
     
    302303                s.write(msg.data()); 
    303304                if (!s.isConnected()) { //Connection failed sometime during operation... (better check here, instead of 5 seconds timeout later) 
     305                        printf("Connection failed after write\n\r"); 
    304306                        msleep(500); 
    305307                        continue; //retry 
    306308                } 
    307                 readData = s.read(5000); 
     309                readData = s.read(10000);  //TODO changed to 10000 from 5000, how much does this do...? 
    308310                if(readData == L""){ 
     311                        printf("Readdata nothing\n\r"); 
    309312                        msleep(500); 
    310313                        continue; //TODO can we be really sure it SHOULD be anything? 
     314                        //TODO perhaps break here instead? 
    311315                } 
    312316                 
    313317                if (!s.isConnected()) { //Connection failed sometime during operation... 
     318                        printf("Connection failed in the end\n\r"); 
    314319                        msleep(500); 
    315320                        continue; //retry 
  • telldus-core/service/ClientCommunicationHandler.cpp

    r36bfa0 rd7cce5  
    22#include "Message.h" 
    33#include "Strings.h" 
     4#include "Log.h" //Debug 
    45 
    56#include <stdlib.h> 
  • telldus-core/service/SettingsConfuse.cpp

    rc4ef48 rd7cce5  
    376376                CFG_STR(const_cast<char *>("group"), const_cast<char *>("plugdev"), CFGF_NONE), 
    377377                CFG_STR(const_cast<char *>("deviceNode"), const_cast<char *>("/dev/tellstick"), CFGF_NONE), 
     378                CFG_STR(const_cast<char *>("ignoreControllerConfirmation"), const_cast<char *>("false"), CFGF_NONE), 
    378379                CFG_SEC(const_cast<char *>("device"), device_opts, CFGF_MULTI), 
    379380                CFG_END() 
  • telldus-core/service/TellStick_libftdi.cpp

    r8d22ef rd7cce5  
    2020#include "Mutex.h" 
    2121#include "Log.h" 
     22#include "Settings.h" 
    2223#include "Strings.h" 
    2324#include "common.h" 
    24 #include "Log.h" 
    2525 
    2626#include <unistd.h> 
     
    3434class TellStick::PrivateData { 
    3535public: 
    36         bool open; 
     36        bool open, ignoreControllerConfirmation; 
    3737        int vid, pid, fwVersion; 
    3838        std::string serial, message; 
     
    5353        d->serial = td.serial; 
    5454        d->running = false; 
     55 
     56        Settings set; 
     57        d->ignoreControllerConfirmation = set.getSetting(L"ignoreControllerConfirmation")==L"true"; 
    5558 
    5659        ftdi_init(&d->ftHandle); 
     
    214217        delete[] tempMessage; 
    215218        Log::notice("Message: %s", strMessage.c_str()); 
    216         if(strMessage == "N+" && ((pid() == 0x0C31 && firmwareVersion() < 5) || (pid() == 0x0C30 && firmwareVersion() < 6))){ 
     219        if(d->ignoreControllerConfirmation || (strMessage == "N+" && ((pid() == 0x0C31 && firmwareVersion() < 5) || (pid() == 0x0C30 && firmwareVersion() < 6)))){ 
    217220                //these firmware versions doesn't implement ack to noop, just check that the noop can be sent correctly 
    218221                Log::notice("Too old firmware, accepting this"); 
    219222                if(c){ 
     223                        Log::notice("Success"); 
    220224                        return TELLSTICK_SUCCESS; 
    221225                } 
    222226                else{ 
     227                        Log::notice("Fail"); 
    223228                        return TELLSTICK_ERROR_COMMUNICATION; 
    224229                } 
     
    231236                ret = ftdi_read_data( &d->ftHandle, &in, 1); 
    232237                if (ret > 0) { 
     238                        Log::notice("Returned %c", in); 
    233239                        if (in == '\n') { 
     240                                Log::notice("BREAK"); 
    234241                                break; 
    235242                        } 
  • telldus-core/service/tellstick.conf

    rbea7b7 rd7cce5  
    11user = "nobody" 
    22group = "plugdev" 
     3ignoreControllerConfirmation = "false" 
    34device { 
    45  id = 1 
Note: See TracChangeset for help on using the changeset viewer.