Changeset 3ce58f


Ignore:
Timestamp:
01/12/12 14:21:03 (4 months ago)
Author:
Stefan Persson <stefan.persson@…>
Branches:
('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
Children:
e2e9ba4634204ee09c0868b9088fd15e82ee2139
Parents:
c527223bc420b18a6de5b3037befd935a288597f
git-author:
Stefan Persson <stefan.persson@telldus.se>2012-01-12 14:21:03+01:00
git-committer:
Stefan Persson <stefan.persson@telldus.se>2012-01-12 14:21:03+01:00
Message:

Added sleep time to allow TellStick to finish air sending when ignoring answer from TellStick

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telldus-core/service/TellStick_libftdi.cpp

    rb84e8b r3ce58f  
    226226        } 
    227227 
    228         if(d->ignoreControllerConfirmation || (strMessage == "N+" && ((pid() == 0x0C31 && firmwareVersion() < 5) || (pid() == 0x0C30 && firmwareVersion() < 6)))){ 
     228        if(strMessage.compare("N+") == 0 && ((pid() == 0x0C31 && firmwareVersion() < 5) || (pid() == 0x0C30 && firmwareVersion() < 6))){ 
    229229                //these firmware versions doesn't implement ack to noop, just check that the noop can be sent correctly 
    230                 Log::notice("Too old firmware, accepting this, just return success"); 
     230                Log::warning("Too old firmware, accepting this, just return success"); 
    231231                return TELLSTICK_SUCCESS; 
    232232        } 
     233 
     234        if(d->ignoreControllerConfirmation){ 
     235                //allow TellStick to finish its air-sending 
     236                Log::warning("Sleeping"); 
     237                msleep(1000); 
     238                return TELLSTICK_SUCCESS; 
     239        } 
     240 
    233241        Log::warning("Continuing"); 
    234242 
     
    241249                        if (in == '\n') { 
    242250                                Log::warning("Received an end"); 
    243                                 break; 
     251                                return TELLSTICK_SUCCESS; 
    244252                        } 
    245253                } else if(ret == 0) { // No data available 
     
    250258                } 
    251259        } 
    252         Log::warning("Retry ready"); 
    253         if (!retrycnt) { 
    254                 Log::warning("Error in communication, retrycount ended"); 
    255                 return TELLSTICK_ERROR_COMMUNICATION; 
    256         } 
    257         Log::warning("Success"); 
    258         return TELLSTICK_SUCCESS; 
     260 
     261        Log::warning("Error in communication, retrycount ended"); 
     262        return TELLSTICK_ERROR_COMMUNICATION; 
    259263} 
    260264 
Note: See TracChangeset for help on using the changeset viewer.