gorevremote

package module
v0.0.0-...-4a1c9db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 8 Imported by: 0

README

goRevRemote

Go Package to connect and use Wii Remotes as input devices on Windows systems.

Documentation

Index

Constants

View Source
const (
	REV_MODE_CORE_BUTTONS                                 = 0x30
	REV_MODE_CORE_BUTTONS_ACCELEROMETER                   = 0x31
	REV_MODE_CORE_BUTTONS_8_EXTENSION                     = 0x32
	REV_MODE_CORE_BUTTONS_ACCELEROMETER_12_IR             = 0x33
	REV_MODE_CORE_BUTTONS_19_EXTENSION                    = 0x34
	REV_MODE_CORE_BUTTONS_ACCELEROMETER_16_EXTENSION      = 0x35
	REV_MODE_CORE_BUTTONS_10_IR_9_EXTENSION               = 0x36
	REV_MODE_CORE_BUTTONS_ACCELEROMETER_10_IR_6_EXTENSION = 0x37
	REV_MODE_21_EXTENSION                                 = 0x3d
	REV_MODE_INTERLEAVED_BUTTONS_ACCELEROMETER_36_IR_A    = 0x3e
	REV_MODE_INTERLEAVED_BUTTONS_ACCELEROMETER_36_IR_B    = 0x3f //SAME AS A. Data comes in two Reports.
)
View Source
const (
	IR_INIT_UNKNOWN irState = iota
	IR_INIT_READY
	IR_INIT_GOOD
)
View Source
const AVOID_REMOVE_IN_MICROSECOUNDS = 5000000 //5 secounds
View Source
const BLUETOOTH_SERVICE_ENABLE = 1
View Source
const VENDOR_ID_NITENDO = 0x57e
View Source
const WII_NORMAL_NAME = "Nintendo RVL-CNT-01"
View Source
const WII_NORMAL_PID = 0x0306
View Source
const WII_PLUS_NAME = "Nintendo RVL-CNT-01-TR"
View Source
const WII_PLUS_PID = 0x0330

Variables

This section is empty.

Functions

func BluetoothFindDeviceClose

func BluetoothFindDeviceClose(hFind int) (bOk bool)

func BluetoothFindFirstDevice

func BluetoothFindFirstDevice(pbtsp *BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi *BLUETOOTH_DEVICE_INFO) (hFind int)

func BluetoothFindFirstRadio

func BluetoothFindFirstRadio(pbtfrp *BLUETOOTH_FIND_RADIO_PARAMS, phRadio *windows.Handle) (hFind int)

func BluetoothFindNextDevice

func BluetoothFindNextDevice(hFind int, pbtdi *BLUETOOTH_DEVICE_INFO) (bOK bool)

func BluetoothFindNextRadio

func BluetoothFindNextRadio(hFind int, phRadio *windows.Handle) (bOK bool)

func BluetoothFindRadioClose

func BluetoothFindRadioClose(hFind int) (bOK bool)

func BluetoothGetRadioInfo

func BluetoothGetRadioInfo(phRadio windows.Handle, pRadioInfo *BLUETOOTH_RADIO_INFO) (err error)

func BluetoothRemoveDevice

func BluetoothRemoveDevice(pAddress *BLUETOOTH_ADDRESS) (err error)

func BluetoothSetServiceState

func BluetoothSetServiceState(hRadio windows.Handle, pbtdi *BLUETOOTH_DEVICE_INFO, pGuidService *GUID, dwServiceFlags int) (err error)

func Init

func Init() error

Types

type BLUETOOTH_ADDRESS

type BLUETOOTH_ADDRESS struct {
	Ulllong uint64
}

type BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS

type BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS struct {
	DeviceInfo                 BLUETOOTH_DEVICE_INFO
	AuthenticationMethod       uint32
	IOCapabilities             uint32
	AuthenticationRequirements uint32
	Passkey                    uint32
}

type BLUETOOTH_DEVICE_INFO

type BLUETOOTH_DEVICE_INFO struct {
	Address       BLUETOOTH_ADDRESS
	ClassOfDevice uint32
	Connected     int32
	Remebered     int32
	Authenticated int32
	LastSeen      SYSTEMTIME
	LastUsed      SYSTEMTIME
	// contains filtered or unexported fields
}

func InstallWiiRemotes

func InstallWiiRemotes(iRadio windows.Handle) ([]*BLUETOOTH_DEVICE_INFO, error)

func (*BLUETOOTH_DEVICE_INFO) IsWiiRemote

func (oDevice *BLUETOOTH_DEVICE_INFO) IsWiiRemote() bool

func (*BLUETOOTH_DEVICE_INFO) Name

func (oDevice *BLUETOOTH_DEVICE_INFO) Name() string

func (*BLUETOOTH_DEVICE_INFO) ToRemote

func (oDevice *BLUETOOTH_DEVICE_INFO) ToRemote() (*RevRemote, error)

type BLUETOOTH_DEVICE_SEARCH_PARAMS

type BLUETOOTH_DEVICE_SEARCH_PARAMS struct {
	ReturnAuthenticated int32
	ReturnRemembered    int32
	ReturnUnknown       int32
	ReturnConnected     int32
	IssueInquiry        int32
	TimeoutMultiplier   uint8
	Radio               windows.Handle
	// contains filtered or unexported fields
}

type BLUETOOTH_FIND_RADIO_PARAMS

type BLUETOOTH_FIND_RADIO_PARAMS struct {
	// contains filtered or unexported fields
}

func MakeFindRadioParams

func MakeFindRadioParams() *BLUETOOTH_FIND_RADIO_PARAMS

type BLUETOOTH_OOB_DATA_INFO

type BLUETOOTH_OOB_DATA_INFO struct {
	C [16]uint8
	R [16]uint8
}

type BLUETOOTH_RADIO_INFO

type BLUETOOTH_RADIO_INFO struct {
	Address BLUETOOTH_ADDRESS

	ClassofDevice uint64
	Subversion    uint16
	Manufacturer  uint16
	// contains filtered or unexported fields
}

func MakeRadioInfo

func MakeRadioInfo() *BLUETOOTH_RADIO_INFO

func (*BLUETOOTH_RADIO_INFO) Name

func (oRadio *BLUETOOTH_RADIO_INFO) Name() string

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data  [8]uint8
}

type IrData

type IrData int
const (
	IR_Data_Format_Basic    IrData = 1
	IR_Data_Format_EXTENDED IrData = 3
	IR_Data_Format_FULL     IrData = 5
)

type IrSens

type IrSens int
const (
	IR_SENSITIVITY_WII_I   IrSens = iota
	IR_SENSITIVITY_WII_II  IrSens = iota
	IR_SENSITIVITY_WII_III IrSens = iota
	IR_SENSITIVITY_WII_IV  IrSens = iota
	IR_SENSITIVITY_WII_V   IrSens = iota
	IR_SENSITIVITY_MARCAN  IrSens = iota
	IR_SENSITIVITY_MAX     IrSens = iota
	IR_SENSITIVITY_HIGH    IrSens = iota
)

type RevRemote

type RevRemote struct {
	Device      *hid.Device
	Rumble      bool
	PlayerNr    uint8
	DataChannel chan *RevRemoteData
	// contains filtered or unexported fields
}

func (*RevRemote) AsyncInitializeIRCamera

func (oRev *RevRemote) AsyncInitializeIRCamera(iSensitivity IrSens, iMode IrData) error

func (*RevRemote) Close

func (oRev *RevRemote) Close()

func (*RevRemote) InterpretPackage

func (oRev *RevRemote) InterpretPackage(data []byte)

func (*RevRemote) InterpretReturn

func (oRev *RevRemote) InterpretReturn(iReport byte, iError byte) error

func (*RevRemote) PollPackage

func (oRev *RevRemote) PollPackage() error

func (*RevRemote) SendData

func (oRev *RevRemote) SendData(p []byte) error

func (*RevRemote) SetPlayerNumber

func (oRev *RevRemote) SetPlayerNumber(iPlayer uint8) error

func (*RevRemote) SetReportMode

func (oRev *RevRemote) SetReportMode(mode uint8, continues bool) error

func (*RevRemote) SetRumble

func (oRev *RevRemote) SetRumble(bActive bool) error

func (*RevRemote) WriteMemory

func (oRev *RevRemote) WriteMemory(iAddress uint32, abData []byte) error

type RevRemoteAccelerometer

type RevRemoteAccelerometer struct {
	X int16
	Y int16
	Z int16
}

func InterpretAccelerometer

func InterpretAccelerometer(X byte, Y byte, Z byte, bX bool, bY bool, bZ bool) *RevRemoteAccelerometer

type RevRemoteButtons

type RevRemoteButtons struct {
	Left  bool
	Right bool
	Down  bool
	Up    bool
	Plus  bool
	Two   bool
	One   bool
	B     bool
	A     bool
	Minus bool
	Home  bool
}

func InterpretButtons

func InterpretButtons(lower byte, upper byte) (*RevRemoteButtons, bool, bool, bool)

type RevRemoteData

type RevRemoteData struct {
	Buttons       *RevRemoteButtons
	Accelerometer *RevRemoteAccelerometer
	IRPoints      [4]*RevRemoteIRDot
}

type RevRemoteIRDot

type RevRemoteIRDot struct {
	X    uint16
	Y    uint16
	Size uint8
}

func InterpretBasicIRMode

func InterpretBasicIRMode(x1, y1, m1, x2, y2, x3, y3, m2, x4, y4 byte) [4]*RevRemoteIRDot

func InterpretExtendedIRMode

func InterpretExtendedIRMode(data [12]byte) [4]*RevRemoteIRDot

type SYSTEMTIME

type SYSTEMTIME struct {
	Year          uint16
	Month         uint16
	DayOfWeek     uint16
	Day           uint16
	Hour          uint16
	Minute        uint16
	Secound       uint16
	MilliSecounds uint16
}

Directories

Path Synopsis
examples
accelerometer command
irpointer command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL