def send(self, line):
        '''send some bytes'''
        line = line.strip()
        if line == ".":
            self.stop()
            return
        mav = self.master.mav
        if line != '+++':
            line += "\r\n"
        buf = [ord(x) for x in line]
        buf.extend([0]*(70-len(buf)))

        flags = mavutil.mavlink.SERIAL_CONTROL_FLAG_RESPOND
        flags |= mavutil.mavlink.SERIAL_CONTROL_FLAG_MULTI
        flags |= mavutil.mavlink.SERIAL_CONTROL_FLAG_EXCLUSIVE
        mav.serial_control_send(self.serial_settings.port,
                                flags,
                                0, self.serial_settings.baudrate,
                                len(line), buf)
def send ( self , line ) : line = line . strip ( ) if line == "." : self . stop ( ) return mav = self . master . mav if line != '+++' : line += "\r\n" buf = [ ord ( x ) for x in line ] buf . extend ( [ 0 ] * ( 70 - len ( buf ) ) ) flags = mavutil . mavlink . SERIAL_CONTROL_FLAG_RESPOND flags |= mavutil . mavlink . SERIAL_CONTROL_FLAG_MULTI flags |= mavutil . mavlink . SERIAL_CONTROL_FLAG_EXCLUSIVE mav . serial_control_send ( self . serial_settings . port , flags , 0 , self . serial_settings . baudrate , len ( line ) , buf )
send some bytes