bool result = NativeMethods.WriteFile(_handle, ptr + offset0, Math.Min(minOut, count), IntPtr.Zero, overlapped) NativeMethods.HidD_SetOutputReport(_handle, _writeBuffer, 33)
Var overlapped = stackalloc NativeOverlapped Public static extern bool HidD_SetOutputReport(IntPtr handle, byte lpReportBuffer, int ReportBufferLength) So I added this function to nativemethods. But set/get feature from the same dll is there. The latter one is not among the ones exposed in nativemethods. Using an googling around using the above discoveries, I found that microsoft advertises two methods to write to usb hid Writefile and HidD_SetOutputReport from hid.dll & (x.ProductID = 0x150 || x.ProductID = 0x967)) Ĭonsole.WriteLine("Found portal usb devices:") Ĭonsole.WriteLine($"\t") If anyone has a clue or suggestion on what to try next? That would be appreciated. Any further write messages give the same result After that I am buried in status output from the portal but nothing else. The first write failure occurs on the call to restartportal.
#Skylanders portal usb receiver code#
No reason for it to work using the original cpp code and not thru HidSharp. I must be missing something silly I think. I converted portalIO.cpp to the C# code below. I'm no usb export and have little clue why this happens.
#Skylanders portal usb receiver windows#
On my linux laptop its and I/O exception hardcoded in the output source code of hidsharp and on windows its a timeout exception. * However the write errors out with an exception. * As soon as this is send out the portal starts sending status messages which I receive continuously. Basically report Zero and the letter R, the rest all zeros. * I then try to send the "restart" message. * I can detect the portal just fine and get the device.
This tool SkyDumper works on my linux computer, but when I try to convert it to hidsharp it won't work. This is an USB Hid device and the "protocol" is quite simple or so it appears from SKyDumper project ( h**ps:///capull0/SkyDumper). Additionally, with the freedom to change characters whenever they like, Skylanders Spyro’s Adventure allows kids to utilize different interaction figures and strategies each time they play.For fun I wanted to to play around with the skylander rfid portal. For the first time ever, players can personally customize and power-up their toys, as well as bring them to life on a friend’s Portal of Power for co-op play and player-versus-player arena battles. Skylanders Spyro’s Adventure changes the way we look at toys and videogames, as well as how we interact with them by introducing action figures that become interaction figures and remember all of their dynamic experiences created in the game. Players will embark on a fantastical journey into an amazing world, where they will explore mysterious, mythical lands, battle menacing outlandish creatures, collect gold and treasures, and solve interesting puzzles while on a quest to save their world from Kaos, an evil Portal Master. In Skylanders Spyros Adventure players take on the role of a powerful Portal Master who can control over 30 different characters, including the beloved fire-breathing dragon Spyro.