Problem with crazyradio.send_packet()

Firmware/software/electronics
Post Reply
e-Rok
Beginner
Posts: 25
Joined: Fri Sep 12, 2014 4:30 pm

Problem with crazyradio.send_packet()

Post by e-Rok »

Hi,
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
After the else statement, self.handle.write() and self.handle.read() should have 3 inputs (4 including self).
Post Reply