Search Unity

InputSystem: how to Send Command (bytes) to usb Device?

Discussion in 'Scripting' started by UnitDan, Feb 14, 2020.

  1. UnitDan

    UnitDan

    Joined:
    Feb 4, 2019
    Posts:
    3
    Hey,
    im lost. I simple try to send bytes to usb hid. In unity I get the device via InputSystem. This works fine but how can I send bytes simple as [00, ff, 00,00,00,00,00] out of unity to the controller?

    I found:
    ExecuteCommand<TCommand>(ref TCommand)
    InputDeviceCommand(FourCC type, int sizeInBytes = 8)

    But i dont know how to setup the struct and im not sure if this is the right path... So if anyone can lead me to the right direction or has a code snippet I can use with the inputsystem - this would be awesome.

    Best,
    Daniel
     
  2. UnitDan

    UnitDan

    Joined:
    Feb 4, 2019
    Posts:
    3
    ok. I stoped trying to use the inputSystem and worked out a native language plugin solution which works fine. Anyway this should be an easy task with the inputsystem... but i dont get it inside unity with c#...
     
unityunity