Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. device.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize)
  2.  
  3. +--------------------- Report type
  4. | +------------------ Weight Stable (tray not moving)
  5. | | +--------------- grams (not pounds)
  6. | | | +------------ whatever
  7. | | | | +--------- 2 grams
  8. | | | | | +------ 0 x 256 grams
  9. | | | | | |
  10. V V V V V V
  11. [3, 4, 2, 0, 2, 0]
  12.  
  13. # ep_out.write('x07x04x02x00x00x00', 6)
  14. ep_out.write([0x07, 0x04, 0x02, 0x00, 0x00, 0x00], 6)
  15.  
  16. handle = hid_open(0x7b7c, 0x301, NULL);
  17. buf[0] = 0x07;
  18. buf[1] = 0x04;
  19. buf[2] = 0x02;
  20. res = hid_write(handle, buf, 3);
  21.  
  22. h = hid.device()
  23. h.open(0x7b7c, 0x301)
  24.  
  25. print("Manufacturer: %s" % h.get_manufacturer_string())
  26. print("Product: %s" % h.get_product_string())
  27. print("Serial No: %s" % h.get_serial_number_string())
  28.  
  29. res = h.write([0x07, 0x04, 0x02, 0,0,0])
  30.  
  31. res = h.write([0x07, 0x04, 0x02, 0,0,0])
  32. res = h.write([0x07, 0x04, 0x02, 0,0,0])
  33. res = h.write([0x07, 0x04, 0x02, 0,0,0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement