# HID++ 2.0 ping to the device on receiver slot 1 (root feature, getProtocolVersion). Add-Type -Path (Join-Path $PSScriptRoot 'Hidpp.cs') $rx = New-Object HidppReceiver (, [HidppReceiver]::Find('vid_046d&pid_c539')) try { while ($rx.Next(0)) {} $rx.Send([byte[]](0x10,0x01,0x00,0x1A,0x00,0x00,0x5A)) $deadline = (Get-Date).AddSeconds(3) while ((Get-Date) -lt $deadline) { $r = $rx.Next(200) if (-not $r) { continue } "rx " + [HidppReceiver]::Hex($r) if ($r[1] -eq 0x01 -and $r[2] -eq 0x00 -and $r[6] -eq 0x5A) { "Mouse answered: HID++ {0}.{1} - link is UP" -f $r[4], $r[5]; return } if ($r[1] -eq 0x01 -and $r[2] -eq 0x8F) { "Error from slot 1 (code 0x{0:X2}) - mouse not reachable" -f $r[5]; return } } "No answer from slot 1" } finally { $rx.Dispose() }