Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

Unsure on adding choice #12

Closed
danfletcher1 opened this issue Aug 1, 2018 · 1 comment
Closed

Unsure on adding choice #12

danfletcher1 opened this issue Aug 1, 2018 · 1 comment

Comments

@danfletcher1
Copy link

I have another example I don't know how to add. My format description shows (shortened example)

UMTSGSMPLMNCallDataRecord ::= SEQUENCE{
callModule CHOICE{
transit [0] IMPLICIT Transit,
mSOriginating [1] IMPLICIT MSOriginating
}
}
Transit ::= SET{
tAC [0] IMPLICIT TAC OPTIONAL,
callIdentificationNumber [1] IMPLICIT CallIDNumber OPTIONAL
}

I translated this to ....

ctx.AddChoice("CallModule", []asn1.Choice{
{
Type: reflect.TypeOf(Transit),
Options: "implicit,tag:0",
},
{
Type: MSOriginating,
Options: "implicit,tag:1",
}
}
type Transit struct {
TAC []byte asn1:"implicit,optional,tag:0" // OCTET STRING (SIZE 3..4)
CallIDNumber []byte asn1:"implicit,optional,tag:1" // OCTET STRING (SIZE 3)
}

But the compiler doesn't like that arrangement. 'type Transit is not an expression'

Any pointers please would be helpful.

@danfletcher1
Copy link
Author

Well I got the compiler to stop complaining, so I think this is the fix.

I corrected to ::

Type: reflect.TypeOf(Transit{}),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant