bug fixies
This commit is contained in:
@@ -430,7 +430,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
|
||||
b->circularBuf[(index*nbAnt+a)%CirSize].i=0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( abs(b->th.timestamp-b->lastReceivedTS) > 50 )
|
||||
LOG_W(HW,"gap of: %ld in reception\n", b->th.timestamp-b->lastReceivedTS );
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
int fullread(int fd, void *_buf, int count)
|
||||
{
|
||||
char *buf = _buf;
|
||||
int ret = 0;
|
||||
int l;
|
||||
while (count) {
|
||||
l = read(fd, buf, count);
|
||||
if (l <= 0) return -1;
|
||||
count -= l;
|
||||
buf += l;
|
||||
ret += l;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fullwrite(int fd, void *_buf, int count) {
|
||||
char *buf = _buf;
|
||||
int l;
|
||||
@@ -63,10 +78,10 @@ sin_addr:
|
||||
bool connected=false;
|
||||
|
||||
while(!connected) {
|
||||
LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port);
|
||||
//LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port);
|
||||
|
||||
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
|
||||
LOG_I(HW,"rfsimulator: connection established\n");
|
||||
//LOG_I(HW,"rfsimulator: connection established\n");
|
||||
connected=true;
|
||||
}
|
||||
|
||||
@@ -108,12 +123,13 @@ int main(int argc, char *argv[]) {
|
||||
if (strcmp(argv[2],"server")==0) {
|
||||
serviceSock=server_start(atoi(argv[3]));
|
||||
} else {
|
||||
client_start(argv[2],atoi(argv[3]));
|
||||
serviceSock=client_start(argv[2],atoi(argv[3]));
|
||||
}
|
||||
|
||||
samplesBlockHeader_t header;
|
||||
int bufSize=100000;
|
||||
void *buff=malloc(bufSize);
|
||||
uint64_t readTS=0;
|
||||
|
||||
while (1) {
|
||||
//Rewind the file to loop on the samples
|
||||
@@ -125,6 +141,7 @@ int main(int argc, char *argv[]) {
|
||||
AssertFatal(read(fd,&header,sizeof(header)), "");
|
||||
fullwrite(serviceSock, &header, sizeof(header));
|
||||
int dataSize=sizeof(int32_t)*header.size*header.nbAnt;
|
||||
uint64_t wroteTS=header.timestamp;
|
||||
|
||||
if (dataSize>bufSize) {
|
||||
void * new_buff = realloc(buff, dataSize);
|
||||
@@ -139,9 +156,16 @@ int main(int argc, char *argv[]) {
|
||||
AssertFatal(read(fd,buff,dataSize) == dataSize, "");
|
||||
fullwrite(serviceSock, buff, dataSize);
|
||||
// Purge incoming samples
|
||||
setblocking(serviceSock, notBlocking);
|
||||
|
||||
while(recv(serviceSock,buff, bufSize, MSG_DONTWAIT) > 0) {
|
||||
setblocking(serviceSock, blocking);
|
||||
while(readTS < wroteTS) {
|
||||
if ( fullread(serviceSock, &header,sizeof(header)) != sizeof(header) ||
|
||||
fullread(serviceSock, buff, sizeof(int32_t)*header.size*header.nbAnt) !=
|
||||
sizeof(int32_t)*header.size*header.nbAnt
|
||||
) {
|
||||
printf("error: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
readTS=header.timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1202,7 +1202,8 @@ void wakeup_L1s(RU_t *ru) {
|
||||
ru->proc.emulate_rf_busy = 0;
|
||||
|
||||
}
|
||||
inline int wakeup_prach_ru(RU_t *ru) {
|
||||
|
||||
void wakeup_prach_ru(RU_t *ru) {
|
||||
int ret;
|
||||
struct timespec wait;
|
||||
int time_ns = 5000000L;
|
||||
@@ -1234,11 +1235,10 @@ inline int wakeup_prach_ru(RU_t *ru) {
|
||||
} else LOG_W(PHY,"RU prach thread busy, skipping\n");
|
||||
|
||||
AssertFatal((ret=pthread_mutex_unlock( &ru->proc.mutex_prach ))==0,"mutex_unlock returns %d\n",ret);
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
inline int wakeup_prach_ru_br(RU_t *ru) {
|
||||
void wakeup_prach_ru_br(RU_t *ru) {
|
||||
int ret;
|
||||
struct timespec wait;
|
||||
int time_ns = 5000000L;
|
||||
@@ -1264,7 +1264,6 @@ inline int wakeup_prach_ru_br(RU_t *ru) {
|
||||
} else LOG_W(PHY,"RU prach thread busy, skipping\n");
|
||||
|
||||
AssertFatal((ret=pthread_mutex_unlock( &ru->proc.mutex_prach_br ))==0,"mutex_unlock returns %d\n",ret);
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user