PHY tests working

master
ismagom 10 years ago
parent 309ebd80e5
commit 64493f9644

@ -224,7 +224,7 @@ void ra_proc::step_pdcch_setup() {
int ra_tti = phy_h->prach_tx_tti();
if (ra_tti > 0) {
ra_rnti = 1+ra_tti%10;
phy_h->pdcch_dl_search(SRSLTE_RNTI_RAR, ra_rnti, ra_tti+3, responseWindowSize);
phy_h->pdcch_dl_search(SRSLTE_RNTI_RAR, ra_rnti, ra_tti+3, ra_tti+3+responseWindowSize);
state = RESPONSE_RECEPTION;
}
}

@ -311,7 +311,8 @@ void phch_recv::run_thread()
prach_buffer->send(radio_h, cfo, tx_time);
radio_h->tx_end();
}
workers_pool->start_worker(worker);
workers_pool->start_worker(worker);
mac->tti_clock(tti);
}
} else {
// wait_worker() only returns NULL if it's being closed. Quit now to avoid unnecessary loops here

@ -159,6 +159,7 @@ srslte::ue::phy my_phy;
bool bch_decoded = false;
uint8_t payload[10240];
uint8_t payload_bits[10240];
const uint8_t conn_request_msg[] = {0x20, 0x06, 0x1F, 0x5C, 0x2C, 0x04, 0xB2, 0xAC, 0xF6, 0x00, 0x00, 0x00};
enum mac_state {RA, RAR, CONNREQUEST, CONNSETUP} state = RA;
@ -213,7 +214,7 @@ public:
if (!rar_rnti_set) {
int prach_tti = my_phy.prach_tx_tti();
if (prach_tti > 0) {
my_phy.pdcch_dl_search(SRSLTE_RNTI_RAR, 1+prach_tti%10, prach_tti+3, 10);
my_phy.pdcch_dl_search(SRSLTE_RNTI_RAR, 1+prach_tti%10, prach_tti+3, prach_tti+13);
rar_rnti_set = true;
}
}
@ -221,7 +222,7 @@ public:
void new_grant_ul(mac_grant_t grant, uint8_t *payload_ptr, tb_action_ul_t *action) {
printf("New grant UL\n");
srslte_bit_pack_vector((uint8_t*) conn_request_msg, payload_ptr, grant.n_bytes*8);
memcpy(payload_ptr, conn_request_msg, grant.n_bytes*sizeof(uint8_t));
action->current_tx_nb = nof_rtx_connsetup;
action->rv = rv_value[nof_rtx_connsetup%4];
action->softbuffer = &softbuffer_tx;
@ -281,7 +282,8 @@ public:
void tb_decoded_ok(uint32_t harq_pid) {
if (last_grant.rnti == 2) {
my_phy.pdcch_dl_search_reset();
rar_unpack(payload, &rar_msg);
srslte_bit_pack_vector(payload, payload_bits, last_grant.n_bytes*8);
rar_unpack(payload_bits, &rar_msg);
if (rar_msg.RAPID == preamble_idx) {
printf("Received RAR at TTI: %d\n", last_grant.tti);
@ -291,7 +293,7 @@ public:
if (last_grant.n_bytes*8 > 20 + SRSLTE_RAR_GRANT_LEN) {
uint8_t rar_grant[SRSLTE_RAR_GRANT_LEN];
memcpy(rar_grant, &payload[20], sizeof(uint8_t)*SRSLTE_RAR_GRANT_LEN);
memcpy(rar_grant, &payload_bits[20], sizeof(uint8_t)*SRSLTE_RAR_GRANT_LEN);
my_phy.set_rar_grant(last_grant.tti, rar_grant);
}
} else {

@ -117,7 +117,7 @@ public:
memcpy(&action->phy_grant, &grant.phy_grant, sizeof(srslte_phy_grant_t));
action->rv = ((uint32_t) ceilf((float)3*((my_phy.tti_to_SFN(grant.tti)/2)%4)/2))%4;
action->softbuffer = &softbuffer;
action->rnti = grant.rnti;
if (action->rv == 0) {
srslte_softbuffer_rx_reset(&softbuffer);
}

Loading…
Cancel
Save