def __init__(self, powerSetupValue=1, period=0, onTime=0): payload = struct.pack( '<BBhhBB', 0, powerSetupValue, period, onTime, 0, 0 ) UBXMessage.__init__( self, CFG._class, CFG.PMS._id, payload )
def __init__(self, navBbrMask=0, resetMode=0): payload = struct.pack( '<HBB', navBbrMask, resetMode,0 ) UBXMessage.__init__( self, CFG._class, CFG.RST._id, payload )
def __init__(self, ser, debug=False): """Instantiate with serial.""" from UBXMessage import UBXMessage threading.Thread.__init__(self) self.ser = ser self.debug = debug self._shutDown = False self.ubx_chksum = UBXMessage.Checksum()
def __init__(self, filterFlags=0, nmeaVersion=0, numSV=0, flags=0, gnssToFilter=0, svNumbering=0, mainTalkerId=0, gsvTalkerId=0, version=0, bdsTalkerId_1=0, bdsTalkerId_2=0): payload = struct.pack('<BBBBLBBBBBBBBBBBB', filterFlags, nmeaVersion, numSV, flags, gnssToFilter, svNumbering, mainTalkerId, gsvTalkerId, version, bdsTalkerId_1, bdsTalkerId_2, 1, 2, 3, 4, 5, 6) UBXMessage.__init__(self, CFG._class, CFG.NMEA._id, payload)
def __init__(self, cfgBlocks): msgVer = 0 numTrkChHw = 0x20 # R/O anyway numTrkChUse = 0x20 numConfigBlocks = len(cfgBlocks) payload = bytearray(4 + 8 * numConfigBlocks) offset = 0 struct.pack_into('<BBBB', payload, offset, msgVer, numTrkChHw, numTrkChUse, numConfigBlocks) offset += 4 for cfg_block in cfgBlocks: struct.pack_into('<BBBBI', payload, offset, cfg_block['gnssId'], cfg_block['resTrkCh'], cfg_block['maxTrkCh'], 0, cfg_block['flags']) offset += 8 UBXMessage.__init__(self, CFG._class, CFG.GNSS._id, payload)
def __init__(self, msgClass=0, msgId=0, rate=None, rateI2C=None, rateUART1=None, rateUSB=None, rateSPI=None): if rate: # Set message rate configuration for the current port. payload = struct.pack( '<BBB', msgClass, msgId, rate, ) elif rateI2C: # Set message rate configuration for all ports. if not rateUART1: raise ValueError('rateUART1 is not specified') if not rateUSB: raise ValueError('rateUSB is not specified') if not rateSPI: raise ValueError('rateSPI is not specified') payload = struct.pack( '<BBBBBBBB', msgClass, msgId, rateI2C, rateUART1, 0, rateUSB, rateSPI, 0 ) else: # Poll request payload = struct.pack( '<BB', msgClass, msgId ) UBXMessage.__init__( self, CFG._class, CFG.MSG._id, payload )