CHAILink SDK  Version 1.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CLC_ErrorCode LocalDevice_AddController ( CPHOBJECT const  hLocalDevice,
CPCHAR8 const *const  utf8Name,
ControllerTypes const  types,
MessageTypes const  preferredMsgType,
CPUINT16 const  wPreferredMsgNum,
CPUINT16 const  wGroup,
CPSECTIONID const *const  pSectionID,
CPUINT32 const  dwControllerUserData,
CPHOBJECT *const  phController,
CPUINT16 *const  pwControllerID 
)

Add a Controller.

Parameters
[in]hLocalDeviceHandle to the local device.
[in]utf8NameOutput & Controller's name
[in]typescombination of flags determining the controller's type.
Warning
The type argument is a combination of ControllerTypes values, including the CT_MsgMod, CT_MsgSel or CT_MsgText values. These are useful to describe the ability of this controller to send natively these kind of messages. These flags are used by SmartConnect to determine the best matching between controllers and parameters, or during the Learning process in order to accept only binding with a compatible Parameter.
Parameters
[in]preferredMsgTypethe preferred message type for the control (if any, can be CPNS::Enums::MT_None)
[in]wPreferredMsgNumthe preferred message number for the control (if any)
[in]wGroupcontroller's group. Controllers having the same group number (>0) are physically attached.
[in]pSectionIDPointer to the related section ID. If empty, it is automatically set to {type CPNS::Enums::SECT_Multipurpose, instance 0}. If it is not empty, the SectionType part must not be a wildcard value. If the instance part is 0xFFFF (wildcard), it is automatically assigned to the next free instance number for the specified section type.
[in]dwControllerUserDataA 32 bit user data associated to the returned controller handle. This data will be passed back to the application in controller notifications.
[out]phControllerPointer to the handle of the newly created controller, or CPHOBJECT_NULL if call failed.
[out]pwControllerIDPointer to the Controller ID of the newly created controller (inherit from IBaseOutput).
Returns
Standard CHAILink Client return code. See CLC_ErrorCode enumeration.
Warning
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.