HIDAttachCallback

Syntax

#include <cafe/hid.h>
    
#define HID_DEVICE_DETACH   0
#define HID_DEVICE_ATTACH   1

typedef int (*HIDAttachCallback)(
                        HIDClient   *p_hc,
                        HIDDevice   *p_hd,   
                        u32         attach
                        );

Parameters

p_hc Pointer to the HIDClient specified on HIDAddClient. This can be used to reference the specific HIDClient in cases where the same HIDAttachCallback is used for more than one client.
p_hd Pointer to the HIDDevice that includes parameters for the HID interface that is attached or detached.
attach Attach or detach event. HID_DEVICE_DETACH is detach; HID_DEVICE_ATTACH is attach.

Return Values

The HIDAttachCallback function returns 1 on HID_DEVICE_ATTACH if the client driver supports the specific HID interface.

Description

HIDAttachCallback is implemented by HID clients to receive attach and detach events for HID interface at runtime. The first client to accept the HIDDevice on HID_DEVICE_ATTACH will break the callback chain to additional clients. Attach and detach events are notified to clients in FILO order. After attachment, the HIDClient stores the HIDDevice.handle to address the HID interface for runtime transactions. The handle will no longer be valid after the HID interface is detached.

Do Not Call From

Background Do not call this function from the background.

See Also

HIDAddClient
HIDDelClient

Revision History

2013/05/08 Automated cleanup pass.
2011/09/29 Initial version.


CONFIDENTIAL