Example #1
0
def ProcessTM(self):
    if self.messageReceivedType == i_transaction:
        print "\n" + chr(
            27) + "[32m" + "Received Telemetry: transaction" + chr(
                27) + "[0m\n"
        backup = self._pMem
        # Read the data for param amount
        var_amount = dataview_uniq_asn.Amount()
        var_amount.SetData(self._pMem)
        print "Parameter amount:"
        var_amount.PrintAll()
        print
        # self._pMem = DV.MovePtrBySizeOf_Amount(self._pMem)
        # Revert the pointer to start of the data
        self._pMem = backup
    if self.messageReceivedType == i_display:
        print "\n" + chr(27) + "[32m" + "Received Telemetry: display" + chr(
            27) + "[0m\n"
        backup = self._pMem
        # Read the data for param msg
        var_msg = dataview_uniq_asn.MyString()
        var_msg.SetData(self._pMem)
        print "Parameter msg:"
        var_msg.PrintAll()
        print
        # self._pMem = DV.MovePtrBySizeOf_MyString(self._pMem)
        # Revert the pointer to start of the data
        self._pMem = backup
    if self.messageReceivedType == i_eject_card:
        print "\n" + chr(27) + "[32m" + "Received Telemetry: eject_card" + chr(
            27) + "[0m\n"
        backup = self._pMem
        # Read the data for param w
        var_w = dataview_uniq_asn.MyString()
        var_w.SetData(self._pMem)
        print "Parameter w:"
        var_w.PrintAll()
        print
        # self._pMem = DV.MovePtrBySizeOf_MyString(self._pMem)
        # Revert the pointer to start of the data
        self._pMem = backup
    if self.messageReceivedType == i_out_msg:
        print "\n" + chr(27) + "[32m" + "Received Telemetry: out_msg" + chr(
            27) + "[0m\n"
        backup = self._pMem
        # Read the data for param msg
        var_msg = dataview_uniq_asn.MyString()
        var_msg.SetData(self._pMem)
        print "Parameter msg:"
        var_msg.PrintAll()
        print
        # self._pMem = DV.MovePtrBySizeOf_MyString(self._pMem)
        # Revert the pointer to start of the data
        self._pMem = backup
Example #2
0
def decode_uPER(uPER_encodedBuffer):
    ''' Decode an uPER buffer and place it in a native Asn1Scc type  '''

    # Create a stream buffer, put the encoded data inside it, and decode it
    buffer = ASN1.DataStream(DV.MyString_REQUIRED_BYTES_FOR_ENCODING)
    buffer.SetFromPyString(uPER_encodedBuffer)
    decoded_value = ASN1.MyString()
    decoded_value.Decode(buffer)
    return decoded_value
def ProcessTM(self):
    if self.messageReceivedType == i_outmsg:
        print "\n"+chr(27)+"[32m" + "Received Telemetry: outmsg" + chr(27) + "[0m\n"
        backup = self._pMem
        # Read the data for param msg
        var_msg = dataview_uniq_asn.MyString()
        var_msg.SetData(self._pMem)
        print "Parameter msg:"
        var_msg.PrintAll()
        print
        # self._pMem = DV.MovePtrBySizeOf_MyString(self._pMem)
        # Revert the pointer to start of the data
        self._pMem = backup
Example #4
0
def typeInstance():
    # Create an intance of an ASN.1 ctype
    return ASN1.MyString()
Example #5
0
def decode_TM(rawTM):
    ''' Decode a msgQ message (native encoding) '''
    tm = ASN1.MyString()
    tm.SetData(rawTM)
    return tm