entry *C.PLMNIdentity_t
}
-func (plmnId *e2apEntryPlmnIdentity) set(id *conv.PlmnIdentity) error {
+func (plmnId *e2apEntryPlmnIdentity) set(id conv.PlmnIdentityIf) error {
- plmnId.entry.contentLength = (C.uint8_t)(len(id.Val))
- for i := 0; i < len(id.Val); i++ {
- plmnId.entry.pLMNIdentityVal[i] = (C.uint8_t)(id.Val[i])
+ buf := new(bytes.Buffer)
+ id.EncodeTo(buf)
+ data := buf.Bytes()
+ plmnId.entry.contentLength = (C.uint8_t)(len(data))
+ for i := 0; i < len(data); i++ {
+ plmnId.entry.pLMNIdentityVal[i] = (C.uint8_t)(data[i])
}
return nil
}
-func (plmnId *e2apEntryPlmnIdentity) get(id *conv.PlmnIdentity) error {
+func (plmnId *e2apEntryPlmnIdentity) get(id conv.PlmnIdentityIf) error {
conlen := (int)(plmnId.entry.contentLength)
bcdBuf := make([]uint8, conlen)
for i := 0; i < conlen; i++ {
bcdBuf[i] = (uint8)(plmnId.entry.pLMNIdentityVal[i])
}
- id.BcdPut(bcdBuf)
+ reader := bytes.NewReader(bcdBuf)
+ id.DecodeFrom(reader)
return nil
}
for i := 0; i < len(data.Items); i++ {
item.entry.RICActionNotAdmittedItem[item.entry.contentLength].ricActionID = (C.ulong)(data.Items[i].ActionId)
item.entry.RICActionNotAdmittedItem[item.entry.contentLength].ricCause.content = (C.uchar)(data.Items[i].Cause.Content)
- item.entry.RICActionNotAdmittedItem[item.entry.contentLength].ricCause.cause = (C.uchar)(data.Items[i].Cause.CauseVal)
+ item.entry.RICActionNotAdmittedItem[item.entry.contentLength].ricCause.cause = (C.uchar)(data.Items[i].Cause.Value)
item.entry.contentLength++
}
for i := 0; i < conlen; i++ {
data.Items[i].ActionId = (uint64)(item.entry.RICActionNotAdmittedItem[i].ricActionID)
data.Items[i].Cause.Content = (uint8)(item.entry.RICActionNotAdmittedItem[i].ricCause.content)
- data.Items[i].Cause.CauseVal = (uint8)(item.entry.RICActionNotAdmittedItem[i].ricCause.cause)
+ data.Items[i].Cause.Value = (uint8)(item.entry.RICActionNotAdmittedItem[i].ricCause.cause)
}
return nil
}
return err, nil
}
e2apMsg.msgC.ricCause.content = (C.uchar)(e2apMsg.msgG.Cause.Content)
- e2apMsg.msgC.ricCause.cause = (C.uchar)(e2apMsg.msgG.Cause.CauseVal)
+ e2apMsg.msgC.ricCause.cause = (C.uchar)(e2apMsg.msgG.Cause.Value)
e2apMsg.msgC.criticalityDiagnosticsPresent = false
if e2apMsg.msgG.CriticalityDiagnostics.Present {
e2apMsg.msgC.criticalityDiagnosticsPresent = true
return err, e2apMsg.msgG
}
e2apMsg.msgG.Cause.Content = (uint8)(e2apMsg.msgC.ricCause.content)
- e2apMsg.msgG.Cause.CauseVal = (uint8)(e2apMsg.msgC.ricCause.cause)
+ e2apMsg.msgG.Cause.Value = (uint8)(e2apMsg.msgC.ricCause.cause)
if e2apMsg.msgC.criticalityDiagnosticsPresent == true {
e2apMsg.msgG.CriticalityDiagnostics.Present = true
if err := (&e2apEntryCriticalityDiagnostic{entry: &e2apMsg.msgC.criticalityDiagnostics}).get(&e2apMsg.msgG.CriticalityDiagnostics); err != nil {