Specifications

65
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 'n':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100000.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
elif MessageFormat[1][ValueNum] == 'e':
try:
for offset in range(0,ValueBytesNum):
ValueBytes.append(ord(BinaryMessage[BytePointer +
offset]))
BytePointer = BytePointer + ValueBytesNum
Value = GLI4toDEC(ValueBytes)/100000.0
DataLine = DataLine + str(Value)
#print ValueBytes, Value
except IndexError:
DataLine = DataLine + '?'
DataLine = DataLine + ','
DataLine = DataLine[:-1] # to remove the trailing comma character
IsDiagnostics = '!D' in DataLine[-5:-3] or MessageFormatNum % 5 ==
4#FIXME: the stats are wrong because we don't always go through here
IsObservations = '!M' in DataLine[-2:] or IsKnownBinaryFormat
IsSummer = ('!S' in DataLine and '!M' in DataLine[-2:]) or
MessageFormatNum % 5 in (0, 1)
IsWinter = ('!W' in DataLine and '!M' in DataLine[-2:]) or
MessageFormatNum % 5 in (2, 3)
IsWithInstant = '!I' in DataLine[-5:-3] or MessageFormatNum % 5 in (1, 3)
if not IsKnownBinaryFormat:
print '%s-%s' %(IMEI, MOMSN),
if IsDiagnostics: print '(ascii) generic diagnostic message',
elif IsObservations and IsSummer:print '(ascii) generic summer
observations message',