def unpack(self): # Dynamically build fields based on message length self.f = Fields() self.f.add(U1('msgVer')) self.f.add(U1('numTrkChHw')) self.f.add(U1('numTrkChUse')) self.f.add(U1('numConfigBlocks')) # Extract upto this place to read number of config blocks super().unpack() # TODO: Check extra length against numConfigBlocks # TODO: raise on mismatch """ extra_length = len(self.data) - 40 extra_info = int(extra_length / 30) """ # TODO: check nested fields -> unit test for i in range(self.f.numConfigBlocks): self.f.add(U1(f'gnssId_{i}')) self.f.add(U1(f'resTrkCh_{i}')) self.f.add(U1(f'maxTrkCh_{i}')) self.f.add(Padding(1, f'res1_{i}')) self.f.add(X4(f'flags_{i}')) # Bit 0: enable super().unpack()
def __init__(self): super().__init__() self.f.add(X4('bitfield')) # u-blox describes as U4, bit is X4 self.f.add(U4('yaw')) # 1e-2, 0..360° self.f.add(I2('pitch')) # 1e-2, -90..90° self.f.add(I2('roll')) # 1e-2, -180..180°
def __init__(self): super().__init__() self.f.add(U2('version')) self.f.add(X2('mask1')) self.f.add(X4('mask2')) self.f.add(Padding(2, 'res1')) self.f.add(U1('minSVs')) self.f.add(U1('maxSVs')) self.f.add(U1('minCN0')) self.f.add(Padding(1, 'res2')) self.f.add(U1('iniFix3D')) self.f.add(Padding(2, 'res3')) self.f.add(U1('ackAiding')) self.f.add(U2('wknRollover')) self.f.add(U1('sigAttenCompMode')) self.f.add(Padding(1, 'res4')) self.f.add(Padding(2, 'res5')) self.f.add(Padding(2, 'res6')) self.f.add(U1('usePPP')) self.f.add(U1('aopCfg')) self.f.add(Padding(2, 'res7')) self.f.add(U2('aopOrbMaxErr')) self.f.add(Padding(4, 'res8')) self.f.add(Padding(3, 'res9')) self.f.add(U1('useAdr')) self.f.add(Padding(2, 'res10')) self.f.add(Padding(2, 'res11'))
def __init__(self): super().__init__() self.f.add(U1('type')) self.f.add(U1('version')) self.f.add(U1('infoCode')) self.f.add(U1('msgId')) self.f.add(X4('msgPayloadStart'))
def __init__(self): super().__init__() self.f = Fields() self.f.add(U4('timeTag')) self.f.add(X2('flags')) self.f.add(U2('id')) self.f.add(X4('data'))
def __init__(self): super().__init__() self.f.add(X1('filter')) self.f.add(U1('nmeaVersion')) self.f.add(U1('numSV')) self.f.add(X1('flags')) self.f.add(X4('gnssToFilter')) self.f.add(U1('svNumbering')) self.f.add(U1('mainTalkerId')) self.f.add(U1('gsvTalkerId')) self.f.add(U1('version')) self.f.add(CH(2, 'bdsTalkerId')) self.f.add(Padding(6, 'res1'))
def __init__(self): super().__init__() self.f.add(U1('tpIdx')) self.f.add(U1('version')) self.f.add(Padding(2, 'res1')) self.f.add(I2('antCableDelay')) self.f.add(I2('rfGroupDelay')) self.f.add(I4('freqPeriod')) self.f.add(I4('freqPeriodLock')) self.f.add(I4('pulseLenRatio')) self.f.add(I4('pulseLenRatioLock')) self.f.add(I4('userConfigDelay')) self.f.add(X4('flags'))
def __init__(self): super().__init__() self.f.add(X4('clearMask')) self.f.add(X4('saveMask')) self.f.add(X4('loadMask'))