It seems that if pyusb1 is true, then dev.write() takes only 4 parameters. Your code:
Code: Select all
def send_packet(self, dataOut):
""" Send a packet and receive the ack from the radio dongle
The ack contains information about the packet transmition
and a data payload if the ack packet contained any """
ackIn = None
data = None
try:
if (pyusb1 is False):
self.handle.bulkWrite(1, dataOut, 1000)
data = self.handle.bulkRead(0x81, 64, 1000)
else:
self.handle.write(1, dataOut, 0, 1000)
data = self.handle.read(0x81, 64, 0, 1000)
except usb.USBError:
pass