User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
code:sub2r-lib [2022/08/30 18:48] – [UFix_8_8] Igor Yefmovcode:sub2r-lib [2022/09/10 20:39] (current) – [Basic "vendor request" call] Igor Yefmov
Line 11: Line 11:
  
 ===== Basic "vendor request" call ===== ===== Basic "vendor request" call =====
 +
 +SUB2r API calls are implemented as USB "vendor request" commands, where ''USB_SETUP_PACKET::bmRequest::Type'' is set to ''2'', following the USB specification.
  
 Sample usage: Sample usage:
Line 19: Line 21:
     array<std::byte, 4> vi{};     array<std::byte, 4> vi{};
     const auto rc{m_fx3.vrCmd(Fx3Cmd::fx3_version // vendor request command     const auto rc{m_fx3.vrCmd(Fx3Cmd::fx3_version // vendor request command
-                              , VrCmdOpType::read // read from device +                            , VrCmdOpType::read   // read from device 
-                              , 0                 // "value" +                            , 0                   // "value" 
-                              , 0                 // "index" +                            , 0                   // "index" 
-                              , vi)};             // buffer to read into+                            , vi)};               // buffer to read into
     return vi;                                    // 32 bits of the "version info" (4 bytes)     return vi;                                    // 32 bits of the "version info" (4 bytes)
 } }

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information