Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
89bddc76
Commit
89bddc76
authored
Jan 11, 2023
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressing reviewer comments
parent
24237b3e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
97 deletions
+91
-97
CMakeLists.txt
CMakeLists.txt
+0
-5
openair3/CMakeLists.txt
openair3/CMakeLists.txt
+1
-1
openair3/NRPPA/CMakeLists.txt
openair3/NRPPA/CMakeLists.txt
+4
-0
openair3/NRPPA/main_nrppa.c
openair3/NRPPA/main_nrppa.c
+0
-91
openair3/NRPPA/test_nrppa.c
openair3/NRPPA/test_nrppa.c
+86
-0
No files found.
CMakeLists.txt
View file @
89bddc76
...
@@ -525,11 +525,6 @@ target_link_libraries(f1ap PRIVATE ngap nr_rrc)
...
@@ -525,11 +525,6 @@ target_link_libraries(f1ap PRIVATE ngap nr_rrc)
##############
##############
# target asn1_lpp in openair3/LPP/MESSAGES/CMakeLists.txt used below
# target asn1_lpp in openair3/LPP/MESSAGES/CMakeLists.txt used below
# NRPPA
##############
add_executable
(
main_nrppa
${
OPENAIR3_DIR
}
/NRPPA/main_nrppa.c
)
target_link_libraries
(
main_nrppa asn1_nrppa
)
# Hardware dependant options
# Hardware dependant options
###################################
###################################
add_list1_option
(
NB_ANTENNAS_RX
"4"
"Number of antennas in reception"
"1"
"2"
"4"
)
add_list1_option
(
NB_ANTENNAS_RX
"4"
"Number of antennas in reception"
"1"
"2"
"4"
)
...
...
openair3/CMakeLists.txt
View file @
89bddc76
...
@@ -2,4 +2,4 @@ add_subdirectory(LPP)
...
@@ -2,4 +2,4 @@ add_subdirectory(LPP)
add_subdirectory
(
M3AP
)
add_subdirectory
(
M3AP
)
add_subdirectory
(
S1AP
)
add_subdirectory
(
S1AP
)
add_subdirectory
(
NGAP
)
add_subdirectory
(
NGAP
)
add_subdirectory
(
NRPPA
)
add_subdirectory
(
NRPPA
)
\ No newline at end of file
openair3/NRPPA/CMakeLists.txt
View file @
89bddc76
add_subdirectory
(
MESSAGES
)
add_subdirectory
(
MESSAGES
)
add_executable
(
test_nrppa
${
OPENAIR3_DIR
}
/NRPPA/test_nrppa.c
)
target_link_libraries
(
test_nrppa asn1_nrppa
)
openair3/NRPPA/main_nrppa.c
deleted
100755 → 0
View file @
24237b3e
#include<stdio.h>
#include<NRPPA_MeasurementRequest.h>
#include<NRPPA_ProtocolIE-Field.h>
#include<asn_SEQUENCE_OF.h>
/*
* This is a custom function which writes the
* encoded output into some FILE stream.
*/
static
int
write_out
(
const
void
*
buffer
,
size_t
size
,
void
*
app_key
)
{
FILE
*
out_fp
=
app_key
;
size_t
wrote
;
wrote
=
fwrite
(
buffer
,
1
,
size
,
out_fp
);
return
(
wrote
==
size
)
?
0
:
-
1
;
}
int
main
(
int
ac
,
char
**
av
)
{
NRPPA_MeasurementRequest_t
*
NRPPA_MeasurementRequest
;
/* Type to encode */
asn_enc_rval_t
ec
;
/* Encoder return value */
/* Allocate the NRPPA_MeasurementRequest_t */
NRPPA_MeasurementRequest
=
calloc
(
1
,
sizeof
(
NRPPA_MeasurementRequest_t
));
/* not malloc! */
if
(
!
NRPPA_MeasurementRequest
)
{
perror
(
"calloc() failed"
);
exit
(
71
);
/* better, EX_OSERR */
}
NRPPA_MeasurementRequest_IEs_t
xyz
;
ASN_SEQUENCE_ADD
(
&
NRPPA_MeasurementRequest
->
protocolIEs
.
list
,
&
xyz
);
/* MeasurementRequest ::= SEQUENCE {
protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}},
...
} */
/* Protocl IE container
id-LMF-Measurement-ID ProtocolIE-ID ::= 39
id-RAN-Measurement-ID ProtocolIE-ID ::= 40
ID id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41
ID id-ReportCharacteristics ProtocolIE-ID ::= 3
ID id-MeasurementPeriodicity ProtocolIE-ID ::= 4
ID id-TRPMeasurementQuantities ProtocolIE-ID ::= 52
*/
NRPPA_MeasurementRequest
->
protocolIEs
;
/* Context for parsing across buffer boundaries */
NRPPA_MeasurementRequest
->
_asn_ctx
;
/* BER encode the data if filename is given */
if
(
ac
<
2
)
{
fprintf
(
stderr
,
"Specify filename for BER output
\n
"
);
}
else
{
const
char
*
filename
=
av
[
1
];
FILE
*
fp
=
fopen
(
filename
,
"wb"
);
/* for BER output */
if
(
!
fp
)
{
perror
(
filename
);
exit
(
71
);
/* better, EX_OSERR */
}
//asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
// const void *struct_ptr, /* Structure to be encoded */
// asn_app_consume_bytes_f *consume_bytes_cb,
// void *app_key /* Arbitrary callback argument */);
/* Encode the NRPPA_MeasurementRequest type as BER (DER) */
ec
=
der_encode
(
&
asn_DEF_NRPPA_MeasurementRequest
,
NRPPA_MeasurementRequest
,
write_out
,
fp
);
fclose
(
fp
);
if
(
ec
.
encoded
==
-
1
)
{
fprintf
(
stderr
,
"Could not encode NRPPA_MeasurementRequest (at %s)
\n
"
,
ec
.
failed_type
?
ec
.
failed_type
->
name
:
"unknown"
);
exit
(
65
);
/* better, EX_DATAERR */
}
else
{
fprintf
(
stderr
,
"Created %s with BER encoded NRPPA_MeasurementRequest
\n
"
,
filename
);
}
}
/* Also print the constructed NRPPA_MeasurementRequest XER encoded (XML) */
xer_fprint
(
stdout
,
&
asn_DEF_NRPPA_MeasurementRequest
,
NRPPA_MeasurementRequest
);
return
0
;
/* Encoding finished successfully */
}
openair3/NRPPA/test_nrppa.c
0 → 100755
View file @
89bddc76
#include <stdio.h>
#include <NRPPA_MeasurementRequest.h>
#include <NRPPA_ProtocolIE-Field.h>
#include <asn_SEQUENCE_OF.h>
/*
* This is a custom function which writes the
* encoded output into some FILE stream.
*/
static
int
write_out
(
const
void
*
buffer
,
size_t
size
,
void
*
app_key
)
{
FILE
*
out_fp
=
app_key
;
size_t
wrote
;
wrote
=
fwrite
(
buffer
,
1
,
size
,
out_fp
);
return
(
wrote
==
size
)
?
0
:
-
1
;
}
int
main
(
int
ac
,
char
**
av
)
{
NRPPA_MeasurementRequest_t
*
NRPPA_MeasurementRequest
;
/* Type to encode */
asn_enc_rval_t
ec
;
/* Encoder return value */
/* Allocate the NRPPA_MeasurementRequest_t */
NRPPA_MeasurementRequest
=
calloc
(
1
,
sizeof
(
NRPPA_MeasurementRequest_t
));
/* not malloc! */
if
(
!
NRPPA_MeasurementRequest
)
{
perror
(
"calloc() failed"
);
exit
(
71
);
/* better, EX_OSERR */
}
NRPPA_MeasurementRequest_IEs_t
xyz
;
ASN_SEQUENCE_ADD
(
&
NRPPA_MeasurementRequest
->
protocolIEs
.
list
,
&
xyz
);
/* MeasurementRequest ::= SEQUENCE {
protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}},
...
} */
/* Protocl IE container
id-LMF-Measurement-ID ProtocolIE-ID ::= 39
id-RAN-Measurement-ID ProtocolIE-ID ::= 40
ID id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41
ID id-ReportCharacteristics ProtocolIE-ID ::= 3
ID id-MeasurementPeriodicity ProtocolIE-ID ::= 4
ID id-TRPMeasurementQuantities ProtocolIE-ID ::= 52
*/
//NRPPA_MeasurementRequest->protocolIEs;
/* Context for parsing across buffer boundaries */
//NRPPA_MeasurementRequest->_asn_ctx;
/* BER encode the data if filename is given */
if
(
ac
<
2
)
{
fprintf
(
stderr
,
"Specify filename for BER output
\n
"
);
}
else
{
const
char
*
filename
=
av
[
1
];
FILE
*
fp
=
fopen
(
filename
,
"wb"
);
/* for BER output */
if
(
!
fp
)
{
perror
(
filename
);
exit
(
71
);
/* better, EX_OSERR */
}
// asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
// const void *struct_ptr, /* Structure to be encoded */
// asn_app_consume_bytes_f *consume_bytes_cb,
// void *app_key /* Arbitrary callback argument */);
/* Encode the NRPPA_MeasurementRequest type as BER (DER) */
ec
=
der_encode
(
&
asn_DEF_NRPPA_MeasurementRequest
,
NRPPA_MeasurementRequest
,
write_out
,
fp
);
fclose
(
fp
);
if
(
ec
.
encoded
==
-
1
)
{
fprintf
(
stderr
,
"Could not encode NRPPA_MeasurementRequest (at %s)
\n
"
,
ec
.
failed_type
?
ec
.
failed_type
->
name
:
"unknown"
);
exit
(
65
);
/* better, EX_DATAERR */
}
else
{
fprintf
(
stderr
,
"Created %s with BER encoded NRPPA_MeasurementRequest
\n
"
,
filename
);
}
}
/* Also print the constructed NRPPA_MeasurementRequest XER encoded (XML) */
xer_fprint
(
stdout
,
&
asn_DEF_NRPPA_MeasurementRequest
,
NRPPA_MeasurementRequest
);
return
0
;
/* Encoding finished successfully */
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment