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
alex037yang
OpenXG-RAN
Commits
47f802c1
Commit
47f802c1
authored
Dec 09, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add usrp_lib_config.c for USRP device configuration (record player)
parent
79fc7447
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib_config.c
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib_config.c
+73
-0
No files found.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib_config.c
0 → 100644
View file @
47f802c1
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/** usrp_lib_config.c
*
* \author: HongliangXU : hong-liang-xu@agilent.com
*/
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/sysinfo.h>
#include <sys/resource.h>
#include "common/utils/LOG/log.h"
#include "assertions.h"
#include "common_lib.h"
#include "usrp_lib.h"
int
read_usrpconfig
(
uint32_t
*
recplay_mode
,
recplay_state_t
**
recplay_state
)
{
unsigned
int
u_sf_record
=
0
;
// record mode
unsigned
int
u_sf_replay
=
0
;
// replay mode
uint32_t
enable_recplay
;
paramdef_t
usrp_params
[]
=
USRP_DEVICE_PARAMS_DESC
;
config_get
(
usrp_params
,
sizeof
(
usrp_params
)
/
sizeof
(
paramdef_t
),
USRP_SECTION
);
if
(
enable_recplay
)
{
*
recplay_state
=
calloc
(
sizeof
(
recplay_state_t
),
1
);
paramdef_t
usrp_recplay_params
[]
=
USRP_RECPLAY_PARAMS_DESC
;
struct
sysinfo
systeminfo
;
// Use mmap for IQ files for systems with less than 6GB total RAM
sysinfo
(
&
systeminfo
);
if
(
systeminfo
.
totalram
<
6144000000
)
{
(
*
recplay_state
)
->
use_mmap
=
0
;
}
else
{
(
*
recplay_state
)
->
use_mmap
=
1
;
}
memset
((
*
recplay_state
)
->
u_sf_filename
,
0
,
1024
);
config_get
(
usrp_recplay_params
,
sizeof
(
usrp_recplay_params
)
/
sizeof
(
paramdef_t
),
USRP_RECPLAY_SECTION
);
if
(
strlen
((
*
recplay_state
)
->
u_sf_filename
)
==
0
)
{
(
void
)
strcpy
((
*
recplay_state
)
->
u_sf_filename
,
DEF_SF_FILE
);
}
}
/* record player enabled */
if
(
u_sf_replay
==
1
)
*
recplay_mode
=
RECPLAY_REPLAYMODE
;
if
(
u_sf_record
==
1
)
*
recplay_mode
=
RECPLAY_RECORDMODE
;
return
0
;
}
\ No newline at end of file
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