MCPcopy
hub / github.com/axi0mX/ipwndfu / send_data

Function send_data

dfu.py:43–49  ·  view source on GitHub ↗
(device, data)

Source from the content-addressed store, hash-verified

41 #print 'Caught exception during port reset; should still work.'
42
43def send_data(device, data):
44 #print 'Sending 0x%x of data to device.' % len(data)
45 index = 0
46 while index < len(data):
47 amount = min(len(data) - index, MAX_PACKET_SIZE)
48 assert device.ctrl_transfer(0x21, 1, 0, 0, data[index:index + amount], 5000) == amount
49 index += amount
50
51def get_data(device, amount):
52 #print 'Getting 0x%x of data from device.' % amount

Callers

nothing calls this directly

Calls 1

ctrl_transferMethod · 0.45

Tested by

no test coverage detected