Commit def8f188 authored by Damien George's avatar Damien George

MicroPython: Update demos for change from Ref to Access, .val to .all.

parent 4ee578e8
......@@ -13,28 +13,28 @@ def payload_startup():
def payload_PI_TC_Seq_NATIVE(IN_a: asn1SccMySeq, OUT_b: asn1SccMySeq):
print('TC_Seq_NATIVE')
print(' IN_a:', IN_a)
OUT_b.val.input_data = IN_a.input_data + 10
OUT_b.val.output_data = IN_a.output_data + 10
OUT_b.val.validity = 1 - IN_a.validity
OUT_b.all.input_data = IN_a.input_data + 10
OUT_b.all.output_data = IN_a.output_data + 10
OUT_b.all.validity = 1 - IN_a.validity
def payload_PI_TC_Seq_UPER(IN_a: asn1SccMySeq, OUT_b: asn1SccMySeq):
print('TC_Seq_UPER')
print(' IN_a:', IN_a)
OUT_b.val.input_data = IN_a.input_data + 10
OUT_b.val.output_data = IN_a.output_data + 10
OUT_b.val.validity = 1 - IN_a.validity
OUT_b.all.input_data = IN_a.input_data + 10
OUT_b.all.output_data = IN_a.output_data + 10
OUT_b.all.validity = 1 - IN_a.validity
def payload_PI_TC_OctStr_NATIVE(IN_a: asn1SccMyOctStr, OUT_b: asn1SccMyOctStr):
print('TC_OctStr_NATIVE')
print(' IN_a:', IN_a)
for i in range(len(IN_a)):
OUT_b.val[i] = IN_a[i] + 1
OUT_b.all[i] = IN_a[i] + 1
def payload_PI_TC_SeqOf_NATIVE(IN_a: asn1SccMySeqOf, OUT_b: asn1SccMySeqOf):
print('TC_SeqOf_NATIVE')
print(' IN_a:', IN_a)
for i in range(len(IN_a)):
OUT_b.val[i] = IN_a[i] + 1
OUT_b.all[i] = IN_a[i] + 1
def payload_PI_TC_Choice_NATIVE(IN_a: asn1SccMyChoice, OUT_b: asn1SccMyChoice):
print('TC_Choice_NATIVE')
......@@ -45,4 +45,4 @@ def payload_PI_TC_Choice_NATIVE(IN_a: asn1SccMyChoice, OUT_b: asn1SccMyChoice):
IN_a.b.input_data += 10
IN_a.b.output_data += 10
IN_a.b.validity = 1 - IN_a.b.validity
OUT_b.val = IN_a
OUT_b.all = IN_a
......@@ -21,11 +21,11 @@ def gnd_startup():
# note that without the heap some Python operations are not possible.
global myOctStr1, myOctStr2, mySeq1, mySeq2, mySeqOf1, mySeqOf2
myOctStr1 = asn1SccMyOctStr()
myOctStr2 = Ref(asn1SccMyOctStr())
myOctStr2 = Access(asn1SccMyOctStr())
mySeq1 = asn1SccMySeq()
mySeq2 = Ref(asn1SccMySeq())
mySeq2 = Access(asn1SccMySeq())
mySeqOf1 = asn1SccMySeqOf()
mySeqOf2 = Ref(asn1SccMySeqOf())
mySeqOf2 = Access(asn1SccMySeqOf())
micropython.heap_lock()
def gnd_PI_CYCLE():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment