Hexagon / node-telldus

Node bindings for telldus-core
Other
34 stars 10 forks source link

Require testing: New functions getDeviceId, getDeviceIdSync #39

Closed Hexagon closed 10 years ago

Hexagon commented 10 years ago

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 -1 if the device is not found.