Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(19)  |  Call(16)  |  Derive(0)  |  Import(3)
A packet that can be sent via the CRTP.

src/c/r/crazyflie-clients-python-HEAD/lib/cflib/crtp/radiodriver.py   crazyflie-clients-python(Download)
 
from cflib.crtp.crtpdriver import CRTPDriver
from .crtpstack import CRTPPacket
from .exceptions import WrongUriType
import threading
            # next packet to send is prepared
            if (len(data) > 0):
                inPacket = CRTPPacket(data[0], list(data[1:]))
                # print "<- " + inPacket.__str__()
                self.in_queue.put(inPacket)

src/c/r/crazyflie-clients-python-HEAD/lib/cflib/crtp/debugdriver.py   crazyflie-clients-python(Download)
from threading import Thread
from .crtpdriver import CRTPDriver
from .crtpstack import CRTPPacket, CRTPPort
from .exceptions import WrongUriType
import Queue
    def _handle_bootloader(self, pk):
        cmd = pk.datal[1]
        if (cmd == 0x10):  # Request info about copter
            p = CRTPPacket()
            p.set_header(0xFF, 0xFF)
            [page, addr] = struct.unpack('<HH', p.data[0:4])
        elif (cmd == 0x18):  # Flash page
            p = CRTPPacket()
            p.set_header(0xFF, 0xFF)
            p.data = struct.pack('<BBH', 0xFF, 0x18, 1)
            cmd = struct.unpack("B", pk.data[0])[0]
            if (cmd == 0):  # Reqest variable info
                p = CRTPPacket()
                p.set_header(pk.port, 0)
                varIndex = 0
                logger.info("TOC[%d]: Requesting TOC CRC, sending back fake"
                            " stuff: %d", pk.port, len(self.fakeLogToc))
                p = CRTPPacket()
                p.set_header(pk.port, 0)
                p.data = struct.pack('<BBIBB', 1, tocLen, fakecrc, 16, 24)

src/c/r/crazyflie-clients-python-HEAD/lib/cflib/crtp/udpdriver.py   crazyflie-clients-python(Download)
 
from .crtpdriver import CRTPDriver
from .crtpstack import CRTPPacket
from .exceptions import WrongUriType
import Queue
        if data:
            data = struct.unpack('b' * (len(data) - 1), data[0:len(data) - 1])
            pk = CRTPPacket()
            pk.port = data[0]
            pk.data = data[1:]