From fbbb117a055bb48d9b2877cf98cfd9b449c22c0a Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Wed, 19 Aug 2009 15:51:33 +0000 Subject: [PATCH] Added parameter int supportedMethods in tdLastSentCommand(), closes #36 --- driver/libtelldus-core/Device.cpp | 12 ++++ driver/libtelldus-core/Device.h | 9 +-- driver/libtelldus-core/DeviceBrateck.cpp | 2 +- driver/libtelldus-core/DeviceBrateck.h | 2 +- driver/libtelldus-core/DeviceGroup.cpp | 12 ++-- driver/libtelldus-core/DeviceGroup.h | 2 +- driver/libtelldus-core/DeviceIkea.cpp | 2 +- driver/libtelldus-core/DeviceIkea.h | 2 +- driver/libtelldus-core/DeviceNexa.cpp | 12 ++-- driver/libtelldus-core/DeviceNexa.h | 2 +- driver/libtelldus-core/DeviceRisingSun.cpp | 2 +- driver/libtelldus-core/DeviceRisingSun.h | 2 +- driver/libtelldus-core/DeviceSartano.cpp | 2 +- driver/libtelldus-core/DeviceSartano.h | 2 +- driver/libtelldus-core/DeviceUndefined.cpp | 2 +- driver/libtelldus-core/DeviceUndefined.h | 2 +- driver/libtelldus-core/DeviceUpm.cpp | 2 +- driver/libtelldus-core/DeviceUpm.h | 2 +- driver/libtelldus-core/DeviceWaveman.cpp | 2 +- driver/libtelldus-core/DeviceWaveman.h | 2 +- driver/libtelldus-core/DeviceX10.cpp | 2 +- driver/libtelldus-core/DeviceX10.h | 2 +- driver/libtelldus-core/Manager.cpp | 2 +- driver/libtelldus-core/telldus-core.cpp | 80 +++++++--------------- driver/libtelldus-core/telldus-core.h | 2 +- 25 files changed, 71 insertions(+), 94 deletions(-) diff --git a/driver/libtelldus-core/Device.cpp b/driver/libtelldus-core/Device.cpp index d51a4dad..f1bd7526 100644 --- a/driver/libtelldus-core/Device.cpp +++ b/driver/libtelldus-core/Device.cpp @@ -22,6 +22,9 @@ Device::~Device(void) { int Device::switchState( int newState, const std::string &value ) { int retVal = TELLSTICK_ERROR_METHOD_NOT_SUPPORTED; + if (!Device::maskUnsupportedMethods(this->methods(), newState)) { + return retVal; + } std::string stateValue = ""; switch (newState) { @@ -128,3 +131,12 @@ bool Device::setName(const std::string & newName) { } return false; } + +int TelldusCore::Device::maskUnsupportedMethods(int methods, int supportedMethods) { + // Bell -> On + if ((methods & TELLSTICK_BELL) && !(supportedMethods & TELLSTICK_BELL)) { + methods |= TELLSTICK_TURNON; + } + //Cut of the rest of the unsupported methods we donät have a fallback for + return methods & supportedMethods; +} diff --git a/driver/libtelldus-core/Device.h b/driver/libtelldus-core/Device.h index d3051744..eab29dd8 100644 --- a/driver/libtelldus-core/Device.h +++ b/driver/libtelldus-core/Device.h @@ -6,12 +6,6 @@ namespace TelldusCore { - const int ALL_METHODS = - TELLSTICK_TURNON | - TELLSTICK_TURNOFF | - TELLSTICK_BELL | - TELLSTICK_DIM; - class Device { public: @@ -19,7 +13,7 @@ namespace TelldusCore { virtual ~Device(void); int switchState( int newState, const std::string &value = "" ); - virtual int methods(int methodsSupported) = 0; + virtual int methods() = 0; virtual std::string getProtocol() const = 0; virtual bool parameterMatches( const std::string &name, const std::string &value ) const = 0; bool setParameter(const std::string &strName, const std::string &strValue); @@ -30,6 +24,7 @@ namespace TelldusCore { bool setName( const std::string &newName ); static int methodId( const std::string &methodName ); + static int maskUnsupportedMethods( int methods, int supportedMethods ); #ifdef _LINUX void setDevice(const std::string &device); diff --git a/driver/libtelldus-core/DeviceBrateck.cpp b/driver/libtelldus-core/DeviceBrateck.cpp index 9e64fda3..b8afebc8 100644 --- a/driver/libtelldus-core/DeviceBrateck.cpp +++ b/driver/libtelldus-core/DeviceBrateck.cpp @@ -87,7 +87,7 @@ bool DeviceBrateck::parameterMatches( const std::string &name, const std::string /* * Has the device got the method? */ -int DeviceBrateck::methods(int){ +int DeviceBrateck::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceBrateck.h b/driver/libtelldus-core/DeviceBrateck.h index 7672ee92..2a8f7954 100644 --- a/driver/libtelldus-core/DeviceBrateck.h +++ b/driver/libtelldus-core/DeviceBrateck.h @@ -10,7 +10,7 @@ namespace TelldusCore { DeviceBrateck(int id, const std::string &model, const std::string &name); virtual ~DeviceBrateck(void); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceGroup.cpp b/driver/libtelldus-core/DeviceGroup.cpp index 30d7d448..1831bec8 100644 --- a/driver/libtelldus-core/DeviceGroup.cpp +++ b/driver/libtelldus-core/DeviceGroup.cpp @@ -57,7 +57,7 @@ int DeviceGroup::turnOn(void) { int retVal = TELLSTICK_ERROR_UNKNOWN; for (DeviceList::const_iterator it = deviceList.begin(); it != deviceList.end(); ++it) { - int methods = (*it)->methods(ALL_METHODS); + int methods = (*it)->methods(); if (methods & TELLSTICK_TURNON) { int success = (*it)->switchState( TELLSTICK_TURNON ); if (retVal != TELLSTICK_SUCCESS) { @@ -75,7 +75,7 @@ int DeviceGroup::turnOff(void) { int retVal = TELLSTICK_ERROR_UNKNOWN; for (DeviceList::const_iterator it = deviceList.begin(); it != deviceList.end(); ++it) { - int methods = (*it)->methods(ALL_METHODS); + int methods = (*it)->methods(); if (methods & TELLSTICK_TURNOFF) { int success = (*it)->switchState( TELLSTICK_TURNOFF ); if (retVal != TELLSTICK_SUCCESS) { @@ -93,7 +93,7 @@ int DeviceGroup::bell(void){ int retVal = TELLSTICK_ERROR_UNKNOWN; for (DeviceList::const_iterator it = deviceList.begin(); it != deviceList.end(); ++it) { - int methods = (*it)->methods(ALL_METHODS); + int methods = (*it)->methods(); if (methods & TELLSTICK_BELL) { int success = (*it)->switchState( TELLSTICK_BELL ); if (retVal != TELLSTICK_SUCCESS) { @@ -111,7 +111,7 @@ int DeviceGroup::dim(unsigned char level){ int retVal = TELLSTICK_ERROR_UNKNOWN; for (DeviceList::const_iterator it = deviceList.begin(); it != deviceList.end(); ++it) { - int methods = (*it)->methods(ALL_METHODS); + int methods = (*it)->methods(); if (methods & TELLSTICK_DIM) { int success = (*it)->switchState( TELLSTICK_DIM, (char*)&level); if (retVal != TELLSTICK_SUCCESS) { @@ -129,11 +129,11 @@ bool DeviceGroup::parameterMatches( const std::string &name, const std::string & /* * Has the device got the method? */ -int DeviceGroup::methods(int supportedMethods){ +int DeviceGroup::methods(){ int retVal = 0; for (DeviceList::const_iterator it = deviceList.begin(); it != deviceList.end(); ++it) { - retVal = retVal | (*it)->methods(supportedMethods); + retVal = retVal | (*it)->methods(); } return retVal; diff --git a/driver/libtelldus-core/DeviceGroup.h b/driver/libtelldus-core/DeviceGroup.h index c2d4131c..b3b1583e 100644 --- a/driver/libtelldus-core/DeviceGroup.h +++ b/driver/libtelldus-core/DeviceGroup.h @@ -15,7 +15,7 @@ namespace TelldusCore { DeviceGroup(int id, const std::string &model, const std::string &name); ~DeviceGroup(void); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceIkea.cpp b/driver/libtelldus-core/DeviceIkea.cpp index c009559d..237b9691 100644 --- a/driver/libtelldus-core/DeviceIkea.cpp +++ b/driver/libtelldus-core/DeviceIkea.cpp @@ -224,7 +224,7 @@ bool DeviceIkea::parameterMatches( const std::string &name, const std::string &v /* * Has the device got the method? */ -int DeviceIkea::methods(int){ +int DeviceIkea::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_DIM); } diff --git a/driver/libtelldus-core/DeviceIkea.h b/driver/libtelldus-core/DeviceIkea.h index 542e4784..695677de 100644 --- a/driver/libtelldus-core/DeviceIkea.h +++ b/driver/libtelldus-core/DeviceIkea.h @@ -10,7 +10,7 @@ namespace TelldusCore { DeviceIkea(int id, const std::string &model, const std::string &name); virtual ~DeviceIkea(void); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceNexa.cpp b/driver/libtelldus-core/DeviceNexa.cpp index 06fb81e2..f1352800 100644 --- a/driver/libtelldus-core/DeviceNexa.cpp +++ b/driver/libtelldus-core/DeviceNexa.cpp @@ -63,7 +63,9 @@ bool DeviceNexa::setDeviceParameter(const std::string &strName, const std::strin * Turn on this device */ int DeviceNexa::turnOn(void){ - + if (strcasecmp(this->getModel().c_str(), "bell") == 0) { + return bell(); + } try{ std::string strCode = ""; if (isDimmer()) { @@ -243,7 +245,7 @@ bool DeviceNexa::parameterMatches( const std::string &name, const std::string &v /* * Has the device got the method? */ -int DeviceNexa::methods(int methodsSupported){ +int DeviceNexa::methods(){ std::string strModel = this->getModel(); if ( strcasecmp(strModel.c_str(), "codeswitch") == 0 @@ -254,11 +256,7 @@ int DeviceNexa::methods(int methodsSupported){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_DIM); } else if (strcasecmp(strModel.c_str(), "bell") == 0) { - if (methodsSupported & TELLSTICK_BELL) { - return TELLSTICK_BELL; - } else if (methodsSupported & TELLSTICK_TURNON) { - return TELLSTICK_TURNON; - } + return TELLSTICK_BELL; } return 0; } diff --git a/driver/libtelldus-core/DeviceNexa.h b/driver/libtelldus-core/DeviceNexa.h index 9f596e1a..fd488d66 100644 --- a/driver/libtelldus-core/DeviceNexa.h +++ b/driver/libtelldus-core/DeviceNexa.h @@ -8,7 +8,7 @@ namespace TelldusCore { { public: DeviceNexa(int id, const std::string &model, const std::string &name); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceRisingSun.cpp b/driver/libtelldus-core/DeviceRisingSun.cpp index 2dbfbedd..8af2bd92 100644 --- a/driver/libtelldus-core/DeviceRisingSun.cpp +++ b/driver/libtelldus-core/DeviceRisingSun.cpp @@ -127,7 +127,7 @@ bool DeviceRisingSun::parameterMatches( const std::string &name, const std::stri /* * Has the device got the method? */ -int DeviceRisingSun::methods(int methodsSupported){ +int DeviceRisingSun::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceRisingSun.h b/driver/libtelldus-core/DeviceRisingSun.h index 33be8ddc..4f65fddb 100644 --- a/driver/libtelldus-core/DeviceRisingSun.h +++ b/driver/libtelldus-core/DeviceRisingSun.h @@ -8,7 +8,7 @@ namespace TelldusCore { { public: DeviceRisingSun(int id, const std::string &model, const std::string &name); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceSartano.cpp b/driver/libtelldus-core/DeviceSartano.cpp index f12f92da..f0f7c4d5 100644 --- a/driver/libtelldus-core/DeviceSartano.cpp +++ b/driver/libtelldus-core/DeviceSartano.cpp @@ -77,7 +77,7 @@ bool DeviceSartano::parameterMatches( const std::string &name, const std::string /* * Has the device got the method? */ -int DeviceSartano::methods(int){ +int DeviceSartano::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceSartano.h b/driver/libtelldus-core/DeviceSartano.h index 5ea69aeb..a849fb33 100644 --- a/driver/libtelldus-core/DeviceSartano.h +++ b/driver/libtelldus-core/DeviceSartano.h @@ -10,7 +10,7 @@ namespace TelldusCore { DeviceSartano(int id, const std::string &model, const std::string &name); virtual ~DeviceSartano(void); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceUndefined.cpp b/driver/libtelldus-core/DeviceUndefined.cpp index b33dd0ff..3e96b4bf 100644 --- a/driver/libtelldus-core/DeviceUndefined.cpp +++ b/driver/libtelldus-core/DeviceUndefined.cpp @@ -27,7 +27,7 @@ bool DeviceUndefined::parameterMatches( const std::string &name, const std::stri /* * Has the device got the method? */ -int DeviceUndefined::methods(int methodsSupported){ +int DeviceUndefined::methods(){ return 0; } diff --git a/driver/libtelldus-core/DeviceUndefined.h b/driver/libtelldus-core/DeviceUndefined.h index 257a5a9c..766b9021 100644 --- a/driver/libtelldus-core/DeviceUndefined.h +++ b/driver/libtelldus-core/DeviceUndefined.h @@ -8,7 +8,7 @@ namespace TelldusCore { { public: DeviceUndefined(int id, const std::string &model, const std::string &name); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceUpm.cpp b/driver/libtelldus-core/DeviceUpm.cpp index cd251eb5..3b27a3cf 100644 --- a/driver/libtelldus-core/DeviceUpm.cpp +++ b/driver/libtelldus-core/DeviceUpm.cpp @@ -102,7 +102,7 @@ bool DeviceUpm::parameterMatches( const std::string &name, const std::string &va /* * Has the device got the method? */ -int DeviceUpm::methods(int){ +int DeviceUpm::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceUpm.h b/driver/libtelldus-core/DeviceUpm.h index e39c4201..d8569a63 100644 --- a/driver/libtelldus-core/DeviceUpm.h +++ b/driver/libtelldus-core/DeviceUpm.h @@ -10,7 +10,7 @@ namespace TelldusCore { DeviceUpm(int id, const std::string &model, const std::string &name); virtual ~DeviceUpm(void); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/DeviceWaveman.cpp b/driver/libtelldus-core/DeviceWaveman.cpp index 8848f28f..9ba273fc 100644 --- a/driver/libtelldus-core/DeviceWaveman.cpp +++ b/driver/libtelldus-core/DeviceWaveman.cpp @@ -39,6 +39,6 @@ int DeviceWaveman::turnOff(void){ /* * Has the device got the method? */ -int DeviceWaveman::methods(int){ +int DeviceWaveman::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceWaveman.h b/driver/libtelldus-core/DeviceWaveman.h index 8b0aebad..fda216b1 100644 --- a/driver/libtelldus-core/DeviceWaveman.h +++ b/driver/libtelldus-core/DeviceWaveman.h @@ -8,7 +8,7 @@ namespace TelldusCore { { public: DeviceWaveman(int id, const std::string &model, const std::string &name); - virtual int methods(int methodsSupported); + virtual int methods(); protected: virtual int turnOff(void); diff --git a/driver/libtelldus-core/DeviceX10.cpp b/driver/libtelldus-core/DeviceX10.cpp index a0f6ed05..b9ce37df 100644 --- a/driver/libtelldus-core/DeviceX10.cpp +++ b/driver/libtelldus-core/DeviceX10.cpp @@ -193,7 +193,7 @@ bool DeviceX10::parameterMatches( const std::string &name, const std::string &va /* * Has the device got the method? */ -int DeviceX10::methods(int methodsSupported){ +int DeviceX10::methods(){ return (TELLSTICK_TURNON | TELLSTICK_TURNOFF); } diff --git a/driver/libtelldus-core/DeviceX10.h b/driver/libtelldus-core/DeviceX10.h index 3d861ad3..23f111a1 100644 --- a/driver/libtelldus-core/DeviceX10.h +++ b/driver/libtelldus-core/DeviceX10.h @@ -8,7 +8,7 @@ namespace TelldusCore { { public: DeviceX10(int id, const std::string &model, const std::string &name); - virtual int methods(int methodsSupported); + virtual int methods(); virtual std::string getProtocol() const; virtual bool parameterMatches( const std::string &name, const std::string &value ) const; diff --git a/driver/libtelldus-core/Manager.cpp b/driver/libtelldus-core/Manager.cpp index 75ca6b6e..48df7a9c 100644 --- a/driver/libtelldus-core/Manager.cpp +++ b/driver/libtelldus-core/Manager.cpp @@ -237,7 +237,7 @@ void Manager::parseMessage( const std::string &message ) { if (it->second->getProtocol().compare(protocol) != 0) { continue; } - if (! (it->second->methods(ALL_METHODS) & method)) { + if (! (it->second->methods() & method)) { continue; } bool found = true; diff --git a/driver/libtelldus-core/telldus-core.cpp b/driver/libtelldus-core/telldus-core.cpp index f151f7b1..c18c214e 100644 --- a/driver/libtelldus-core/telldus-core.cpp +++ b/driver/libtelldus-core/telldus-core.cpp @@ -106,17 +106,7 @@ int WINAPI tdTurnOn(int intDeviceId){ Manager *manager = Manager::getInstance(); Device* dev = manager->getDevice(intDeviceId); if(dev != NULL){ - int methods = dev->methods( TELLSTICK_TURNON ); - - int retval = 0; - - if ( !(methods & TELLSTICK_TURNON) ) { - retval = TELLSTICK_ERROR_METHOD_NOT_SUPPORTED; - } else { - retval = dev->switchState(TELLSTICK_TURNON); - } - - return retval; + return dev->switchState(TELLSTICK_TURNON); } else{ return TELLSTICK_ERROR_DEVICE_NOT_FOUND; } @@ -139,18 +129,8 @@ int WINAPI tdTurnOff(int intDeviceId){ Manager *manager = Manager::getInstance(); Device* dev = manager->getDevice(intDeviceId); if(dev != NULL){ - int methods = dev->methods( TELLSTICK_TURNOFF ); - int retval = 0; - - if ( !(methods & TELLSTICK_TURNOFF) ) { - retval = TELLSTICK_ERROR_METHOD_NOT_SUPPORTED; - } else { - retval = dev->switchState(TELLSTICK_TURNOFF); - } - - return retval; - } - else{ + return dev->switchState(TELLSTICK_TURNOFF); + } else { return TELLSTICK_ERROR_DEVICE_NOT_FOUND; } } @@ -171,19 +151,9 @@ int WINAPI tdBell(int intDeviceId){ try{ Manager *manager = Manager::getInstance(); Device* dev = manager->getDevice(intDeviceId); - if(dev != NULL){ - int methods = dev->methods( TELLSTICK_BELL ); - int retval = 0; - - if ( !(methods & TELLSTICK_BELL) ) { - retval = TELLSTICK_ERROR_METHOD_NOT_SUPPORTED; - } else { - retval = dev->switchState( TELLSTICK_BELL ); - } - - return retval; - } - else{ + if (dev != NULL){ + return dev->switchState( TELLSTICK_BELL ); + } else { return TELLSTICK_ERROR_DEVICE_NOT_FOUND; } } @@ -205,24 +175,17 @@ int WINAPI tdDim(int intDeviceId, unsigned char level){ Manager *manager = Manager::getInstance(); Device* dev = manager->getDevice(intDeviceId); if(dev != NULL){ - int methods = dev->methods( TELLSTICK_DIM ); int retval = 0; - if ( !(methods & TELLSTICK_DIM) ) { - retval = TELLSTICK_ERROR_METHOD_NOT_SUPPORTED; + if (level == 0) { + retval = dev->switchState( TELLSTICK_TURNOFF ); + } else if (level == 255) { + retval = dev->switchState( TELLSTICK_TURNON ); } else { - if (level == 0) { - retval = dev->switchState( TELLSTICK_TURNOFF ); - } else if (level == 255) { - retval = dev->switchState( TELLSTICK_TURNON ); - } else { - retval = dev->switchState( TELLSTICK_DIM, (char *)&level); - } + retval = dev->switchState( TELLSTICK_DIM, (char *)&level); } - return retval; - } - else{ + } else { return TELLSTICK_ERROR_DEVICE_NOT_FOUND; } } @@ -235,12 +198,21 @@ int WINAPI tdDim(int intDeviceId, unsigned char level){ /** * Returns the last sent command to a specific device * @param intDeviceId The device id to query + * @param methodsSupported The methods supported by the client. See tdMethods() for more information. * @returns the last sent command as integer, example TELLSTICK_TURNON or TELLSTICK_TURNOFF */ -int WINAPI tdLastSentCommand( int intDeviceId ) { +int WINAPI tdLastSentCommand( int intDeviceId, int methodsSupported ) { Manager *manager = Manager::getInstance(); - int lastSentCommand = manager->getDeviceState( intDeviceId ); - return (lastSentCommand > 0 ? lastSentCommand : TELLSTICK_TURNOFF ); + int lastSentCommand = Device::maskUnsupportedMethods(manager->getDeviceState( intDeviceId ), methodsSupported); + + if (lastSentCommand == TELLSTICK_BELL) { + //Bell is not a state + lastSentCommand = TELLSTICK_TURNOFF; + } + if (lastSentCommand == 0) { + lastSentCommand = TELLSTICK_TURNOFF; + } + return lastSentCommand; } /** @@ -496,14 +468,14 @@ int WINAPI tdMethods(int id, int methodsSupported){ Manager *manager = Manager::getInstance(); Device* dev = manager->getDevice(id); if (dev != NULL) { - intMethods = dev->methods(methodsSupported); + intMethods = dev->methods(); } } catch(exception e){ intMethods = 0; handleException(e); } - intMethods = intMethods & methodsSupported; //Strip the methods not supported by client. + intMethods = Device::maskUnsupportedMethods(intMethods, methodsSupported); //Strip the methods not supported by client. return intMethods; } diff --git a/driver/libtelldus-core/telldus-core.h b/driver/libtelldus-core/telldus-core.h index 55d52873..a8534b92 100644 --- a/driver/libtelldus-core/telldus-core.h +++ b/driver/libtelldus-core/telldus-core.h @@ -40,7 +40,7 @@ extern "C" { TELLSTICK_API int WINAPI tdBell(int intDeviceId); TELLSTICK_API int WINAPI tdDim(int intDeviceId, unsigned char level); TELLSTICK_API int WINAPI tdMethods(int id, int methodsSupported); - TELLSTICK_API int WINAPI tdLastSentCommand( int intDeviceId ); + TELLSTICK_API int WINAPI tdLastSentCommand( int intDeviceId, int methodsSupported ); TELLSTICK_API char *WINAPI tdLastSentValue( int intDeviceId ); TELLSTICK_API int WINAPI tdGetNumberOfDevices();