|
|
@ -515,7 +515,7 @@ void rrc::add_paging_id(uint32_t ueid, LIBLTE_S1AP_UEPAGINGID_STRUCT UEPagingID)
|
|
|
|
// Described in Section 7 of 36.304
|
|
|
|
// Described in Section 7 of 36.304
|
|
|
|
bool rrc::is_paging_opportunity(uint32_t tti, uint32_t* payload_len)
|
|
|
|
bool rrc::is_paging_opportunity(uint32_t tti, uint32_t* payload_len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int sf_pattern[4][4] = {{9, 4, -1, 0}, {-1, 9, -1, 4}, {-1, -1, -1, 5}, {-1, -1, -1, 9}};
|
|
|
|
constexpr static int sf_pattern[4][4] = {{9, 4, -1, 0}, {-1, 9, -1, 4}, {-1, -1, -1, 5}, {-1, -1, -1, 9}};
|
|
|
|
|
|
|
|
|
|
|
|
if (pending_paging.empty()) {
|
|
|
|
if (pending_paging.empty()) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -538,18 +538,25 @@ bool rrc::is_paging_opportunity(uint32_t tti, uint32_t* payload_len)
|
|
|
|
std::vector<uint32_t> ue_to_remove;
|
|
|
|
std::vector<uint32_t> ue_to_remove;
|
|
|
|
|
|
|
|
|
|
|
|
int n = 0;
|
|
|
|
int n = 0;
|
|
|
|
for (auto iter = pending_paging.begin(); n < ASN1_RRC_MAX_PAGE_REC && iter != pending_paging.end(); ++iter) {
|
|
|
|
for (auto& item : pending_paging) {
|
|
|
|
LIBLTE_S1AP_UEPAGINGID_STRUCT u = (LIBLTE_S1AP_UEPAGINGID_STRUCT)iter->second;
|
|
|
|
if (n >= ASN1_RRC_MAX_PAGE_REC) {
|
|
|
|
uint32_t ueid = ((uint32_t)iter->first) % 1024;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
LIBLTE_S1AP_UEPAGINGID_STRUCT u = (LIBLTE_S1AP_UEPAGINGID_STRUCT)item.second;
|
|
|
|
|
|
|
|
uint32_t ueid = ((uint32_t)item.first) % 1024;
|
|
|
|
uint32_t i_s = (ueid / N) % Ns;
|
|
|
|
uint32_t i_s = (ueid / N) % Ns;
|
|
|
|
|
|
|
|
|
|
|
|
if ((sfn % T) == (T / N) * (ueid % N)) {
|
|
|
|
if ((sfn % T) != (T / N) * (ueid % N)) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int sf_idx = sf_pattern[i_s % 4][(Ns - 1) % 4];
|
|
|
|
int sf_idx = sf_pattern[i_s % 4][(Ns - 1) % 4];
|
|
|
|
if (sf_idx < 0) {
|
|
|
|
if (sf_idx < 0) {
|
|
|
|
rrc_log->error("SF pattern is N/A for Ns=%d, i_s=%d, imsi_decimal=%d\n", Ns, i_s, ueid);
|
|
|
|
rrc_log->error("SF pattern is N/A for Ns=%d, i_s=%d, imsi_decimal=%d\n", Ns, i_s, ueid);
|
|
|
|
} else if ((uint32_t)sf_idx == (tti % 10)) {
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((uint32_t)sf_idx == (tti % 10)) {
|
|
|
|
paging_rec->paging_record_list_present = true;
|
|
|
|
paging_rec->paging_record_list_present = true;
|
|
|
|
paging_record_s paging_elem;
|
|
|
|
paging_record_s paging_elem;
|
|
|
|
if (u.choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) {
|
|
|
|
if (u.choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) {
|
|
|
@ -573,7 +580,6 @@ bool rrc::is_paging_opportunity(uint32_t tti, uint32_t* payload_len)
|
|
|
|
rrc_log->info("Assembled paging for ue_id=%d, tti=%d\n", ueid, tti);
|
|
|
|
rrc_log->info("Assembled paging for ue_id=%d, tti=%d\n", ueid, tti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (unsigned int i : ue_to_remove) {
|
|
|
|
for (unsigned int i : ue_to_remove) {
|
|
|
|
pending_paging.erase(i);
|
|
|
|
pending_paging.erase(i);
|
|
|
|