1 /*****************************************************************************
3 # Copyright 2019 AT&T Intellectual Property *
4 # Copyright 2019 Nokia *
6 # Licensed under the Apache License, Version 2.0 (the "License"); *
7 # you may not use this file except in compliance with the License. *
8 # You may obtain a copy of the License at *
10 # http://www.apache.org/licenses/LICENSE-2.0 *
12 # Unless required by applicable law or agreed to in writing, software *
13 # distributed under the License is distributed on an "AS IS" BASIS, *
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15 # See the License for the specific language governing permissions and *
16 # limitations under the License. *
18 ******************************************************************************/
27 #include "e2sim_defs.h"
29 #include "e2ap_asn1c_codec.h"
36 int main(int argc, char* argv[]){
40 test_eventTriggerDefinition();
43 E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_X2SetupRequest.xml");
44 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_X2SetupResponse.xml");
45 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_X2SetupFailure.xml");
47 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_ENDCX2SetupRequest.xml");
48 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_ENDCX2SetupResponse.xml");
49 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_ENDCX2SetupFailure.xml");
51 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_RICsubscriptionRequest.xml");
52 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_RICsubscriptionResponse.xml");
53 // E2AP_PDU_t* pdu = e2ap_xml_to_pdu("E2AP_ErrorIndication.xml");
55 e2ap_asn1c_print_pdu(pdu);
61 data.len = e2ap_asn1c_encode_pdu(pdu, &buf);
62 memcpy(data.buffer, buf, min(data.len, MAX_SCTP_BUFFER));
65 E2AP_PDU_t* pdu1 = new E2AP_PDU_t();
67 e2ap_asn1c_decode_pdu(pdu1, data.buffer, data.len);
69 e2ap_asn1c_print_pdu(pdu1);
71 int index = (int)pdu1->present;
73 int pCode = e2ap_asn1c_get_procedureCode(pdu1);
75 LOG_I("Index = %d, procedureCode = %d", index, pCode);