gnd.c 1.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#include <stdio.h>
#include "gnd.h"

void gnd_startup()
{
    /* Write your initialization code here,
       but do not make any call to a required interface. */
}

void gnd_PI_CYCLE()
{
    /* Write your code here! */
    asn1SccMySeq mySeq1, mySeq2;
    asn1SccMyChoice myChoice1, myChoice2;
    asn1SccMyOctStr myOctStr1, myOctStr2;
    asn1SccMySeqOf mySeqOf1, mySeqOf2;

    myOctStr1.arr[0] = 'M';
    myOctStr1.arr[1] = 'P';
    myOctStr1.arr[2] = 'Y';
    gnd_RI_TC_OctStr_NATIVE(&myOctStr1, &myOctStr2);
    printf("got myOctStr2: %c%c%c\n", myOctStr2.arr[0], myOctStr2.arr[1], myOctStr2.arr[2]);

    mySeq1.input_data = 10;
    mySeq1.output_data = 11;
    mySeq1.validity = asn1Sccinvalid;
    gnd_RI_TC_Seq_NATIVE(&mySeq1, &mySeq2);
    printf("got mySeq2: %llu %llu %u\n", mySeq2.input_data, mySeq2.output_data, mySeq2.validity);

    mySeq1.input_data = 20;
    mySeq1.output_data = 21;
    mySeq1.validity = asn1Sccvalid;
    gnd_RI_TC_Seq_UPER(&mySeq1, &mySeq2);
    printf("got mySeq2: %llu %llu %u\n", mySeq2.input_data, mySeq2.output_data, mySeq2.validity);

    mySeqOf1.arr[0] = asn1Scchello;
    mySeqOf1.arr[1] = asn1Sccworld;
    gnd_RI_TC_SeqOf_NATIVE(&mySeqOf1, &mySeqOf2);
    printf("got mySeqOf2: %u %u\n", mySeqOf2.arr[0], mySeqOf2.arr[1]);

    myChoice1.kind = a_PRESENT;
    myChoice1.u.a = 1;
    gnd_RI_TC_Choice_NATIVE(&myChoice1, &myChoice2);
    printf("got myChoice2: kind=%u a=%u\n", myChoice2.kind, myChoice2.u.a);

    myChoice1.kind = b_PRESENT;
    myChoice1.u.b.input_data = 30;
    myChoice1.u.b.output_data = 31;
    myChoice1.u.b.validity = asn1Sccvalid;
    gnd_RI_TC_Choice_NATIVE(&myChoice1, &myChoice2);
    printf("got myChoice2: kind=%u b=(%llu %llu %u)\n", myChoice2.kind, myChoice2.u.b.input_data, myChoice2.u.b.output_data, myChoice2.u.b.validity);
}