Commit 7378b8be authored by Joanne Hugé's avatar Joanne Hugé

wip

parent 65f8d8de
......@@ -155,6 +155,10 @@ static volatile counter_stat_t tx_drop_counter; // frames sent to RRH
// Network
static volatile int seq_id;
static volatile uint8_t frame_id;
static volatile uint8_t sub_frame_id;
static volatile uint8_t slot_id;
static volatile uint8_t symbol_id;
static int send_sockfd;
static int recv_sockfd;
static struct sockaddr_ll connect_sk_addr;
......@@ -430,6 +434,8 @@ static void *encode_thread(void *p) {
for(int64_t i = 0;; i++) {
int64_t to_write, to_read;
uint16_t * 16_bit;
int j;
to_write = rbuf_write_amount(&tx_rbuf);
to_read = rbuf_read_amount(&trxw_rbuf[0]);
......@@ -441,11 +447,25 @@ static void *encode_thread(void *p) {
data = rbuf_write(&tx_rbuf);
memcpy(data, packet_header, PACKET_HEADER);
j = ETHERNET_HEADER + ECPRI_COMMON_HEADER;
// SEQ_ID
*((uint16_t *) data[ETHERNET_HEADER + ECPRI_COMMON_HEADER + 2]) = htons(seq_id++);
// Frame ID
data[ETHERNET_HEADER + ECPRI_IQ_HEADER + 1] = seq_id;
*((uint16_t *) data[j + 2]) = htons(seq_id++);
j = ETHERNET_HEADER + ECPRI_IQ_HEADER;
// ORAN counters
data[j + 1] = frame_id;
16_bit = (uint16_t *) data[j + 2];
*16_bit = sub_frame_id << 8;
*16_bit |= slot_id << 4 ;
*16_bit |= symbol_id;
/* How to compute counters:
- How much IQ samples are sent ?
- How much IQ samples / second ?
*/
frame_id = (frame_id + 1) % 100;
sub_frame_id = (frame_id + 1) % 100;
// TODO
int nc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment