Bluetooth Framework C++ Edition
Public Member Functions | Protected Member Functions | List of all members
CwclWiiRemoteHidClientConnection Class Reference

The virtual connection represents a Wii Remote HID client. More...

#include <wclBluetooth.h>

Inheritance diagram for CwclWiiRemoteHidClientConnection:
CwclWiiRemoteClientConnection CwclClientConnection CwclCustomConnection

Public Member Functions

 CwclWiiRemoteHidClientConnection (CwclBluetoothRadio *const Radio)
 Create new Wii Remote HID client connection.
 
- Public Member Functions inherited from CwclWiiRemoteClientConnection
 CwclWiiRemoteClientConnection (CwclBluetoothRadio *const Radio)
 Create new Wii Remote client connection.
 
int Connect (const __int64 Address, const unsigned long Timeout=10000)
 Connects to a remote device.
 
int GetStatus ()
 Requests the Wii Remote status.
 
int SetLeds (const wclWiiRemoteLeds &Leds)
 Changes the Wii Remote LEDs state.
 
int SetLeds (const bool Led1, const bool Led2, const bool Led3, const bool Led4)
 Changes the Wii Remote LEDs state.
 
int SetRumble (const bool TurnOn)
 Turns the Rumble On and Off.
 
int EnableAccel ()
 Enables accelerometer.
 
int DisableAccel ()
 Disables accelerometer.
 
int SetIrSensitivity (const wclWiiRemoteIrSensitivity Sensitivity)
 Sets IR IR sensor sensitivity (and turns it ON or OFF).
 
__int64 GetAddress () const
 Gets a remote device MAC address.
 
 __declspec (property(get=GetAddress)) __int64 Address
 Gets a remote device MAC address.
 
bool GetAccelEnabled () const
 Gets the current accelerometer status.
 
 __declspec (property(get=GetAccelEnabled)) bool AccelEnabled
 Gets the current accelerometer status.
 
wclWiiRemoteExtension GetExtension () const
 Gets the current connected extension type.
 
 __declspec (property(get=GetExtension)) wclWiiRemoteExtension Extension
 Gets the current connected extension type.
 
wclWiiRemoteIrMode GetIrMode () const
 Gets the current IR sensor mode.
 
 __declspec (property(get=GetIrMode)) wclWiiRemoteIrMode IrMode
 Gets the current IR sensor mode.
 
wclWiiRemoteIrSensitivity GetIrSensitivity () const
 Gets the current IR sensor sensitivity.
 
 __declspec (property(get=GetIrSensitivity)) wclWiiRemoteIrSensitivity IrSensitivity
 Gets the current IR sensor sensitivity.
 
wclWiiRemoteLeds GetLeds () const
 Gets the current LEDs state.
 
 __declspec (property(get=GetLeds)) wclWiiRemoteLeds Leds
 Gets the current LEDs state.
 
CwclBluetoothRadioGetRadio () const
 Gets the connection owner.
 
 __declspec (property(get=GetRadio)) CwclBluetoothRadio *Radio
 Gets the connection owner.
 
bool GetRumble () const
 Gets the current Rumble status.
 
 __declspec (property(get=GetRumble)) bool Rumble
 Gets the current Rumble status.
 
__event void OnAccelChanged (void *Sender, const wclWiiRemoteAccel &Accel)
 The event fires when the accelerometer state has been changed.
 
__event void OnBalanceBoardChanged (void *Sender, const wclWiiRemoteBalanceBoard &Board)
 The event fires when the stat eof the Balance Board extension has been changed.
 
__event void OnButtonsChanged (void *Sender, const wclWiiRemoteButtons &Buttons)
 The event fires when the buttons state of the Wii Remote controller has been changed.
 
__event void OnClassicControllerChanged (void *Sender, const wclWiiRemoteClassicController &Controller)
 The event fires when a Classic Controller extension state has been changed.
 
__event void OnDrumsChanged (void *Sender, const wclWiiRemoteDrums &Drums)
 The event fires when the Drums extension state has been changed.
 
__event void OnExtensionAttached (void *Sender)
 The event fires when the extension is attached.
 
__event void OnExtensionDetached (void *Sender)
 The event fires when the extension has been detached.
 
__event void OnGuitarChanged (void *Sender, const wclWiiRemoteGuitar &Guitar)
 The event fires when the Guitar extension state has been changed.
 
__event void OnIrChanged (void *Sender, const wclWiiRemoteIrSensors &Ir)
 The event fires when the IR sensor data has been changed.
 
__event void OnNunchukChanged (void *Sender, const wclWiiRemoteNunchuk &Nunchuk)
 The event fires when the state of the Nunchuk extension has been changed.
 
__event void OnStatusChanged (void *Sender, const double Batt, const wclWiiRemoteLeds &Leds)
 The event fires when the WeDo Remote status changed.
 
- Public Member Functions inherited from CwclClientConnection
 CwclClientConnection ()
 Creates a new client connection.
 
virtual ~CwclClientConnection ()
 Frees the connection.
 
int Connect (const unsigned long Timeout=10000)
 Connects to a remote device.
 
int Disconnect ()
 Disconnects from the connected remote device.
 
wclClientState GetState () const
 Gets the connection state.
 
 __declspec (property(get=GetState)) wclClientState State
 Gets the connection state.
 
unsigned long GetTimeout () const
 Gets the connect timeout value.
 
 __declspec (property(get=GetTimeout)) unsigned long Timeout
 Gets the connect timeout value.
 
__event void OnConnect (void *Sender, const int Error)
 The event fires when a connection to a remote device has been completed (with or without success).
 
__event void OnDisconnect (void *Sender, const int Reason)
 The event fires when the remote connected device has been disconnected.
 
- Public Member Functions inherited from CwclCustomConnection
 CwclCustomConnection ()
 Creates a new connection.
 
virtual ~CwclCustomConnection ()
 Frees the connection.
 
CwclMessageReceiverGetReceiver () const
 Gets the connection message receiver object.
 
 __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver
 Gets the connection message receiver object.
 
DWORD GetThreadId () const
 Gets the connection's thread ID.
 
 __declspec (property(get=GetThreadId)) DWORD ThreadId
 Gets the connection's thread ID.
 

Protected Member Functions

virtual int HalConnect (const HANDLE Event) override
 Connects to the Wii Remote as to HID device.
 
virtual int HalCommunicate (const HANDLE Event) override
 Communicates with the Wii Remote as with HID device.
 
virtual int HalDisconnect () override
 Disconnects from the Wii Remote as from HID device.
 
virtual int HalWrite (const unsigned char *const Report, const unsigned char Size) override
 Sends data to the Wii Remote as to HID device.
 
- Protected Member Functions inherited from CwclWiiRemoteClientConnection
void ProcessReport (const unsigned char *const Report)
 The function parses the received report.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The method called when a new notification message received.
 
virtual int HalConnect (const HANDLE Event) override
 Implements a hardware-dependent code that connects to a remote device.
 
virtual int HalDisconnect () override
 Implements a hardware-dependent code that disconnects from the connected remote device.
 
virtual int HalWrite (const unsigned char *const Report, const unsigned char Size)=0
 Implements a hardware-dependent code that writes data report to the connected Wii Remote controller.
 
virtual void DoAccelChanged (const wclWiiRemoteAccel &Accel)
 Fire the OnAccelChanged event.
 
virtual void DoBalanceBoardChanged (const wclWiiRemoteBalanceBoard &Board)
 Fires the OnBalanceBoardChanged event.
 
virtual void DoButtonsChanged (const wclWiiRemoteButtons &Buttons)
 Fires the OnButtonsChanged event.
 
virtual void DoClassicControllerChanged (const wclWiiRemoteClassicController &Controller)
 Fires the OnClassicControllerChanged event.
 
virtual void DoConnect (const int Error)
 Fires the OnConnect event.
 
virtual void DoDisconnect (const int Reason)
 Fires the OnDisconnect event.
 
virtual void DoDrumsChanged (const wclWiiRemoteDrums &Drums)
 Fires the OnDrumsChanged event.
 
virtual void DoExtensionAttached ()
 Fires the OnExtensionAttached event.
 
virtual void DoExtensionDetached ()
 Fires the OnExtensionDetached event.
 
virtual void DoGuitarChanged (const wclWiiRemoteGuitar &Guitar)
 Fires the OnGuitarChanged event.
 
virtual void DoIrChanged (const wclWiiRemoteIrSensors &Ir)
 Fires the OnIrChanged event.
 
virtual void DoNunchukChanged (const wclWiiRemoteNunchuk &Nunchuk)
 Fires the OnNunchukChanged event.
 
virtual void DoStatusChanged (const double Batt, const wclWiiRemoteLeds &Leds)
 Fires the OnStatusChanged event.
 
HANDLE GetDisconnectEvent () const
 Gets the disconnect event object.
 
 __declspec (property(get=GetDisconnectEvent)) HANDLE DisconnectEvent
 Gets the disconnect event object.
 
- Protected Member Functions inherited from CwclClientConnection
void InternalDisconnect (const int Reason)
 The internal disconnect method. Disconnects from a connected remote device.
 
void NotifyClosed (const int Reason)
 Send a Disconnect notification message.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The message receiver calls this method when a new notification message has been received.
 
virtual void DoConnect (const int Error)
 Fires the OnConnect event.
 
virtual void DoDisconnect (const int Reason)
 Fires the OnDisconnect event.
 
virtual int HalCommunicate (const HANDLE Event)
 Implements a hardware-dependent code that communicate with the connected remote device.
 
virtual int HalConnect (const HANDLE Event)=0
 Implements a hardware-dependent code that connects to a remote device.
 
virtual int HalDisconnect ()=0
 Implements a hardware-dependent code that disconnects from the connected remote device.
 
- Protected Member Functions inherited from CwclCustomConnection
virtual void MessageReceived (const CwclMessage *const Message)
 The message receiver calls this method when a new notification message has been received.
 
void Enter ()
 Enters the connection's critical section.
 
void Leave ()
 Exists *leaves) the connection's critical section.
 

Detailed Description

The virtual connection represents a Wii Remote HID client.

The class provides methods to receive data from the Wii Remote controller.

An application must never create instances of this class directly. Instead of that an application must use related methods from the CwclBluetoothRadio object.

The feature is supported only on Windows 10 platform with Microsoft Bluetooth drivers.

See also
CwclBluetoothRadio, CwclWiiRemoteClientConnection