コード例 #1
0
ファイル: CFG.py プロジェクト: sergei/pyUBX
            def __init__(self,
                         mask=0,
                         dynMode1=0,
                         fixMode=0,
                         fixedAlt=0,
                         fixedAltVar=0,
                         minElev=0,
                         drLimit=0,
                         pDop=0,
                         tDop=0,
                         pAcc=0,
                         tAcc=0,
                         staticHoldThr=0,
                         dgnssTimeout=0,
                         cnoThreshNumSvs=0,
                         cnoThres=0,
                         staticHoldMaxDist=0,
                         utcStandard=0):
                payload = struct.pack('<HBBlLbBHHHHBBBBBBHBBBBBB', mask,
                                      dynMode1, fixMode, fixedAlt, fixedAltVar,
                                      minElev, drLimit, pDop, tDop, pAcc, tAcc,
                                      staticHoldThr, dgnssTimeout,
                                      cnoThreshNumSvs, cnoThres, 1, 2,
                                      staticHoldMaxDist, utcStandard, 1, 2, 3,
                                      4, 5)

                UBXMessage.__init__(self, CFG._class, CFG.NAV5._id, payload)
コード例 #2
0
ファイル: CFG.py プロジェクト: sergei/pyUBX
            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)
コード例 #3
0
ファイル: CFG.py プロジェクト: windflying720/pyUBX
 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
     )
コード例 #4
0
 def __init__(self, Version=0, Layers=0, Position=0, KeyId=0):
     payload = struct.pack(
         '<BBHI', Version, Layers, Position, KeyId
     )
     UBXMessage.__init__(
         self, CFG._class, CFG.VALGET._id, payload
     )
コード例 #5
0
 def __init__(self, Version=0, Layers=0, KeyId=0, Value=0):
     payload = struct.pack(
         '<BBBBIH', Version, Layers, 0, 0, KeyId, Value
     )
     UBXMessage.__init__(
         self, CFG._class, CFG.VALSET._id, payload
     )
コード例 #6
0
ファイル: CFG.py プロジェクト: tuuzdu/pyUBX
            def __init__(self, navBbrMask=0, resetMode=0):
                payload = struct.pack(
                        '<HBB', navBbrMask, resetMode,0
                    )

                UBXMessage.__init__(
                    self, CFG._class, CFG.RST._id, payload
                )
コード例 #7
0
ファイル: CFG.py プロジェクト: sergei/pyUBX
            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)
コード例 #8
0
ファイル: CFG.py プロジェクト: sergei/pyUBX
            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)