4 Replies Latest reply on Sep 9, 2020 7:38 AM by FrPo_1282226

    wValue in USB HID read call

    FrPo_1282226

      Hello experts,

      we designed a medical-grade unit using the PSoC 5LP.

       

      in order to do this and to keep the compatibility with the previous software, we had to use the Endpoint EP0 and EP1.

      and after some trouble, we managed to get both of them working.

      We have one last question to answer (keep in mind that the end product is medical).

      in order to  read and write to the HID report , we had to set the wValue for the following call to 0x200. (see code below)

      while the original code was 0x2. Do you know what this "magic number" does?

      I have tried to read the USB HID specs, but it is not clear at all to me.

       

      def hid_set_report(self,report):

      #implement HID set reports via USB control transfer

      self.dev.ctrl_transfer(

      0x21, #REQUEST_TYPE_CLASS | RECIPIENT_INTERFACE | ENDPOINT OUT

      9, # SET_REPORT

      0x200,0x00,

      report

      )

       

       

      def hid_get_report(self):

      #implement HIG GetReport via USB control transfer

      return self.dev.ctrl_transfer(

      0xA1, # REQUEST_TYPE_CLASS | RECIPIENT_INTERFACE | ENDPOINT_IN

      1, # GET REPORT

      0x200,0x00,

      8)

       

       

       

      Thank you!

      Francesco