|
|
@ -826,9 +826,6 @@ uint8_t sch_subh::phr_report_table(float phr_value)
|
|
|
|
void rar_pdu::fprint(FILE* stream)
|
|
|
|
void rar_pdu::fprint(FILE* stream)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(stream, "MAC PDU for RAR. ");
|
|
|
|
fprintf(stream, "MAC PDU for RAR. ");
|
|
|
|
if (has_backoff_indicator) {
|
|
|
|
|
|
|
|
fprintf(stream, "Backoff Indicator %d. ", backoff_indicator);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
pdu::fprint(stream);
|
|
|
|
pdu::fprint(stream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -861,7 +858,7 @@ bool rar_pdu::write_packet(uint8_t* ptr)
|
|
|
|
if (has_backoff_indicator) {
|
|
|
|
if (has_backoff_indicator) {
|
|
|
|
*(ptr) = backoff_indicator&0xf;
|
|
|
|
*(ptr) = backoff_indicator&0xf;
|
|
|
|
if (nof_subheaders > 0) {
|
|
|
|
if (nof_subheaders > 0) {
|
|
|
|
*(ptr) = 1<<7;
|
|
|
|
*(ptr) |= 1 << 7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ptr++;
|
|
|
|
ptr++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -882,7 +879,12 @@ bool rar_pdu::write_packet(uint8_t* ptr)
|
|
|
|
|
|
|
|
|
|
|
|
void rar_subh::fprint(FILE* stream)
|
|
|
|
void rar_subh::fprint(FILE* stream)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (type == RAPID) {
|
|
|
|
fprintf(stream, "RAPID: %d, Temp C-RNTI: %d, TA: %d, UL Grant: ", preamble, temp_rnti, ta);
|
|
|
|
fprintf(stream, "RAPID: %d, Temp C-RNTI: %d, TA: %d, UL Grant: ", preamble, temp_rnti, ta);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fprintf(stream, "Backoff Indicator %d. ", ((rar_pdu*)parent)->get_backoff());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
srslte_vec_fprint_hex(stream, grant, 20);
|
|
|
|
srslte_vec_fprint_hex(stream, grant, 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -898,6 +900,11 @@ uint32_t rar_subh::get_rapid()
|
|
|
|
return preamble;
|
|
|
|
return preamble;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool rar_subh::has_rapid()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return (type == RAPID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void rar_subh::get_sched_grant(uint8_t grant_[RAR_GRANT_LEN])
|
|
|
|
void rar_subh::get_sched_grant(uint8_t grant_[RAR_GRANT_LEN])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memcpy(grant_, grant, sizeof(uint8_t)*RAR_GRANT_LEN);
|
|
|
|
memcpy(grant_, grant, sizeof(uint8_t)*RAR_GRANT_LEN);
|
|
|
@ -954,6 +961,7 @@ void rar_subh::write_payload(uint8_t** ptr)
|
|
|
|
|
|
|
|
|
|
|
|
void rar_subh::read_payload(uint8_t** ptr)
|
|
|
|
void rar_subh::read_payload(uint8_t** ptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (type == RAPID) {
|
|
|
|
ta = ((uint32_t) * (*ptr + 0) & 0x7f) << 4 | (*(*ptr + 1) & 0xf0) >> 4;
|
|
|
|
ta = ((uint32_t) * (*ptr + 0) & 0x7f) << 4 | (*(*ptr + 1) & 0xf0) >> 4;
|
|
|
|
grant[0] = *(*ptr + 1) & 0x8 ? 1 : 0;
|
|
|
|
grant[0] = *(*ptr + 1) & 0x8 ? 1 : 0;
|
|
|
|
grant[1] = *(*ptr + 1) & 0x4 ? 1 : 0;
|
|
|
|
grant[1] = *(*ptr + 1) & 0x4 ? 1 : 0;
|
|
|
@ -965,12 +973,13 @@ void rar_subh::read_payload(uint8_t** ptr)
|
|
|
|
temp_rnti = ((uint16_t) * (*ptr + 4)) << 8 | *(*ptr + 5);
|
|
|
|
temp_rnti = ((uint16_t) * (*ptr + 4)) << 8 | *(*ptr + 5);
|
|
|
|
*ptr += 6;
|
|
|
|
*ptr += 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool rar_subh::read_subheader(uint8_t** ptr)
|
|
|
|
bool rar_subh::read_subheader(uint8_t** ptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool e_bit = *(*ptr) & 0x80?true:false;
|
|
|
|
bool e_bit = *(*ptr) & 0x80?true:false;
|
|
|
|
bool type = *(*ptr) & 0x40?true:false;
|
|
|
|
type = *(*ptr) & 0x40 ? RAPID : BACKOFF;
|
|
|
|
if (type) {
|
|
|
|
if (type == RAPID) {
|
|
|
|
preamble = *(*ptr) & 0x3f;
|
|
|
|
preamble = *(*ptr) & 0x3f;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
((rar_pdu*)parent)->set_backoff(*(*ptr) & 0xf);
|
|
|
|
((rar_pdu*)parent)->set_backoff(*(*ptr) & 0xf);
|
|
|
|