summaryrefslogtreecommitdiffstats
path: root/data/mnet/GP10/Host/Rlc_mac/src/MsgPacketPDCHRelease.cpp
blob: ec40db6642b484234a0b686540355163694568cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// *******************************************************************
//
// (c) Copyright Cisco 2000
// All Rights Reserved
//
// *******************************************************************

// *******************************************************************
//
// File        : MsgPacketPDCHRelease.cpp
// Author(s)   : Tim Olson
// Create Date : 6/5/2000
// Description : 
//
// *******************************************************************

#include "MsgPacketPDCHRelease.h"
#include "logging\vclogging.h"
#include "logging\vcmodules.h"

// *******************************************************************
// PACKET PDCH RELEASE
//
// GSM 04.60 11.2.11
//
// < Packet PDCH Release message content > ::=
//   < PAGE_MODE : bit (2) >
//   { 0 | 1 < TIMESLOTS_AVAILABLE : bit (8) > }
//   < padding bits >
//    ! < Distribution part error : bit (*) = < no string > > ;
//
// *******************************************************************



RlcMacResult MsgPacketPDCHRelease::EncodeMsg(BitStreamOut &dataStream)
{
    DBG_FUNC("MsgPacketPDCHRelease::EncodeMsg", RLC_MAC);
    DBG_ENTER();

    RlcMacResult result = RLC_MAC_SUCCESS;
   
    // Encode the Message Type.
    result = msgType.EncodeMsgType(dataStream);
    RLC_MAC_RESULT_CHECK(result);
   
    // Encode the Page Mode ie.
    //      < PAGE_MODE : bit (2) >
    result = pageMode.EncodeIe(dataStream); 
    RLC_MAC_RESULT_CHECK(result);
          
    // Encode TIMESLOTS_AVAILABLE ie.
    //   { 0 | 1 < TIMESLOTS_AVAILABLE : bit (8) > }
    if (tsAllocation.IsValid())
    {
        dataStream.InsertBits8(1, 1);
        result = tsAllocation.EncodeIe(dataStream);
        RLC_MAC_RESULT_CHECK(result);
    }
    else
    {
        dataStream.InsertBits8(0, 1);
    }
        
    dataStream.PadToOctetBoundary();  
    DBG_LEAVE();
    return (result);
}



void MsgPacketPDCHRelease::DisplayMsgDetail()
{
    DBG_FUNC("MsgPacketPDCHRelease::DisplayMsgDetail", RLC_MAC);
    DBG_ENTER();

    if (viperlog_check_module_filter(RLC_MAC_MSG_DETAIL, LOG_SEVERITY_TRACE))
    {
        // Print out message type.
        MsgDisplayDetailObj.Trace(msgType.DisplayDownlinkMsgType());
      
        // Print out the Page Mode.
        pageMode.DisplayDetails(&MsgDisplayDetailObj);
      
        // Print out Timeslot Allocation ie.
        if (tsAllocation.IsValid())
        {
            tsAllocation.DisplayDetails(&MsgDisplayDetailObj);
        }
    
    }
   
    DBG_LEAVE();
}