From d4c214dbe7f1f2ce920b0f0b0ed723763dc7d03e Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 19 Oct 2015 11:52:56 +0200 Subject: [PATCH] Fixed unnecessary bit_unpack in pdsch_ue --- srslte/examples/pdsch_enodeb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index 125c1fb58..dfa3f12e8 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -413,7 +413,7 @@ int update_control() { } #define DATA_BUFF_SZ 1000 -uint8_t data[8*DATA_BUFF_SZ], data_unpacked[DATA_BUFF_SZ]; +uint8_t data[8*DATA_BUFF_SZ], data2[DATA_BUFF_SZ]; uint8_t data_tmp[DATA_BUFF_SZ]; /** Function run in a separate thread to receive UDP data */ @@ -422,7 +422,7 @@ void *net_thread_fnc(void *arg) { int rpm = 0, wpm=0; do { - n = srslte_netsource_read(&net_source, &data_unpacked[rpm], DATA_BUFF_SZ-rpm); + n = srslte_netsource_read(&net_source, &data2[rpm], DATA_BUFF_SZ-rpm); if (n > 0) { int nbytes = 1+(pdsch_cfg.grant.mcs.tbs-1)/8; rpm += n; @@ -431,7 +431,7 @@ void *net_thread_fnc(void *arg) { while (rpm >= nbytes) { // wait for packet to be transmitted sem_wait(&net_sem); - srslte_bit_unpack_vector(&data_unpacked[wpm], data, nbytes*8); + memcpy(data, &data2[wpm], nbytes); INFO("Sent %d/%d bytes ready\n", nbytes, rpm); rpm -= nbytes; wpm += nbytes; @@ -439,7 +439,7 @@ void *net_thread_fnc(void *arg) { } if (wpm > 0) { INFO("%d bytes left in buffer for next packet\n", rpm); - memcpy(data_unpacked, &data_unpacked[wpm], rpm * sizeof(uint8_t)); + memcpy(data2, &data2[wpm], rpm * sizeof(uint8_t)); } } else if (n == 0) { rpm = 0;