OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 } | 392 } |
393 | 393 |
394 void· | 394 void· |
395 LteUeMac::RandomlySelectAndSendRaPreamble () | 395 LteUeMac::RandomlySelectAndSendRaPreamble () |
396 { | 396 { |
397 NS_LOG_FUNCTION (this); | 397 NS_LOG_FUNCTION (this); |
398 // 3GPP 36.321 5.1.1·· | 398 // 3GPP 36.321 5.1.1·· |
399 NS_ASSERT_MSG (m_rachConfigured, "RACH not configured"); | 399 NS_ASSERT_MSG (m_rachConfigured, "RACH not configured"); |
400 // assume that there is no Random Access Preambles group B | 400 // assume that there is no Random Access Preambles group B |
401 m_raPreambleId = m_raPreambleUniformVariable->GetInteger (0, m_rachConfig.numb
erOfRaPreambles - 1); | 401 m_raPreambleId = static_cast<uint8_t>(m_raPreambleUniformVariable->GetInteger
(0, m_rachConfig.numberOfRaPreambles - 1)); |
402 bool contention = true; | 402 bool contention = true; |
403 SendRaPreamble (contention); | 403 SendRaPreamble (contention); |
404 } | 404 } |
405 ··· | 405 ··· |
406 void | 406 void |
407 LteUeMac::SendRaPreamble (bool contention) | 407 LteUeMac::SendRaPreamble (bool contention) |
408 { | 408 { |
409 NS_LOG_FUNCTION (this << (uint32_t) m_raPreambleId << contention); | 409 NS_LOG_FUNCTION (this << (uint32_t) m_raPreambleId << contention); |
410 // Since regular UL LteControlMessages need m_ulConfigured = true in | 410 // Since regular UL LteControlMessages need m_ulConfigured = true in |
411 // order to be sent by the UE, the rach preamble needs to be sent | 411 // order to be sent by the UE, the rach preamble needs to be sent |
412 // with a dedicated primitive (not | 412 // with a dedicated primitive (not |
413 // m_uePhySapProvider->SendLteControlMessage (msg)) so that it can | 413 // m_uePhySapProvider->SendLteControlMessage (msg)) so that it can |
414 // bypass the m_ulConfigured flag. This is reasonable, since In fact | 414 // bypass the m_ulConfigured flag. This is reasonable, since In fact |
415 // the RACH preamble is sent on 6RB bandwidth so the uplink | 415 // the RACH preamble is sent on 6RB bandwidth so the uplink |
416 // bandwidth does not need to be configured.· | 416 // bandwidth does not need to be configured.· |
417 NS_ASSERT (m_subframeNo > 0); // sanity check for subframe starting at 1 | 417 NS_ASSERT (m_subframeNo > 0); // sanity check for subframe starting at 1 |
418 m_raRnti = m_subframeNo - 1; | 418 m_raRnti = static_cast<uint8_t>(m_subframeNo - 1); |
419 m_uePhySapProvider->SendRachPreamble (m_raPreambleId, m_raRnti); | 419 m_uePhySapProvider->SendRachPreamble (m_raPreambleId, m_raRnti); |
420 NS_LOG_INFO (this << " sent preamble id " << (uint32_t) m_raPreambleId << ", R
A-RNTI " << (uint32_t) m_raRnti); | 420 NS_LOG_INFO (this << " sent preamble id " << (uint32_t) m_raPreambleId << ", R
A-RNTI " << (uint32_t) m_raRnti); |
421 // 3GPP 36.321 5.1.4· | 421 // 3GPP 36.321 5.1.4· |
422 Time raWindowBegin = MilliSeconds (3);· | 422 Time raWindowBegin = MilliSeconds (3);· |
423 Time raWindowEnd = MilliSeconds (3 + m_rachConfig.raResponseWindowSize); | 423 Time raWindowEnd = MilliSeconds (3 + m_rachConfig.raResponseWindowSize); |
424 Simulator::Schedule (raWindowBegin, &LteUeMac::StartWaitingForRaResponse, this
); | 424 Simulator::Schedule (raWindowBegin, &LteUeMac::StartWaitingForRaResponse, this
); |
425 m_noRaResponseReceivedEvent = Simulator::Schedule (raWindowEnd, &LteUeMac::RaR
esponseTimeout, this, contention); | 425 m_noRaResponseReceivedEvent = Simulator::Schedule (raWindowEnd, &LteUeMac::RaR
esponseTimeout, this, contention); |
426 } | 426 } |
427 | 427 |
428 void· | 428 void· |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 NS_LOG_FUNCTION (this); | 520 NS_LOG_FUNCTION (this); |
521 m_rnti = rnti; | 521 m_rnti = rnti; |
522 } | 522 } |
523 | 523 |
524 | 524 |
525 void· | 525 void· |
526 LteUeMac::DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t
preambleId, uint8_t prachMask) | 526 LteUeMac::DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t
preambleId, uint8_t prachMask) |
527 { | 527 { |
528 NS_LOG_FUNCTION (this << " rnti" << rnti); | 528 NS_LOG_FUNCTION (this << " rnti" << rnti); |
529 NS_ASSERT_MSG (prachMask == 0, "requested PRACH MASK = " << (uint32_t) prachMa
sk << ", but only PRACH MASK = 0 is supported"); | 529 NS_ASSERT_MSG (prachMask == 0, "requested PRACH MASK = " << (uint32_t) prachMa
sk << ", but only PRACH MASK = 0 is supported"); |
| 530 (void)prachMask; // make compiler happy |
530 m_rnti = rnti; | 531 m_rnti = rnti; |
531 m_raPreambleId = preambleId; | 532 m_raPreambleId = preambleId; |
532 bool contention = false; | 533 bool contention = false; |
533 SendRaPreamble (contention); | 534 SendRaPreamble (contention); |
534 } | 535 } |
535 | 536 |
536 void | 537 void |
537 LteUeMac::DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcC
onfig, LteMacSapUser* msu) | 538 LteUeMac::DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcC
onfig, LteMacSapUser* msu) |
538 { | 539 { |
539 NS_LOG_FUNCTION (this << " lcId" << (uint32_t) lcId); | 540 NS_LOG_FUNCTION (this << " lcId" << (uint32_t) lcId); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 834 |
834 int64_t | 835 int64_t |
835 LteUeMac::AssignStreams (int64_t stream) | 836 LteUeMac::AssignStreams (int64_t stream) |
836 { | 837 { |
837 NS_LOG_FUNCTION (this << stream); | 838 NS_LOG_FUNCTION (this << stream); |
838 m_raPreambleUniformVariable->SetStream (stream); | 839 m_raPreambleUniformVariable->SetStream (stream); |
839 return 1; | 840 return 1; |
840 } | 841 } |
841 | 842 |
842 } // namespace ns3 | 843 } // namespace ns3 |
OLD | NEW |