SlinkX.AddDevice

long AddDevice(LPCTSTR DeviceName, LPCTSTR DeviceFile, long IDNumber, long SlinkeNumber, long Ports)

Parameters

DeviceName

A string containing then name you want to use for the device within the control. This needs to be unique.

DeviceFile

A complete path to the device file which defines the codes for the device

IDNumber

A 1-based index to which device number you want to use if the device file defines more than one possible device ID (e.g. Sony CD changers and VCRs can be numbered 1,2, or 3)

SlinkeNumber

A 1-based index to which Slink-e the device is connected to. Most people only own one Slink-e, so this is usually 1. This parameter is also used to index CM11As and DXSs when the appropriate device files are loaded.

Ports

Which Slink-e port the device is connected to. The following bit fields are valid:

Bit Port
0 S-Link Port 0
1 S-Link Port 1
2 S-Link Port 2
3 S-Link Port 3
4 IR Port 0
(only IR port on Slink-e V1.0)
5 IR Port 1
6 IR Port 2
7 IR Port 3
8 IR Port 4
9 IR Port 5
10 IR Port 6
11 IR Port 7
(also Control-S Port on Slink-e V2.0)

Remarks

You must use this command to add any devices you intend to use with the control before being able to send or receive messages from them.

Example (Visual Basic)

Dim devID As Long
Dim slinkenum As Long
Dim portnum As Long
Dim devfile As String
Dim devname As String
devID = 1
slinkenum = 1
rem send to all 8 IR ports
portnum = &HFF0
devname = "tv"
devfile = App.Path + "\tv.cde"
result = Slinkx.AddDevice(devname, devfile, devID, slinkenum, portnum)

See Also

SlinkX.AddDeviceText, SlinkX.DeleteDevice