tdGetNumberOfDevices

Moderator: Telldus

Post Reply
matson1111
Posts: 13
Joined: Fri Mar 17, 2023 9:45 am

tdGetNumberOfDevices

Post by matson1111 »

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: 2243
Joined: Fri Mar 17, 2023 9:45 am
Location: Lund
Contact:

Re: tdGetNumberOfDevices

Post by micke.prag »

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: Fri Mar 17, 2023 9:45 am

Re: tdGetNumberOfDevices

Post by matson1111 »

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: 2243
Joined: Fri Mar 17, 2023 9:45 am
Location: Lund
Contact:

Re: tdGetNumberOfDevices

Post by micke.prag »

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: Fri Mar 17, 2023 9:45 am

Re: tdGetNumberOfDevices

Post by matson1111 »

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