diff --git a/telldus-core/client/CallbackMainDispatcher.cpp b/telldus-core/client/CallbackMainDispatcher.cpp index fb9a20f3..fbc09cbd 100644 --- a/telldus-core/client/CallbackMainDispatcher.cpp +++ b/telldus-core/client/CallbackMainDispatcher.cpp @@ -64,7 +64,7 @@ int CallbackMainDispatcher::registerCallback(CallbackStruct::CallbackType type, return id; } -bool CallbackMainDispatcher::unregisterCallback(int callbackId) { +int CallbackMainDispatcher::unregisterCallback(int callbackId) { CallbackList newEventList; { TelldusCore::MutexLocker locker(&d->mutex); @@ -83,9 +83,9 @@ bool CallbackMainDispatcher::unregisterCallback(int callbackId) { } delete (*it); newEventList.erase(it); - return true; + return TELLSTICK_SUCCESS; } - return false; + return TELLSTICK_ERROR_NOT_FOUND; } void CallbackMainDispatcher::run(){ diff --git a/telldus-core/client/CallbackMainDispatcher.h b/telldus-core/client/CallbackMainDispatcher.h index c8856895..a2d2f1c9 100644 --- a/telldus-core/client/CallbackMainDispatcher.h +++ b/telldus-core/client/CallbackMainDispatcher.h @@ -26,7 +26,7 @@ namespace TelldusCore { EventRef retrieveCallbackEvent(); int registerCallback( TelldusCore::CallbackStruct::CallbackType type, void *eventFunction, void *context ); - bool unregisterCallback( int callbackId ); + int unregisterCallback( int callbackId ); protected: void run(); diff --git a/telldus-core/client/Client.cpp b/telldus-core/client/Client.cpp index 20e7e89f..b805bb14 100644 --- a/telldus-core/client/Client.cpp +++ b/telldus-core/client/Client.cpp @@ -185,7 +185,7 @@ void Client::stopThread(){ d->eventSocket.stopReadWait(); } -bool Client::unregisterCallback( int callbackId ) { +int Client::unregisterCallback( int callbackId ) { return d->callbackMainDispatcher.unregisterCallback(callbackId); } diff --git a/telldus-core/client/Client.h b/telldus-core/client/Client.h index 2bd0c5ce..88b2b41d 100644 --- a/telldus-core/client/Client.h +++ b/telldus-core/client/Client.h @@ -17,7 +17,7 @@ namespace TelldusCore { int registerEvent(CallbackStruct::CallbackType type, void *eventFunction, void *context ); void stopThread(void); - bool unregisterCallback( int callbackId ); + int unregisterCallback( int callbackId ); int getSensor(char *protocol, int protocolLen, char *model, int modelLen, int *id, int *dataTypes); int getController(int *controllerId, int *controllerType, char *name, int nameLen, int *available); diff --git a/telldus-core/client/telldus-core.cpp b/telldus-core/client/telldus-core.cpp index 7e689f3e..6ec8ddfb 100644 --- a/telldus-core/client/telldus-core.cpp +++ b/telldus-core/client/telldus-core.cpp @@ -425,7 +425,7 @@ int WINAPI tdRegisterControllerEvent( TDControllerEvent eventFunction, void *con * The returned id from one of the tdRegister* functions. * * @returns - * 1 on success, or 0 on failure. + * @ref TELLSTICK_SUCCESS on success or appropriate error code on failure. * * @sa @ref sec_events_registering * @since Version 2.1.0