Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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 UE
Commits
04226908
Commit
04226908
authored
Jan 15, 2015
by
ghaddab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@6398
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
15e3352c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+21
-8
No files found.
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
04226908
...
...
@@ -106,15 +106,15 @@ int ethernet_write_data(int Mod_id, openair0_timestamp timestamp, const void **b
((
int16_t
*
)
buff2
)[
0
]
=
1
+
(
antenna_id
<<
1
);
((
int16_t
*
)
buff2
)[
1
]
=
nsamps
;
*
((
openair0_timestamp
*
)(
buff2
+
(
sizeof
(
int16_t
)
*
2
)))
=
timestamp
;
//
printf("Timestamp TX sent : %d\n",timestamp);
//
printf("Timestamp TX sent : %d\n",timestamp);
// printf("buffer head : %d %d %d %d \n",((int16_t *)buff2)[0],((int16_t *)buff2)[1],((int16_t *)buff2)[2],((int16_t *)buff2)[3]);
while
(
n_written
<
(
nsamps
<<
2
)
)
{
while
(
n_written
<
nsamps
)
{
/* Send packet */
if
((
n_written
+=
sendto
(
sockfd
[
Mod_id
],
buff2
,
(
nsamps
<<
2
)
+
sizeof
(
openair0_timestamp
)
+
(
2
*
sizeof
(
int16_t
)),
MSG_DONTWAIT
,
0
,
(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]))
<
0
)
{
printf
(
"Send failed for Mod_id %d
\n
"
,
Mod_id
);
...
...
@@ -137,14 +137,16 @@ int ethernet_read_data(int Mod_id,openair0_timestamp *timestamp,void **buff, int
int
ret
;
openair0_timestamp
temp
=
*
(
openair0_timestamp
*
)(
buff2
);
int16_t
mesg
[
2
];
char
str
[
INET_ADDRSTRLEN
];
mesg
[
0
]
=
0
+
(
antenna_id
<<
1
);
mesg
[
1
]
=
nsamps
;
//mesg[0] = 0+(antenna_id<<1);
//mesg[1] = nsamps;
inet_ntop
(
AF_INET
,
&
(
dest_addr
[
Mod_id
].
sin_addr
),
str
,
INET_ADDRSTRLEN
);
// send command RX for nsamps samples
// printf("requesting %d samples from (%s:%d)\n",nsamps,str,ntohs(dest_addr[Mod_id].sin_port));
sendto
(
sockfd
[
Mod_id
],
mesg
,
4
,
MSG_DONTWAIT
,(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]);
//sendto(sockfd[Mod_id],mesg,4,0
,(struct sockaddr *)&dest_addr[Mod_id],dest_addr_len[Mod_id]);
bytes_received
=
0
;
block_cnt
=
0
;
...
...
@@ -185,8 +187,19 @@ int ethernet_read_data(int Mod_id,openair0_timestamp *timestamp,void **buff, int
int
trx_eth_start
(
openair0_device
*
openair0
)
{
return
(
ethernet_socket_init
(
openair0
->
openair0_cfg
.
Mod_id
,
openair0
->
openair0_cfg
.
rrh_ip
,
openair0
->
openair0_cfg
.
rrh_port
));
int16_t
mesg
[
2
];
int
Mod_id
;
Mod_id
=
openair0
->
openair0_cfg
.
Mod_id
;
ethernet_socket_init
(
openair0
->
openair0_cfg
.
Mod_id
,
openair0
->
openair0_cfg
.
rrh_ip
,
openair0
->
openair0_cfg
.
rrh_port
);
mesg
[
0
]
=
1
+
0
;
//antenna index is 0, to be replaced by the number of active antennas
mesg
[
1
]
=
openair0
->
openair0_cfg
.
samples_per_packet
;
sendto
(
sockfd
[
Mod_id
],
mesg
,
4
,
0
,(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]);
return
(
0
);
}
void
trx_eth_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
const
void
**
buff
,
int
nsamps
,
int
cc
,
int
flags
)
...
...
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