Functions | |
| void WINAPI | tdInit (void) |
| int WINAPI | tdRegisterDeviceEvent (TDDeviceEvent eventFunction, void *context) |
| int WINAPI | tdRegisterRawDeviceEvent (TDRawDeviceEvent eventFunction, void *context) |
| int WINAPI | tdRegisterDeviceChangeEvent (TDDeviceChangeEvent eventFunction, void *context) |
| int WINAPI | tdRegisterSensorEvent (TDSensorEvent eventFunction, void *context) |
| int WINAPI | tdRegisterControllerEvent (TDControllerEvent eventFunction, void *context) |
| int WINAPI | tdUnregisterCallback (int callbackId) |
| void WINAPI | tdClose (void) |
| void WINAPI | tdReleaseString (char *thestring) |
| int WINAPI | tdTurnOn (int intDeviceId) |
| int WINAPI | tdTurnOff (int intDeviceId) |
| int WINAPI | tdBell (int intDeviceId) |
| int WINAPI | tdDim (int intDeviceId, unsigned char level) |
| int WINAPI | tdExecute (int intDeviceId) |
| int WINAPI | tdUp (int intDeviceId) |
| int WINAPI | tdDown (int intDeviceId) |
| int WINAPI | tdStop (int intDeviceId) |
| int WINAPI | tdLearn (int intDeviceId) |
| int WINAPI | tdLastSentCommand (int intDeviceId, int methodsSupported) |
| char *WINAPI | tdLastSentValue (int intDeviceId) |
| int WINAPI | tdGetNumberOfDevices (void) |
| int WINAPI | tdGetDeviceId (int intDeviceIndex) |
| int WINAPI | tdGetDeviceType (int intDeviceId) |
| char *WINAPI | tdGetName (int intDeviceId) |
| bool WINAPI | tdSetName (int intDeviceId, const char *strNewName) |
| char *WINAPI | tdGetProtocol (int intDeviceId) |
| bool WINAPI | tdSetProtocol (int intDeviceId, const char *strProtocol) |
| char *WINAPI | tdGetModel (int intDeviceId) |
| bool WINAPI | tdSetModel (int intDeviceId, const char *strModel) |
| bool WINAPI | tdSetDeviceParameter (int intDeviceId, const char *strName, const char *strValue) |
| char *WINAPI | tdGetDeviceParameter (int intDeviceId, const char *strName, const char *defaultValue) |
| int WINAPI | tdAddDevice () |
| bool WINAPI | tdRemoveDevice (int intDeviceId) |
| int WINAPI | tdMethods (int id, int methodsSupported) |
| char *WINAPI | tdGetErrorString (int intErrorNo) |
| int WINAPI | tdSendRawCommand (const char *command, int reserved) |
| void WINAPI | tdConnectTellStickController (int vid, int pid, const char *serial) |
| void WINAPI | tdDisconnectTellStickController (int vid, int pid, const char *serial) |
| int WINAPI | tdSensor (char *protocol, int protocolLen, char *model, int modelLen, int *id, int *dataTypes) |
| int WINAPI | tdSensorValue (const char *protocol, const char *model, int id, int dataType, char *value, int len, int *timestamp) |
| int WINAPI | tdController (int *controllerId, int *controllerType, char *name, int nameLen, int *available) |
| int WINAPI | tdControllerValue (int controllerId, const char *name, char *value, int valueLen) |
| int WINAPI | tdSetControllerValue (int controllerId, const char *name, const char *value) |
| int WINAPI | tdRemoveController (int controllerId) |
Device method flags | |
Flags for the different methods/commands a device can support. Can be used as bit flags in e.g. tdMethods(). | |
| #define | TELLSTICK_TURNON 1 |
| #define | TELLSTICK_TURNOFF 2 |
| #define | TELLSTICK_BELL 4 |
| #define | TELLSTICK_TOGGLE 8 |
| #define | TELLSTICK_DIM 16 |
| #define | TELLSTICK_LEARN 32 |
| #define | TELLSTICK_EXECUTE 64 |
| #define | TELLSTICK_UP 128 |
| #define | TELLSTICK_DOWN 256 |
| #define | TELLSTICK_STOP 512 |
Device types | |
The device type as returned from tdGetDeviceType(). | |
| #define | TELLSTICK_TYPE_DEVICE 1 |
| #define | TELLSTICK_TYPE_GROUP 2 |
| #define | TELLSTICK_TYPE_SCENE 3 |
Sensor value types | |
The supported sensor value types are returned from tdSensor() and used when querying a sensor for a specific value in tdSensorValue(). | |
| #define | TELLSTICK_TEMPERATURE 1 |
| #define | TELLSTICK_HUMIDITY 2 |
Controller type | |
The controller type as returned from tdController(). | |
| #define | TELLSTICK_CONTROLLER_TELLSTICK 1 |
| #define | TELLSTICK_CONTROLLER_TELLSTICK_DUO 2 |
| #define | TELLSTICK_CONTROLLER_TELLSTICK_NET 3 |
Device changes | |
| #define | TELLSTICK_DEVICE_ADDED 1 |
| #define | TELLSTICK_DEVICE_CHANGED 2 |
| #define | TELLSTICK_DEVICE_REMOVED 3 |
| #define | TELLSTICK_DEVICE_STATE_CHANGED 4 |
Change types | |
| #define | TELLSTICK_CHANGE_NAME 1 |
| #define | TELLSTICK_CHANGE_PROTOCOL 2 |
| #define | TELLSTICK_CHANGE_MODEL 3 |
| #define | TELLSTICK_CHANGE_METHOD 4 |
| #define | TELLSTICK_CHANGE_AVAILABLE 5 |
| #define | TELLSTICK_CHANGE_FIRMWARE 6 |
Error codes | |
| #define | TELLSTICK_SUCCESS 0 |
| #define | TELLSTICK_ERROR_NOT_FOUND -1 |
| #define | TELLSTICK_ERROR_PERMISSION_DENIED -2 |
| #define | TELLSTICK_ERROR_DEVICE_NOT_FOUND -3 |
| #define | TELLSTICK_ERROR_METHOD_NOT_SUPPORTED -4 |
| #define | TELLSTICK_ERROR_COMMUNICATION -5 |
| #define | TELLSTICK_ERROR_CONNECTING_SERVICE -6 |
| #define | TELLSTICK_ERROR_UNKNOWN_RESPONSE -7 |
| #define | TELLSTICK_ERROR_SYNTAX -8 |
| #define | TELLSTICK_ERROR_BROKEN_PIPE -9 |
| #define | TELLSTICK_ERROR_COMMUNICATING_SERVICE -10 |
| #define | TELLSTICK_ERROR_UNKNOWN -99 |
Callback typedefs | |
| typedef void(* | TDDeviceEvent )(int deviceId, int method, const char *data, int callbackId, void *context) |
| typedef void(* | TDDeviceChangeEvent )(int deviceId, int changeEvent, int changeType, int callbackId, void *context) |
| typedef void(* | TDRawDeviceEvent )(const char *data, int controllerId, int callbackId, void *context) |
| typedef void(* | TDSensorEvent )(const char *protocol, const char *model, int id, int dataType, const char *value, int timestamp, int callbackId, void *context) |
| typedef void(* | TDControllerEvent )(int controllerId, int changeEvent, int changeType, const char *newValue, int callbackId, void *context) |
Detailed Description
Telldus Core is the base module used to interface a Telldus TellStick.
Define Documentation
| #define TELLSTICK_BELL 4 |
Device-flag for devices supporting the tdBell() call.
| #define TELLSTICK_CHANGE_AVAILABLE 5 |
The controller is now available or unavailable.
| #define TELLSTICK_CHANGE_FIRMWARE 6 |
The firmware has changed.
| #define TELLSTICK_CHANGE_METHOD 4 |
The method has changed.
| #define TELLSTICK_CHANGE_MODEL 3 |
The model has changed.
| #define TELLSTICK_CHANGE_NAME 1 |
The name has changed.
| #define TELLSTICK_CHANGE_PROTOCOL 2 |
The protocol has changed.
| #define TELLSTICK_CONTROLLER_TELLSTICK 1 |
The controller is a TellStick.
| #define TELLSTICK_CONTROLLER_TELLSTICK_DUO 2 |
The controller is a TellStick Duo.
| #define TELLSTICK_CONTROLLER_TELLSTICK_NET 3 |
The controller is a TellStick Net.
| #define TELLSTICK_DEVICE_ADDED 1 |
A new device was added.
| #define TELLSTICK_DEVICE_CHANGED 2 |
A device was changed.
| #define TELLSTICK_DEVICE_REMOVED 3 |
A device was removed.
| #define TELLSTICK_DEVICE_STATE_CHANGED 4 |
The state changed for a device.
| #define TELLSTICK_DIM 16 |
Device-flag for devices supporting the tdDim() call.
| #define TELLSTICK_DOWN 256 |
Device-flag for devices supporting the tdDown() call.
| #define TELLSTICK_ERROR_BROKEN_PIPE -9 |
Error code. Pipe broken during communication.
| #define TELLSTICK_ERROR_COMMUNICATING_SERVICE -10 |
Error code. Timeout waiting for response from the Telldus Service.
| #define TELLSTICK_ERROR_COMMUNICATION -5 |
Error code. An error occurred when communicating with TellStick.
| #define TELLSTICK_ERROR_CONNECTING_SERVICE -6 |
Error code. The client library could not connect to the service. Maybe it is not running?
| #define TELLSTICK_ERROR_DEVICE_NOT_FOUND -3 |
Error code. The supplied device id was not found.
| #define TELLSTICK_ERROR_METHOD_NOT_SUPPORTED -4 |
Error code. The requested method is not supported by the device. This should be avoided by a call to tdMethods().
Referenced by tdControllerValue(), and tdSensorValue().
| #define TELLSTICK_ERROR_NOT_FOUND -1 |
Error code. Returned if a TellStick was not found on the system.
| #define TELLSTICK_ERROR_PERMISSION_DENIED -2 |
Error code. Returned if the user doesn't have privileges to open the TellStick device.
| #define TELLSTICK_ERROR_SYNTAX -8 |
Error code. Input/command could not be parsed or didn't follow input rules.
| #define TELLSTICK_ERROR_UNKNOWN -99 |
Error code. An unknown error has occurred.
| #define TELLSTICK_ERROR_UNKNOWN_RESPONSE -7 |
Error code. The client library received a response from the service it did not understand.
| #define TELLSTICK_EXECUTE 64 |
Device-flag for devices (scenes) supporting the tdExecute() call.
| #define TELLSTICK_HUMIDITY 2 |
The sensor can report the humidity.
| #define TELLSTICK_LEARN 32 |
Device-flag for devices supporting the tdLearn() call.
| #define TELLSTICK_STOP 512 |
Device-flag for devices supporting the tdStop() call.
| #define TELLSTICK_SUCCESS 0 |
Error code. Returned when the command succeeded.
Referenced by tdControllerValue(), and tdSensorValue().
| #define TELLSTICK_TEMPERATURE 1 |
The sensor can report the temperature.
| #define TELLSTICK_TOGGLE 8 |
This method is currently unimplemented.
| #define TELLSTICK_TURNOFF 2 |
Device-flag for devices supporting the tdTurnOff() call.
| #define TELLSTICK_TURNON 1 |
Device-flag for devices supporting the tdTurnOn() call.
| #define TELLSTICK_TYPE_DEVICE 1 |
Device type of a single device.
| #define TELLSTICK_TYPE_GROUP 2 |
Device type of a device which contains other devices.
| #define TELLSTICK_TYPE_SCENE 3 |
Device type of a device which contains other devices that are sent different commands when executed (i.e. one device turns on, another turns off).
| #define TELLSTICK_UP 128 |
Device-flag for devices supporting the tdUp() call.
Typedef Documentation
The callback type for controller events.
- Attention:
- The callback will be called by another thread than the thread used by the application and some measures must be taken to synchronize it with the main thread.
- Parameters:
-
controllerId The id of the controller that was added, changed or removed. changeEvent One of the constants TELLSTICK_DEVICE_ADDED, TELLSTICK_DEVICE_CHANGED, TELLSTICK_DEVICE_STATE_CHANGED or TELLSTICK_DEVICE_REMOVED. changeType If changeEvent is: - TELLSTICK_DEVICE_ADDED this is the controller's type (e.g. TELLSTICK_CONTROLLER_TELLSTICK or TELLSTICK_CONTROLLER_TELLSTICK_DUO),
- TELLSTICK_DEVICE_CHANGED this indicates what has changed (e.g. TELLSTICK_CHANGE_NAME or TELLSTICK_CHANGE_FIRMWARE),
- TELLSTICK_DEVICE_STATE_CHANGED this indicates which state that has changed (e.g. TELLSTICK_CHANGE_AVAILABLE),
- TELLSTICK_DEVICE_REMOVED this is unused.
newValue If changeEvent is: - TELLSTICK_DEVICE_CHANGED this is the property's new value,
- TELLSTICK_DEVICE_STATE_CHANGED this is the new state. For TELLSTICK_CHANGE_AVAILABLE this is either
"0"or"1".
callbackId The id of the callback. context The pointer passed when registering for the event.
- See also:
- tdRegisterControllerEvent
The callback type for device change events.
- Attention:
- The callback will be called by another thread than the thread used by the application and some measures must be taken to synchronize it with the main thread.
- Parameters:
-
deviceId The id of the device that was added, changed or removed. changeEvent One of the constants TELLSTICK_DEVICE_ADDED, TELLSTICK_DEVICE_CHANGED or TELLSTICK_DEVICE_REMOVED. changeType If changeEvent is TELLSTICK_DEVICE_CHANGED, this parameter indicates what has changed (e.g TELLSTICK_CHANGE_NAME, TELLSTICK_CHANGE_PROTOCOL, TELLSTICK_CHANGE_MODEL or TELLSTICK_CHANGE_METHOD). callbackId The id of the callback. context The pointer passed when registering for the event.
- See also:
- tdRegisterDeviceChangeEvent
The callback type for device events.
- Attention:
- The callback will be called by another thread than the thread used by the application and some measures must be taken to synchronize it with the main thread.
- Parameters:
-
deviceId The id of the device that changed. method The new device state. Can be TELLSTICK_TURNON, TELLSTICK_TURNOFF, etc. data If method is TELLSTICK_DIM this holds the current value as a human readable string, example "128" for 50%. callbackId The id of the callback. context The pointer passed when registering for the event.
- See also:
- tdRegisterDeviceEvent
The callback type for raw events.
- Attention:
- The callback will be called by another thread than the thread used by the application and some measures must be taken to synchronize it with the main thread.
- Parameters:
-
data Raw device data. controllerId Id of receiving controller. callbackId The id of the callback. context The pointer passed when registering for the event.
- See also:
- tdRegisterRawDeviceEvent
The callback type for sensor events.
- Attention:
- The callback will be called by another thread than the thread used by the application and some measures must be taken to synchronize it with the main thread.
- Parameters:
-
protocol The sensor's protocol. model The model of the sensor. id The unique id for the sensor. dataType The type that value is. Can be one of TELLSTICK_TEMPERATURE or TELLSTICK_HUMIDITY. value A human readable string of the data. timestamp The time (as returned by the time() system call) when the value was received. callbackId The id of the callback. context The pointer passed when registering for the event.
- See also:
- tdRegisterSensorEvent
Function Documentation
| int WINAPI tdAddDevice | ( | ) |
Add a new device to the global database of devices. This function must be called first before any call to tdSetName(), tdSetProtocol() and similar functions.
- Returns:
- The new device id for the newly created device. If the creation fails it returns an error (i.e. negative) value.
- Since:
- Version 2.0.0
| int WINAPI tdBell | ( | int | intDeviceId | ) |
Sends bell command to devices supporting this. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to send bell to.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.0.0
| void WINAPI tdClose | ( | void | ) |
Close the library and clean up the cache it uses. This should be called when the library is not supposed to be used anymore.
- Since:
- Version 2.0.0
| void WINAPI tdConnectTellStickController | ( | int | vid, |
| int | pid, | ||
| const char * | serial | ||
| ) |
Connect a TellStick controller.
- Parameters:
-
vid The vendor id. pid The product id. serial The serial.
- Since:
- Version 2.1.0
| int WINAPI tdController | ( | int * | controllerId, |
| int * | controllerType, | ||
| char * | name, | ||
| int | nameLen, | ||
| int * | available | ||
| ) |
Use this function to iterate over all controllers. Iterate until TELLSTICK_SUCCESS is not returned
- Parameters:
-
[out] controllerId A by ref int where the id of the controller will be placed. [out] controllerType A by ref int where the type of the controller will be placed. [out] name A by ref string where the name of the controller will be placed. [in] nameLen The length of the name parameter. [out] available A by ref int if the controller is currently available or maybe disconnected.
- Returns:
- TELLSTICK_SUCCESS if there is more sensors to be fetched.
- See also:
- TELLSTICK_CONTROLLER_TELLSTICK
- TELLSTICK_CONTROLLER_TELLSTICK_DUO
- TELLSTICK_CONTROLLER_TELLSTICK_NET
- Since:
- Version 2.1.2
| int WINAPI tdControllerValue | ( | int | controllerId, |
| const char * | name, | ||
| char * | value, | ||
| int | valueLen | ||
| ) |
This function gets a parameter on a controller. Valid parameters are: serial, name, available and firmware
- Parameters:
-
[in] controllerId The controller to change. [in] name The parameter to get. [out] value A by ref string where the value of the parameter will be placed. [in] valueLen The length of the value parameter.
- Returns:
- TELLSTICK_SUCCESS on success, or an error code on failure.
- Since:
- Version 2.1.2
References TELLSTICK_ERROR_METHOD_NOT_SUPPORTED, and TELLSTICK_SUCCESS.
| int WINAPI tdDim | ( | int | intDeviceId, |
| unsigned char | level | ||
| ) |
Dims a device. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to dim. level The level the device should dim to. This value should be 0 - 255.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.0.0
| void WINAPI tdDisconnectTellStickController | ( | int | vid, |
| int | pid, | ||
| const char * | serial | ||
| ) |
Disconnect a TellStick controller.
- Parameters:
-
vid The vendor id. pid The product id. serial The serial.
- Since:
- Version 2.1.0
| int WINAPI tdDown | ( | int | intDeviceId | ) |
Send "down" command to device. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to send the command to.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.1.0
| int WINAPI tdExecute | ( | int | intDeviceId | ) |
Execute a scene action. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The id to execute.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.1.0
| int WINAPI tdGetDeviceId | ( | int | intDeviceIndex | ) |
This function returns the unique id of a device with a specific index.
To get all the id numbers you should loop over all the devices:
int intNumberOfDevices = tdGetNumberOfDevices(); for (int i = 0; i < intNumberOfDevices; i++) { int id = tdGetDeviceId( i ); // id now contains the id number of the device with index of i }
- Parameters:
-
intDeviceIndex The device index to query. The index starts from 0.
- Returns:
- The unique id for the device or
-1if the device is not found.
- Since:
- Version 2.0.0
| char* WINAPI tdGetDeviceParameter | ( | int | intDeviceId, |
| const char * | strName, | ||
| const char * | defaultValue | ||
| ) |
Get a protocol specific parameter for a device.
- Parameters:
-
intDeviceId The device to query. strName The name of the parameter to query. defaultValue A default value to return if the current parameter hasn't previously been set.
- Returns:
- The protocol specific parameter specified by strName. The returned string must be freed by calling tdReleaseString().
- Since:
- Version 2.0.0
| int WINAPI tdGetDeviceType | ( | int | intDeviceId | ) |
Get the device type.
- Parameters:
-
intDeviceId The unique id of the device to query.
- Returns:
- Which type the device is. The device could be either TELLSTICK_TYPE_DEVICE, TELLSTICK_TYPE_GROUP or TELLSTICK_TYPE_SCENE
- Since:
- Version 2.0.0
| char* WINAPI tdGetErrorString | ( | int | intErrorNo | ) |
Get a human readable string from an error code returned from a function in telldus-core.
- Parameters:
-
intErrorNo The error code to translate.
- Returns:
- A string ready to show to the user. The returned string must be freed by calling tdReleaseString().
- See also:
- TELLSTICK_SUCCESS
- TELLSTICK_ERROR_NOT_FOUND
- TELLSTICK_ERROR_PERMISSION_DENIED
- TELLSTICK_ERROR_DEVICE_NOT_FOUND
- TELLSTICK_ERROR_METHOD_NOT_SUPPORTED
- TELLSTICK_ERROR_COMMUNICATION
- TELLSTICK_ERROR_CONNECTING_SERVICE
- TELLSTICK_ERROR_UNKNOWN_RESPONSE
- TELLSTICK_ERROR_SYNTAX
- TELLSTICK_ERROR_BROKEN_PIPE
- TELLSTICK_ERROR_COMMUNICATING_SERVICE
- TELLSTICK_ERROR_UNKNOWN
- Since:
- Version 2.0.0
| char* WINAPI tdGetModel | ( | int | intDeviceId | ) |
Get the device model.
- Parameters:
-
intDeviceId The device to query.
- Returns:
- The model for a device. Not all protocols uses this. The returned string must be freed by calling tdReleaseString().
- Since:
- Version 2.0.0
| char* WINAPI tdGetName | ( | int | intDeviceId | ) |
Query a device for it's name.
- Parameters:
-
intDeviceId The unique id of the device to query.
- Returns:
- The name of the device or an empty string if the device is not found. The returned string must be freed by calling tdReleaseString().
- Since:
- Version 2.0.0
| int WINAPI tdGetNumberOfDevices | ( | void | ) |
This function returns the number of devices configured.
- Returns:
- An integer of the total number of devices configured.
- Since:
- Version 2.0.0
| char* WINAPI tdGetProtocol | ( | int | intDeviceId | ) |
Get the device protocol.
- Parameters:
-
intDeviceId The device id to query.
- Returns:
- The protocol used by a specific device. The returned string must be freed by calling tdReleaseString().
- Since:
- Version 2.0.0
| void WINAPI tdInit | ( | void | ) |
This function initiates the library. Call this function before any other call to a function in telldus-core.
- Since:
- Version 2.0.0
| int WINAPI tdLastSentCommand | ( | int | intDeviceId, |
| int | methodsSupported | ||
| ) |
Returns the last sent command to a specific device
- Parameters:
-
intDeviceId The device id to query. 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
- Since:
- Version 2.0.0
| char* WINAPI tdLastSentValue | ( | int | intDeviceId | ) |
If the last sent command it TELLSTICK_DIM this returns the dimmed value.
- Parameters:
-
intDeviceId The device id to query.
- Returns:
- The the value as a human readable string, example "128" for 50%. The returned string must be freed by calling tdReleaseString().
- Since:
- Version 2.0.0
| int WINAPI tdLearn | ( | int | intDeviceId | ) |
Sends a special learn command to some devices that need a special learn-command to be used from TellStick. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to learn.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.0.0
| int WINAPI tdMethods | ( | int | id, |
| int | methodsSupported | ||
| ) |
Query a device for which methods it supports. By supplying the methods you support the library could remap the methods a device support for better fit the application.
Example of querying a device supporting TELLSTICK_BELL:
int methods = tdMethods( id, TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_BELL); // methods is now TELLSTICK_BELL int methods = tdMethods(id, TELLSTICK_TURNON | TELLSTICK_TURNOFF); // methods is now TELLSTICK_TURNON because the client application doesn't // support TELLSTICK_BELL
- Parameters:
-
id The device id to query. methodsSupported The methods the client application supports.
- Returns:
- The method-flags OR'ed into an integer.
- See also:
- TELLSTICK_TURNON
- TELLSTICK_TURNOFF
- TELLSTICK_BELL
- TELLSTICK_TOGGLE
- TELLSTICK_DIM
- TELLSTICK_EXECUTE
- TELLSTICK_UP
- TELLSTICK_DOWN
- TELLSTICK_STOP
- Since:
- Version 2.0.0
| int WINAPI tdRegisterControllerEvent | ( | TDControllerEvent | eventFunction, |
| void * | context | ||
| ) |
Register a callback that will receive controller events.
- Parameters:
-
eventFunction Callback function. context Pointer that will be passed back in the callback.
- Returns:
- An id identifying the callback. Pass this id to tdUnregisterCallback() to stop receiving callbacks.
- See also:
- Registering for callbacks
- Since:
- Version 2.1.2
| int WINAPI tdRegisterDeviceChangeEvent | ( | TDDeviceChangeEvent | eventFunction, |
| void * | context | ||
| ) |
Register a callback that will receive device change events. This includes addition of new devices, changes of device properties (e.g. name) and removal of existing devices.
- Parameters:
-
eventFunction Callback function. context Pointer that will be passed back in the callback.
- Returns:
- An id identifying the callback. Pass this id to tdUnregisterCallback() to stop receiving callbacks.
- See also:
- Registering for callbacks
- Since:
- Version 2.1.0
| int WINAPI tdRegisterDeviceEvent | ( | TDDeviceEvent | eventFunction, |
| void * | context | ||
| ) |
Register a callback that will receive device events.
- Parameters:
-
eventFunction Callback function. context Pointer that will be passed back in the callback.
- Returns:
- An id identifying the callback. Pass this id to tdUnregisterCallback() to stop receiving callbacks.
- See also:
- Registering for callbacks
- Since:
- Version 2.0.0
| int WINAPI tdRegisterRawDeviceEvent | ( | TDRawDeviceEvent | eventFunction, |
| void * | context | ||
| ) |
Register a callback that will receive raw (i.e. all) events.
- Parameters:
-
eventFunction Callback function. context Pointer that will be passed back in the callback.
- Returns:
- An id identifying the callback. Pass this id to tdUnregisterCallback() to stop receiving callbacks.
- See also:
- Registering for callbacks
- Since:
- Version 2.0.0
| int WINAPI tdRegisterSensorEvent | ( | TDSensorEvent | eventFunction, |
| void * | context | ||
| ) |
Register a callback that will receive sensor events.
- Parameters:
-
eventFunction Callback function. context Pointer that will be passed back in the callback.
- Returns:
- An id identifying the callback. Pass this id to tdUnregisterCallback() to stop receiving callbacks.
- See also:
- Registering for callbacks
- Since:
- Version 2.1.0
| void WINAPI tdReleaseString | ( | char * | thestring | ) |
This method releases resources allocated by telldus-core. It should be called on the returned value from all functions returning char *.
- Parameters:
-
thestring A string returned from a td* function.
- Since:
- Version 2.0.1
| int WINAPI tdRemoveController | ( | int | controllerId | ) |
This function removes a controller from the list of controllers. The controller must not be available (disconnected) for this to work.
- Parameters:
-
controllerId The controller to remove.
- Returns:
- TELLSTICK_SUCCESS if the controller was removed, TELLSTICK_ERROR_NOT_FOUND if the controller was not found, and TELLSTICK_ERROR_PERMISSION_DENIED if the controller is still connected.
- Since:
- Version 2.1.2
| bool WINAPI tdRemoveDevice | ( | int | intDeviceId | ) |
Removes a device.
- Parameters:
-
intDeviceId The device to query.
- Returns:
trueon success,falseotherwise.
- Since:
- Version 2.0.0
| int WINAPI tdSendRawCommand | ( | const char * | command, |
| int | reserved | ||
| ) |
Send a raw command to TellStick. Please read the TellStick protocol definition on how the command should be constructed.
- Parameters:
-
command The command for TellStick in its native format. reserved Reserved for future use.
- Returns:
- TELLSTICK_SUCCESS on success or one of the error codes on failure
- Since:
- Version 2.0.0
| int WINAPI tdSensor | ( | char * | protocol, |
| int | protocolLen, | ||
| char * | model, | ||
| int | modelLen, | ||
| int * | id, | ||
| int * | dataTypes | ||
| ) |
Use this function to iterate over all sensors. Iterate until TELLSTICK_SUCCESS is not returned.
- Parameters:
-
[out] protocol A by ref string where the protocol of the sensor will be placed. [in] protocolLen The length of the protocol parameter. [out] model A by ref string where the model of the sensor will be placed. [in] modelLen The length of the model parameter. [out] id A by ref int where the id of the sensor will be placed. [out] dataTypes A by ref int with flags for the supported sensor values.
- Returns:
- TELLSTICK_SUCCESS if there is more sensors to be fetched.
- Since:
- Version 2.1.0
| int WINAPI tdSensorValue | ( | const char * | protocol, |
| const char * | model, | ||
| int | id, | ||
| int | dataType, | ||
| char * | value, | ||
| int | len, | ||
| int * | timestamp | ||
| ) |
Get one of the supported sensor values from a sensor. Make sure it support the value type first by calling tdSensor(). The triplet protocol, model and id together identifies a sensor.
- Parameters:
-
[in] protocol The protocol for the sensor. [in] model The model for the sensor. [in] id The id of the sensor. [in] dataType Which sensor value to retrive (one of TELLSTICK_TEMPERATURE or TELLSTICK_HUMIDITY). [out] value A by ref string where the value will be placed. [in] len The length of the value parameter. [out] timestamp A by ref int where the timestamp of the value will be placed.
- Returns:
- TELLSTICK_SUCCESS if the value could be fetched or one of the error codes on failure.
- Since:
- Version 2.1.0
References TELLSTICK_ERROR_METHOD_NOT_SUPPORTED, and TELLSTICK_SUCCESS.
| int WINAPI tdSetControllerValue | ( | int | controllerId, |
| const char * | name, | ||
| const char * | value | ||
| ) |
This function sets a parameter on a controller. Valid parameters are: name.
- Parameters:
-
controllerId The controller to change. name The parameter to change. value The new value for the parameter.
- Returns:
- TELLSTICK_SUCCESS on success, or an error code on failure.
- Since:
- Version 2.1.2
| bool WINAPI tdSetDeviceParameter | ( | int | intDeviceId, |
| const char * | strName, | ||
| const char * | strValue | ||
| ) |
Sets a new protocol specific parameter. Please see the documentation of the protocols before setting any parameter.
- Parameters:
-
intDeviceId The device to change. strName The parameter to change. strValue The new value for the parameter.
- Returns:
trueon success,falseotherwise.
- Since:
- Version 2.0.0
| bool WINAPI tdSetModel | ( | int | intDeviceId, |
| const char * | strModel | ||
| ) |
Sets a new model for a device. Which model to set depends on the current protocol.
- Parameters:
-
intDeviceId The device to change. strModel The new model.
- Returns:
trueon success,falseotherwise.
- Since:
- Version 2.0.0
| bool WINAPI tdSetName | ( | int | intDeviceId, |
| const char * | strNewName | ||
| ) |
Sets a new name for a device. The devices are global for all application, changing this will change the name for other applications as well.
- Parameters:
-
intDeviceId The device id to change the name for. strNewName The new name for the devices.
- Returns:
trueon success,falseotherwise.
- Since:
- Version 2.0.0
| bool WINAPI tdSetProtocol | ( | int | intDeviceId, |
| const char * | strProtocol | ||
| ) |
This changes the current protocol used by a device. After changing the protocol, setting new parameters is required.
- Parameters:
-
intDeviceId The device to change. strProtocol The new protocol to use.
- Returns:
trueon success,falseotherwise.
- See also:
- tdSetModel()
- tdSetDeviceParameter()
- Since:
- Version 2.0.0
| int WINAPI tdStop | ( | int | intDeviceId | ) |
Send "stop" command to device. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to stop.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.1.0
| int WINAPI tdTurnOff | ( | int | intDeviceId | ) |
Turns a device off. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to turn off.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.0.0
| int WINAPI tdTurnOn | ( | int | intDeviceId | ) |
Turns a device on. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to turn on.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.0.0
| int WINAPI tdUnregisterCallback | ( | int | callbackId | ) |
Unregister a callback.
- Parameters:
-
callbackId The returned id from one of the tdRegister* functions.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- See also:
- Registering for callbacks
- Since:
- Version 2.1.0
| int WINAPI tdUp | ( | int | intDeviceId | ) |
Send "up" command to device. Make sure the device supports this by calling tdMethods() before any call to this function.
- Parameters:
-
intDeviceId The device id to send the command to.
- Returns:
- TELLSTICK_SUCCESS on success or appropriate error code on failure.
- Since:
- Version 2.1.0
