Merge branch 'misc-fixes'
This commit is contained in:
commit
c77fd899a1
7 changed files with 17 additions and 13 deletions
|
@ -44,7 +44,7 @@
|
|||
* \code
|
||||
* int intNumberOfDevices = tdGetNumberOfDevices();
|
||||
* for (int i = 0; i < intNumberOfDevices; i++) {
|
||||
* int id = tdGetDeviceId( index );
|
||||
* int id = tdGetDeviceId( i );
|
||||
* char *name = tdGetName( id );
|
||||
* printf("%d\t%s\n", id, name);
|
||||
* tdReleaseString(name);
|
||||
|
|
|
@ -58,11 +58,11 @@ def rawcallbackfunction(data, controllerId, callbackId, context):
|
|||
print string_at(data)
|
||||
|
||||
if (platform.system() == 'Windows'):
|
||||
CMPFUNC = WINFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type
|
||||
CMPFUNCRAW = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = WINFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type
|
||||
CMPFUNCRAW = WINFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
else:
|
||||
CMPFUNC = CFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p)
|
||||
CMPFUNCRAW = CFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = CFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p)
|
||||
CMPFUNCRAW = CFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
|
||||
cmp_func = CMPFUNC(callbackfunction)
|
||||
cmp_funcraw = CMPFUNCRAW(rawcallbackfunction)
|
||||
|
|
|
@ -29,9 +29,9 @@ def callbackfunction(protocol, model, id, dataType, value, timestamp, callbackId
|
|||
|
||||
|
||||
if (platform.system() == 'Windows'):
|
||||
CMPFUNC = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type
|
||||
CMPFUNC = WINFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type
|
||||
else:
|
||||
CMPFUNC = CFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = CFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
|
||||
cmp_func = CMPFUNC(callbackfunction)
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ void WINAPI tdInit(void) {
|
|||
* @since Version 2.0.0
|
||||
**/
|
||||
int WINAPI tdRegisterDeviceEvent( TDDeviceEvent eventFunction, void *context ) {
|
||||
eventFunction; Client *client = Client::getInstance();
|
||||
Client *client = Client::getInstance();
|
||||
return client->registerEvent( CallbackStruct::DeviceEvent, (void *)eventFunction, context );
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ char * WINAPI tdGetErrorString(int intErrorNo) {
|
|||
"Received an unknown response",
|
||||
"Syntax error",
|
||||
"Broken pipe"
|
||||
"An error occured while communicating with the Telldus Service"
|
||||
"An error occurred while communicating with the Telldus Service"
|
||||
};
|
||||
std::string strReturn;
|
||||
intErrorNo = abs(intErrorNo); //We don't use negative values here.
|
||||
|
|
|
@ -39,7 +39,7 @@ std::wstring TelldusCore::charToWstring(const char *value) {
|
|||
size_t outbytesLeft = utf8Length*sizeof(wchar_t);
|
||||
|
||||
//Copy the instring
|
||||
char *inString = new char[strlen(value)+1];
|
||||
char *inString = new char[utf8Length+1];
|
||||
strcpy(inString, value);
|
||||
|
||||
//Create buffer for output
|
||||
|
|
|
@ -199,9 +199,10 @@ void ControllerManager::loadStoredControllers() {
|
|||
int id = d->settings.getNodeId(Settings::Controller, i);
|
||||
d->controllers[id].controller = NULL;
|
||||
d->controllers[id].name = d->settings.getName(Settings::Controller, id);
|
||||
d->controllers[id].type = d->settings.getControllerType(id);
|
||||
const int type = d->settings.getControllerType(id);
|
||||
d->controllers[id].type = type;
|
||||
d->controllers[id].serial = d->settings.getControllerSerial(id);
|
||||
signalControllerEvent(id, TELLSTICK_DEVICE_ADDED, 0, L"");
|
||||
signalControllerEvent(id, TELLSTICK_DEVICE_ADDED, type, L"");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
|
|||
argp_usage (state);
|
||||
|
||||
case ARGP_KEY_ARG:
|
||||
if (state->next == state->argc) {
|
||||
argp_usage (state);
|
||||
}
|
||||
command = arg;
|
||||
action = state->argv[state->next];
|
||||
state->next = state->argc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue