tdGetNumberOfDevices

Moderator: Telldus

Post Reply
matson1111
Posts: 13
Joined: Thu Jan 18, 2018 11:08 am

tdGetNumberOfDevices

Post by matson1111 » Thu Jan 18, 2018 11:08 am

Is there a simple explanation the below doesn't work, tdGetNumberOfDevices returns -6 with or without the tdInit() call. I've configured 3 devices that can be toggled in TelldusCenter.
I'm running 10.6.6 and Xcode 3.2.5

// buildcommand: gcc foo.cpp -framework TelldusCore -arch i386 -lstdc++ -o thing

#include "TelldusCore/telldus-core.h"
#include <iostream>

int main()
{
tdInit();
std::cout << "There are " << tdGetNumberOfDevices() << " devices" << std::endl;

return 0;
}

micke.prag
Site Admin
Posts: 2222
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: tdGetNumberOfDevices

Post by micke.prag » Thu Jan 18, 2018 11:08 am

What version are you running?
-6 means TELLSTICK_ERROR_CONNECTING_SERVICE but isn't available in our stable series.

Have you compiled the framework by yourself?

About error codes, read the section "Error codes" here:
http://developer.telldus.se/doxygen/
Micke Prag
Software
Telldus Technologies

matson1111
Posts: 13
Joined: Thu Jan 18, 2018 11:08 am

Re: tdGetNumberOfDevices

Post by matson1111 » Thu Jan 18, 2018 11:08 am

micke.prag wrote:What version are you running?
-6 means TELLSTICK_ERROR_CONNECTING_SERVICE but isn't available in our stable series.

Have you compiled the framework by yourself?

About error codes, read the section "Error codes" here:
http://developer.telldus.se/doxygen/
I'm building against 2.0.4 in default framework location /Library/Frameworks. I realised what it means, looked in telldus-core.h. That's why I thought it was wierd.
I just tried adding a -F/Library/Frameworks to the build command, which gave the same result.
Why do you write that it isn't availiable in your stable series?

micke.prag
Site Admin
Posts: 2222
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: tdGetNumberOfDevices

Post by micke.prag » Thu Jan 18, 2018 11:08 am

That define isn't defined in 2.0.4. It was added later.

Do you have TELLSTICK_ERROR_CONNECTING_SERVICE defined in telldus-core.h?
Micke Prag
Software
Telldus Technologies

matson1111
Posts: 13
Joined: Thu Jan 18, 2018 11:08 am

Re: tdGetNumberOfDevices

Post by matson1111 » Thu Jan 18, 2018 11:08 am

micke.prag wrote:That define isn't defined in 2.0.4. It was added later.

Do you have TELLSTICK_ERROR_CONNECTING_SERVICE defined in telldus-core.h?

Ahh, sweet, now we are rock'n. The Current symlink in /Library/Frameworks/TelldusCore.frameworks/Versions pointed to a 2.0.103. I tried to build from source earlier so it must have been created. Can't remember if I installed the prebuilt TelldusCenter after that though.
Deleted /Library/Frameworks/TelldusCore.framework and reinstalled.

Thanx

Post Reply