CHAILink SDK  Version 1.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CLC_ErrorCode LocalDevice_AddSubDevice ( ObjectTypes  deviceType,
CPHOBJECT const  hLocalDevice,
CPUINT16 const  wModuleID,
CPBOOLEAN const  fHidden,
ExtendedDeviceCapabilities const  extendedCapabilities,
CPCHAR8 const *const  utf8ModelName,
CPUINT32 const  dwNewDeviceUserData,
CPHOBJECT *const  phNewDevice 
)

Add a sub-device.

A sub-device get the same identity (BrandID and ModelID) than its root, but it has a unique ModuleID that must be <> 0. Brand name and Model name can be customized if needed.

Parameters
[in]deviceTypeSub-device's type. see ObjectTypes enumeration.
[in]hLocalDeviceHandle to its parent device.
[in]wModuleIDA unique non-zero ModuleID identifying the sub-device.
[in]fHiddenIndicates if device is hidden or not.
[in]extendedCapabilitiesSub-Device's extended capabilities. See ExtendedDeviceCapabilities enumeration.
[in]utf8ModelNameSub-device's Model name, or NULL to keep root's name.
[in]dwNewDeviceUserDataA 32 bit user data associated to the returned device handle. This data will be passed back to the application in Device notifications.
[out]phNewDevicePointer to the handle of the new local device, or CPHOBJECT_NULL if call failed.
Returns
Standard CHAILink Client return code. See CLC_ErrorCode enumeration.
Warning
VMIDILink devices are automatically flagged as hidden and extendedCapabilities is not used.
This function can only be called in CopperLan context. This means in the pseudo task CPDoProcess(), in notification handlers or in asynchronous return handlers and not in SystemDoProcess() for instance.