Commit 94831547 authored by laurent's avatar laurent

add prach

parent c48609f9
This diff is collapsed.
...@@ -34,17 +34,44 @@ typedef struct frequency_s { ...@@ -34,17 +34,44 @@ typedef struct frequency_s {
int nbSamples; int nbSamples;
} frequency_t; } frequency_t;
typedef struct {
int frame;
int subframe;
uint16_t max_preamble[4];
uint16_t max_preamble_energy[4];
uint16_t max_preamble_delay[4];
uint16_t avg_preamble_energy[4];
} fs6_ul_t;
typedef struct {
int frame;
int subframe;
int num_pdcch_symbols;
int num_dci;
DCI_ALLOC_t dci_alloc[32];
int num_mdci;
int amp;
bool UE_active[NUMBER_OF_UE_MAX];
LTE_eNB_PHICH phich_vars;
} fs6_dl_t;
bool createUDPsock (char *sourceIP, char *sourcePort, char *destIP, char *destPort, UDPsock_t *result); bool createUDPsock (char *sourceIP, char *sourcePort, char *destIP, char *destPort, UDPsock_t *result);
int receiveSubFrame(UDPsock_t *sock, uint64_t expectedTS, void *bufferZone, int bufferSize); int receiveSubFrame(UDPsock_t *sock, uint64_t expectedTS, void *bufferZone, int bufferSize);
int sendSubFrame(UDPsock_t *sock, void *bufferZone); int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize);
inline size_t alignedSize(void *ptr) { #define initBufferZone(xBuf) \
uint8_t xBuf[FS6_BUF_SIZE];\
((commonUDP_t *)xBuf)->nbBlocks=0;
inline size_t alignedSize(uint8_t *ptr) {
commonUDP_t *header=(commonUDP_t *) ptr; commonUDP_t *header=(commonUDP_t *) ptr;
return ((header->contentBytes+sizeof(commonUDP_t)+blockAlign-1)/blockAlign)*blockAlign; return ((header->contentBytes+sizeof(commonUDP_t)+blockAlign-1)/blockAlign)*blockAlign;
} }
inline void * commonUDPdata(void* ptr) { inline void *commonUDPdata(uint8_t *ptr) {
return (void*) (((commonUDP_t*)ptr)+1); return (void *) (((commonUDP_t *)ptr)+1);
} }
void *cu_fs6(void *arg); void *cu_fs6(void *arg);
...@@ -54,7 +81,16 @@ void rx_rf(RU_t *ru,int *frame,int *subframe); ...@@ -54,7 +81,16 @@ void rx_rf(RU_t *ru,int *frame,int *subframe);
void tx_rf(RU_t *ru); void tx_rf(RU_t *ru);
void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe); void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe);
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc); void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc);
bool dlsch_procedures(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
int harq_pid,
LTE_eNB_DLSCH_t *dlsch,
LTE_eNB_UE_stats *ue_stats) ;
void pdsch_procedures(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
int harq_pid,
LTE_eNB_DLSCH_t *dlsch,
LTE_eNB_DLSCH_t *dlsch1);
// mistakes in main OAI // mistakes in main OAI
void phy_init_RU(RU_t *); void phy_init_RU(RU_t *);
void feptx_prec(RU_t *); void feptx_prec(RU_t *);
......
...@@ -99,11 +99,20 @@ int receiveSubFrame(UDPsock_t *sock, uint64_t expectedTS, void *bufferZone, int ...@@ -99,11 +99,20 @@ int receiveSubFrame(UDPsock_t *sock, uint64_t expectedTS, void *bufferZone, int
return rcved; return rcved;
} }
int sendSubFrame(UDPsock_t *sock, void *bufferZone) { int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize) {
commonUDP_t *header=(commonUDP_t *)bufferZone ; commonUDP_t *UDPheader=(commonUDP_t *)bufferZone ;
int nbBlocks=header->nbBlocks; int nbBlocks=UDPheader->nbBlocks;
int blockId=0;
do { do {
if (blockId > 0 ) {
commonUDP_t *currentHeader=(commonUDP_t *)bufferZone;
*currentHeader=*UDPheader;
currentHeader->blockID=blockId;
memcpy(commonUDPdata((void *)currentHeader), commonUDPdata(bufferZone), secondHeaderSize);
blockId++;
}
int sz=alignedSize(bufferZone); int sz=alignedSize(bufferZone);
// Let's use the first address returned by getaddrinfo() // Let's use the first address returned by getaddrinfo()
int ret=sendto(sock->sockHandler, bufferZone, sz, 0, int ret=sendto(sock->sockHandler, bufferZone, sz, 0,
......
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