Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Native ASN.1 PER for CHOICE(It seems that native PER generator doesn't produce the PER_encode/decode for CHOICE types)
Native ASN.1 PER for CHOICE [message #1866423] Wed, 29 May 2024 14:27 Go to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Hello, I have the issues with encoding/decoding PER for ETSI ASN.1 using native PER codec.

Tried on Titan ver 10.0.0 and on ToT master branch (commit ae86274).

For the following structure from ETSI NR_RRC_ASN1_Definitions.asn:

SetupRelease { ElementTypeParam } ::= CHOICE {
  release NULL,
  setup ElementTypeParam
}

SpCellConfig ::= SEQUENCE {
  // skipped the details...
  rlf-TimersAndConstants SetupRelease { RLF-TimersAndConstants } OPTIONAL,
  // skipped the details...
}


The XER file is:

<CellGroupConfig>
  <cellGroupId>0</cellGroupId>
  <spCellConfig>
    <rlf-TimersAndConstants>
      <setup>
        <t310>ms1000</t310>
        <n310>n1</n310>
        <n311>n1</n311>
        <t311>ms1000</t311>
      </setup>
    </rlf-TimersAndConstants>
  </spCellConfig>
</CellGroupConfig>


The correct PER representation should be '0404D400101000'. However, the generated Titan code can't encode/decode this structure [with API obj.encode(...), obj.decode(...)] with the following error:

Dynamic test case error: PER decoding requested for type '@NR-RRC-ASN1-Definitions.SpCellConfig.rlf-TimersAndConstants' which has no PER decoding method.

The CHOICE is directly derived from Base_Type, where PER_encode is not implemented. And the code doesn't have its own PER_encode function for 'rlf__TimersAndConstants'. I checked a few other types, it looks like PER encoders are generated for CHOICE types at all.

I believe, the configuration is done correctly on my side to enable internal PER coder, since the following data is able to decode:

PER: 0000 ->

<CellGroupConfig>
        <cellGroupId>0</cellGroupId>
</CellGroupConfig>


Could you please take a look, whether I missed something, or there is an issue in Titan. Thank you in advance.
Re: Native ASN.1 PER for CHOICE [message #1866432 is a reply to message #1866423] Wed, 29 May 2024 15:36 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 56
Registered: February 2016
Member
Hi,

I have not managed to reproduce this issue. I don't have access to the mentioned ASN.1 file, but I've successfully encoded and decoded a value of the following type using our PER codec:

RLF-TimersAndConstants ::= SEQUENCE {
  t310 VisibleString,
  n310 VisibleString,
  n311 VisibleString,
  t311 VisibleString
}

SetupRelease { ElementTypeParam } ::= CHOICE {
  release NULL,
  setup ElementTypeParam
}

SpCellConfig ::= SEQUENCE {
  rlf-TimersAndConstants SetupRelease { RLF-TimersAndConstants } OPTIONAL
}


I'd suggest trying again with the latest version of TITAN.

If that doesn't work, then please send me the type definitions, which cause the issue.

Best regards,
Botond Baranyi
Re: Native ASN.1 PER for CHOICE [message #1866543 is a reply to message #1866432] Fri, 31 May 2024 15:18 Go to previous messageGo to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 128
Registered: November 2018
Senior Member
Hi Anton,

I just tested your data in my test environment: Titan (version 10.1.0) works fine.

Below my test case verifying encoding/decoding:

testcase TC_121() runs on TestSystem system TestSystem {
   var CellGroupConfig v_Decoded_CellGroupConfig;
   var bitstring v_Encoded;
   const octetstring tsc_Reference_Encoding := '0404D400101000'O;
   const  CellGroupConfig tsc_Decoded_CellGroupConfig :=
  { cellGroupId := 0, rlc_BearerToAddModList := omit, rlc_BearerToReleaseList := omit, mac_CellGroupConfig := omit, physicalCellGroupConfig := omit,
  spCellConfig := { servCellIndex := omit, reconfigurationWithSync := omit, rlf_TimersAndConstants :=
  { setup := { t310 := ms1000, n310 := n1, n311 := n1, t311 := ms1000 } },
  rlmInSyncOutOfSyncThreshold := omit, spCellConfigDedicated := omit,
  lowMobilityEvaluationConnected_r17 := omit, goodServingCellEvaluationRLM_r17 := omit,
  goodServingCellEvaluationBFD_r17 := omit, deactivatedSCG_Config_r17 := omit },
  sCellToAddModList := omit,
  sCellToReleaseList := omit, reportUplinkTxDirectCurrent := omit,
  bap_Address_r16 := omit, bh_RLC_ChannelToAddModList_r16 := omit,
  bh_RLC_ChannelToReleaseList_r16 := omit, f1c_TransferPath_r16 := omit,
  simultaneousTCI_UpdateList1_r16 := omit,
  simultaneousTCI_UpdateList2_r16 := omit, simultaneousSpatial_UpdatedList1_r16 := omit,
  simultaneousSpatial_UpdatedList2_r16 := omit, uplinkTxSwitchingOption_r16 := omit,
  uplinkTxSwitchingPowerBoosting_r16 := omit, reportUplinkTxDirectCurrentTwoCarrier_r16 := omit,
  f1c_TransferPathNRDC_r17 := omit, uplinkTxSwitching_2T_Mode_r17 := omit,
  uplinkTxSwitching_DualUL_TxState_r17 := omit,
  uu_RelayRLC_ChannelToAddModList_r17 := omit, uu_RelayRLC_ChannelToReleaseList_r17 := omit,
  simultaneousU_TCI_UpdateList1_r17 := omit, simultaneousU_TCI_UpdateList2_r17 := omit,
  simultaneousU_TCI_UpdateList3_r17 := omit, simultaneousU_TCI_UpdateList4_r17 := omit,
  rlc_BearerToReleaseListExt_r17 := omit, iab_ResourceConfigToAddModList_r17 := omit,
  iab_ResourceConfigToReleaseList_r17 := omit, reportUplinkTxDirectCurrentMoreCarrier_r17 := omit }
 

   // Encoding   
   v_Encoded := encvalue(tsc_Decoded_CellGroupConfig, "", "PER");
   log(bit2oct(v_Encoded));
   if (bit2oct(v_Encoded) == tsc_Reference_Encoding) {
     setverdict(pass);
     log("Encoding OK");
   } else {
     setverdict(fail);
     log("*** ASN.1 encoding not as expected, Expected");
   }
    
   // Decoding
   v_Encoded := oct2bit(tsc_Reference_Encoding);
   if (decvalue(v_Encoded, v_Decoded_CellGroupConfig, "", "PER") != 0) {
     log("ERROR decvalue - failed");
     setverdict(fail);
     self.stop;
   }  else {
     setverdict(pass);
     //log(v_Decoded_CellGroupConfig);
   }

   // Verification
   if (match (v_Decoded_CellGroupConfig, tsc_Decoded_CellGroupConfig)) {
     log("Decoding OK");
     setverdict(pass);
   } else {
     log (match (v_Decoded_CellGroupConfig, tsc_Decoded_CellGroupConfig));
     log("***ERR incorrect decode - failed");
     setverdict(fail);
   }
   
    if (getverdict == pass) {
     log(testcasename() &" PASS");
   } else {
     log(testcasename() &" FAIL");
   }
 } // TC



Regards,
Olaf - olafalejandro.bergengruen@web.de
Re: Native ASN.1 PER for CHOICE [message #1866546 is a reply to message #1866543] Fri, 31 May 2024 17:42 Go to previous messageGo to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Thank you for quick reply guys.

I'm checking on my side. Will write back to you definitely. Thanks
Re: Native ASN.1 PER for CHOICE [message #1871871 is a reply to message #1866546] Mon, 14 October 2024 14:27 Go to previous message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Quick update on previous issue: seems like some of the compiler option (-x/-j/-O) caused not to generate some UPER code. I didn't go deeper on that.
On branch 10.1.2 and master everything is OK.
Thank you for your patience and support.
Previous Topic:Cannot bind port (Address already in use)
Next Topic:ASN1 PER issue with 5G NGAP
Goto Forum:
  


Current Time: Mon Dec 30 17:06:33 GMT 2024

Powered by FUDForum. Page generated in 0.03520 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top