xhid_open   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/hid.xtm

Implementation

;; in's are 0x80
;; out's are 0x90
(bind-func xhid_open
  (lambda (vendor_id:i64 product_id:i64 interface:i32)
    (let ((stdout (fdopen 0 "w"))
          (stderr (fdopen 1 "w"))
          (hid:HIDInterface* null)
          (ret:hid_return 0)
          ;; (vendor_id #x046d)
          ;; (product_id #xc408)
          (iface_num interface)
          (matcher (HIDInterfaceMatcher (convert vendor_id)
                                        (convert product_id)
                                        null null 0)))
      (hid_set_debug (convert (bor #x1 #x2)))
      (hid_set_debug_stream stderr)
      (println "vendor id:" vendor_id "product id:" product_id)
      (set! ret (hid_init))
      (if (<> ret 0) (printf "%d,%s\n" ret (hid_strerror ret)))
      (set! hid (hid_new_HIDInterface))
      (printf "HID: %p\n" hid)
      (set! ret (hid_force_open hid iface_num matcher 3))
      (if (<> ret 0) (printf "%d,%s\n" ret (hid_strerror ret)))
      (set! ret (hid_write_identification stdout hid))
      (if (<> ret 0) (printf "%s\n" (hid_strerror ret)))
      (set! ret (hid_dump_tree stdout hid))
      (if (<> ret 0) (printf "%s\n" (hid_strerror ret)))
      hid)))


Back to Index

Similar Entries

  • fits-open-file    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/fitslib.xtm
  • fits-open-file    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/fits.xtm
  • gui_set_monokai_opensans_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • nvg_load_opensans_fonts    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanovg.xtm
  • ocv_isopen    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • ocv_isopen    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • ocv_scheme_isopen_object    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/shadowmap.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/multilight.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/shaderlight.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • opengl-test    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/fluid_dynamics.xtm
  • opengl-test    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/horde3d_knight.xtm
  • opengl-test    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • opengl-test    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/bullet.xtm
  • sys_file_open    xtlang    /digego/extempore/tree/v0.8.9/libs/external/system.xtm
  • sys_file_open_stderr    xtlang    /digego/extempore/tree/v0.8.9/libs/external/system.xtm
  • sys_file_open_stdin    xtlang    /digego/extempore/tree/v0.8.9/libs/external/system.xtm
  • sys_file_open_stdout    xtlang    /digego/extempore/tree/v0.8.9/libs/external/system.xtm
  • xhid_close    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/hid.xtm
  • xhid_dump    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/hid.xtm
  • xhid_listener    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/hid.xtm
  • xhid_read    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/hid.xtm