Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 // ----------------------------------------------------------------------
     19 //
     20 // This Software is an original work of authorship of PacketVideo Corporation.
     21 // Portions of the Software were developed in collaboration with NTT  DoCoMo,
     22 // Inc. or were derived from the public domain or materials licensed from
     23 // third parties.  Title and ownership, including all intellectual property
     24 // rights in and to the Software shall remain with PacketVideo Corporation
     25 // and NTT DoCoMo, Inc.
     26 //
     27 // -----------------------------------------------------------------------
     28 
     29 #include    "tscmain.h"
     30 #include    "h245pri.h"         /* Primitive Infomation Header               */
     31 #include    "h245_deleter.h"    // (RAN-LEAK) - Prototypes for deep delete
     32 #include    "h245_copier.h"     // (RAN-LEAK) - Prototypes for deep copy
     33 #include    "cpvh223multiplex.h"
     34 #include    "logicalchannel.h"
     35 #include    "oscl_mem.h"
     36 #include    "tsc_constants.h"
     37 #include    "tsc_statemanager.h"
     38 #include    "tsc_lc.h"
     39 #include    "tsc_clc.h"
     40 #include    "tsc_blc.h"
     41 #include    "tsc_mt.h"
     42 #include    "tsc_component.h"
     43 #include    "tsc_channelcontrol.h"
     44 #include    "tsc_capability.h"
     45 
     46 // =============================================================
     47 // =============================================================
     48 // =====   HANDLING ROUTINES FOR USER EVENTS (FROM APP)    =====
     49 // =============================================================
     50 // =============================================================
     51 
     52 /*****************************************************************************/
     53 /*  function name        : OpenSession                                   */
     54 /*  input data           : PS_ControlMsgHeader         Dummy Pointer                */
     55 /*  output data          : uint32                 Terminal Status              */
     56 /*  draw time            : '96.10.09                                         */
     57 /*---------------------------------------------------------------------------*/
     58 /*  Note: This one is now called automatically when the TscMain thread      */
     59 /*        is created.  No queue message is required. (RAN)                   */
     60 /*                                                                           */
     61 /*              Copyright (C) 1996 NTT DoCoMo                                */
     62 /*****************************************************************************/
     63 uint32 TSC_324m::OpenSession(void)
     64 {
     65     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
     66                     (0, "TSC_324m: OpenSession.\n"));
     67 
     68     if (iSuppInfoLen)
     69     {
     70         /* Send supp info in UII msg  and wait for TCS from remote terminal */
     71         Tsc_UII_Alphanumeric(iSuppInfo, (uint16)iSuppInfoLen);
     72     }
     73     else
     74     {
     75         CEStart();      // INITIATE CE-SEND
     76         Tsc_IdcVi();    // Send vendor information
     77         MSDStart();     // INITIATE MSD
     78     }
     79     return(PhaseD_CSUP);
     80 }
     81 
     82 // ----------------------------------------------------------------
     83 // NOTE: The 'PhaseF Closing Channels' routines are removed.  (RAN)
     84 // These were:
     85 //   Status09Event12(), Status09Event13(),
     86 //   Status09Event17(), Status09Event18()
     87 // ----------------------------------------------------------------
     88 
     89 // =============================================================
     90 // SessionClose_Comm()
     91 //
     92 // TSC Session Close (in Ongoing Communication) command received from user.
     93 // =============================================================
     94 uint32 TSC_324m::SessionClose_Comm()
     95 {
     96     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
     97                     (0, "TSC_324m: SessionClose_Comm ... Start.\n"));
     98     iTerminalStatus = PhaseF_End;
     99     StopData();
    100     iTSCcomponent->CloseChannels();
    101     /* Primitive Send */
    102     EndSessionCommand();
    103     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    104                     (0, "TSC_324m: EndSession complete.\n"));
    105     return(iTerminalStatus);
    106 }
    107 
    108 // =============================================================
    109 // SessionClose_CSUP()
    110 //
    111 // TSC Session Close (in Call Setup).
    112 // =============================================================
    113 uint32 TSC_324m::SessionClose_CSUP()
    114 {
    115     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    116                     (0, "TSC_324m::SessionClose_CSUP"));
    117     iTerminalStatus = PhaseF_End;
    118     SignalCsupComplete(PVMFFailure);
    119     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    120                     (0, "TSC_324m: EndSession complete."));
    121     return(iTerminalStatus);
    122 }
    123 
    124 
    125 // =============================================================
    126 // =============================================================
    127 // === HANDLING ROUTINES FOR SIGNAL ENTITY EVENTS (FROM 245) ===
    128 // =============================================================
    129 // =============================================================
    130 
    131 /*****************************************************************************/
    132 /*  function name        : LcEtbIdc           E_PtvId_Lc_Etb_Idc  */
    133 /*  function outline     : Status04/Event09 procedure                        */
    134 /*  function discription : Status04Event09( pReceiveInf )                */
    135 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    136 /*  output data          : uint32                 Terminal Status              */
    137 /*  draw time            : '96.10.09                                         */
    138 /*---------------------------------------------------------------------------*/
    139 /*  amendment career(x)  :                                                   */
    140 /*                                                                           */
    141 /*              Copyright (C) 1996 NTT DoCoMo                                */
    142 /*****************************************************************************/
    143 uint32 TSC_324m::LcEtbIdc(PS_ControlMsgHeader pReceiveInf)
    144 {
    145     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    146                     (0, "TSC_324m: LcEtbIdc.\n"));
    147     return iTSCcomponent->LcEtbIdc(pReceiveInf);
    148 }
    149 
    150 /*****************************************************************************/
    151 /*  function name        : Status04Event10           E_PtvId_Lc_Etb_Cfm  */
    152 /*  function outline     : Status04/Event10 procedure                        */
    153 /*  function discription : Status04Event10( pReceiveInf )                */
    154 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    155 /*  output data          : uint32                 Terminal Status              */
    156 /*  draw time            : '96.10.09                                         */
    157 /*---------------------------------------------------------------------------*/
    158 /*  amendment career(x)  :                                                   */
    159 /*                                                                           */
    160 /*              Copyright (C) 1996 NTT DoCoMo                                */
    161 /*****************************************************************************/
    162 uint32 TSC_324m::LcEtbCfm(PS_ControlMsgHeader pReceiveInf)
    163 {
    164     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    165                     (0, "TSC_324m: LcEtbCfm.\n"));
    166     return iTSCcomponent->LcEtbCfm(pReceiveInf);
    167 }
    168 
    169 // =============================================================
    170 // Status04Event11()                     E_PtvId_Lc_Rls_Idc
    171 //
    172 // This is LCSE RELEASE.indication.
    173 // =============================================================
    174 uint32 TSC_324m::LcRlsIdc(PS_ControlMsgHeader pReceiveInf)
    175 {
    176     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    177                     (0, "TSC_324m: LcRlsIdc.\n"));
    178     return iTSCcomponent->LcRlsIdc(pReceiveInf);
    179 }
    180 
    181 /*****************************************************************************/
    182 /*  function name        : Status04Event13           E_PtvId_Lc_Err_Idc  */
    183 /*  function outline     : Status04/Event13 procedure                        */
    184 /*  function discription : Status04Event13( pReceiveInf )                */
    185 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    186 /*  output data          : uint32                 Terminal Status              */
    187 /*  draw time            : '96.10.09                                         */
    188 /*---------------------------------------------------------------------------*/
    189 /*  amendment career(x)  :                                                   */
    190 /*                                                                           */
    191 /*              Copyright (C) 1996 NTT DoCoMo                                */
    192 /*****************************************************************************/
    193 uint32 TSC_324m::LcErrIdc(PS_ControlMsgHeader  pReceiveInf)
    194 {
    195     OSCL_UNUSED_ARG(pReceiveInf);
    196     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    197                     (0, "TSC_324m: Logical channel error indication.\n"));
    198 
    199     /*
    200     ErrCode_Lc_A ,      // ( 6) inappropriate message ( OpenLogicalChannelAck )
    201 
    202     ErrCode_Lc_B ,      // ( 7) inappropriate message ( OpenLogicalChannelReject )
    203 
    204     ErrCode_Lc_C ,      // ( 8) inappropriate message ( CloseLogicalChannelAck )
    205 
    206     ErrCode_Lc_D ,      // ( 9) no response from Peer LCSE / B-LCSE ( Timer T103 Expiry ) */
    207 
    208     /*  switch(pReceiveInf->pParameter){
    209           case ErrCode_Lc_A:
    210             break;
    211           case ErrCode_Lc_B:
    212             break;
    213           case ErrCode_Lc_C:
    214             break;
    215           case ErrCode_Lc_D:
    216             break;
    217         }
    218     */
    219     /* Buffer Free */
    220 //    OSCL_DEFAULT_FREE( pReceiveInf->pParameter );
    221 //    OSCL_DEFAULT_FREE( pReceiveInf );
    222 
    223     return(PhaseE_Comm);
    224 }
    225 
    226 /*****************************************************************************/
    227 /*  function name        : Status04Event14          E_PtvId_Blc_Etb_Idc  */
    228 /*  function outline     : Status04/Event14 procedure                        */
    229 /*  function discription : Status04Event14( pReceiveInf )                */
    230 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    231 /*  output data          : uint32                 Terminal Status              */
    232 /*  draw time            : '96.10.09                                         */
    233 /*---------------------------------------------------------------------------*/
    234 /*  amendment career(x)  :                                                   */
    235 /*                                                                           */
    236 /*              Copyright (C) 1996 NTT DoCoMo                                */
    237 /*****************************************************************************/
    238 uint32 TSC_324m::BlcEtbIdc(PS_ControlMsgHeader pReceiveInf)
    239 {
    240     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    241                     (0, "TSC_324m: BlcEtbIdc.\n"));
    242     return iTSCcomponent->BlcEtbIdc(pReceiveInf);
    243 }
    244 
    245 
    246 /*****************************************************************************/
    247 /*  function name        : Status04Event15          E_PtvId_Blc_Etb_Cfm  */
    248 /*  function outline     : Status04/Event15 procedure                        */
    249 /*  function discription : Status04Event15( pReceiveInf )                */
    250 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    251 /*  output data          : uint32                 Terminal Status              */
    252 /*  draw time            : '96.10.09                                         */
    253 /*---------------------------------------------------------------------------*/
    254 /*  amendment career(x)  :                                                   */
    255 /*                                                                           */
    256 /*              Copyright (C) 1996 NTT DoCoMo                                */
    257 /*****************************************************************************/
    258 uint32 TSC_324m::BlcEtbCfm(PS_ControlMsgHeader pReceiveInf)
    259 {
    260     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    261                     (0, "TSC_324m::BlcEtbCfm forward(%d), reverse(%d))\n",
    262                      pReceiveInf->InfSupplement1,  pReceiveInf->InfSupplement2));
    263     if (iLoopbackMode == PV_LOOPBACK_NONE)
    264     {
    265         iTSCcomponent->BlcEtbCfm(pReceiveInf);
    266     }
    267     return PhaseE_Comm;
    268 }
    269 
    270 // =============================================================
    271 // Status04Event16()                   E_PtvId_Blc_Rls_Idc
    272 //
    273 // This is BLCSE RELEASE.indication.  It is called when
    274 // a Bi-Dir OLCReject is received.  It could be from an incoming or outgoing SE
    275 // =============================================================
    276 uint32 TSC_324m::BlcRlsIdc(PS_ControlMsgHeader pReceiveInf)
    277 {
    278     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    279                     (0, "TSC_324m: BlcRlsIdc.\n"));
    280     return iTSCcomponent->BlcRlsIdc(pReceiveInf);
    281 }
    282 
    283 
    284 /*****************************************************************************/
    285 /*  function name        : Status04Event18          E_PtvId_Blc_Err_Idc  */
    286 /*  function outline     : Status04/Event18 procedure                        */
    287 /*  function discription : Status04Event18( pReceiveInf )                */
    288 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    289 /*  output data          : uint32                 Terminal Status              */
    290 /*  draw time            : '96.10.09                                         */
    291 /*---------------------------------------------------------------------------*/
    292 /*  amendment career(x)  :                                                   */
    293 /*                                                                           */
    294 /*              Copyright (C) 1996 NTT DoCoMo                                */
    295 /*****************************************************************************/
    296 uint32 TSC_324m::BlcErrIdc(PS_ControlMsgHeader  pReceiveInf)
    297 {
    298     OSCL_UNUSED_ARG(pReceiveInf);
    299     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    300                     (0, "TSC_324m::BlcErrIdc "));
    301     return PhaseE_Comm;
    302 }
    303 
    304 /*****************************************************************************/
    305 /*  function name        : Status04Event22           E_PtvId_Mt_Trf_Idc  */
    306 /*  function outline     : Status04/Event22 procedure                        */
    307 /*  function discription : Status04Event22( pReceiveInf )                */
    308 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    309 /*  output data          : uint32                 Terminal Status              */
    310 /*  draw time            : '96.10.09                                         */
    311 /*---------------------------------------------------------------------------*/
    312 /*  amendment career(x)  :                                                   */
    313 /*                                                                           */
    314 /*              Copyright (C) 1996 NTT DoCoMo                                */
    315 /*****************************************************************************/
    316 uint32 TSC_324m::Status04Event22(PS_ControlMsgHeader  pReceiveInf)
    317 {
    318     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    319                     (0, "TSC_324m::Status04Event22"));
    320     return MuxTableTransferIndication(pReceiveInf);
    321 }
    322 
    323 uint32 TSC_324m::MuxTableTransferIndication(PS_ControlMsgHeader  pReceiveInf)
    324 {
    325     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    326                     (0, "TSC_324m::MuxTableTransferIndication, wnsrp status=%d",
    327                      iSrp->WnsrpStatusGet()));
    328     PS_MuxDescriptor pMux = (PS_MuxDescriptor)pReceiveInf->pParameter;
    329     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    330                     (0, "TSC_324m::Status04Event22 Received mux entries sn=%d, num mux entries=%d",
    331                      pReceiveInf->InfSupplement1, pMux->size_of_multiplexEntryDescriptors));
    332 
    333     CPVMultiplexDescriptor desc(pMux);
    334     ((CPVH223Multiplex*)iH223)->SetIncomingMuxTableEntries(&desc);
    335 
    336     /* If WNSRP is enabled and Mux Entry TSC_WNSRP_MUX_ENTRY_NUMBER is received, disable WNSRP */
    337     if (iSrp->WnsrpStatusGet() == SRP::WNSRP_TX_SUPPORT)
    338     {
    339         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    340                         (0, "TSC_324m::Status04Event22 WNSRP is ON.  Checking for mux entry 15."));
    341         for (unsigned entry_num = 0; entry_num < (unsigned)pMux->size_of_multiplexEntryDescriptors; entry_num++)
    342         {
    343             if (pMux->multiplexEntryDescriptors[entry_num].multiplexTableEntryNumber ==
    344                     TSC_WNSRP_MUX_ENTRY_NUMBER)
    345             {
    346                 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    347                                 (0, "TSC_324m::Status04Event22 Received new descriptor for mux entry 15.  Disabling WNSRP."));
    348                 iSrp->DisableWNSRPSupport();
    349                 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    350                                 (0, "TSC_324m::Status04Event22 Received new descriptor for mux entry 15.  Flushing control channel."));
    351                 /* Flush the control logical channel */
    352                 PVMFStatus aStatus = PVMFFailure;
    353                 H223OutgoingChannelPtr outgoing_control_channel;
    354                 aStatus = iH223->GetOutgoingChannel(0, outgoing_control_channel);
    355                 if (aStatus == PVMFSuccess)
    356                 {
    357                     outgoing_control_channel->Flush();
    358                 }
    359                 else
    360                 {
    361                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING,
    362                                     (0, "TSC_324m::MuxTableTransferIndication Error - Failed to lookup logical channel 0"));
    363                     return iTerminalStatus;
    364                 }
    365                 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    366                                 (0, "TSC_324m::Status04Event22 Received new descriptor for mux entry 15.  Done."));
    367                 break;
    368             }
    369         }
    370     }
    371     /* TRANSFER.response(MT) Primitive Send */
    372     iTSCmt.MtTrfRps(pReceiveInf->InfSupplement1, pMux); // Pass pMux on for response.
    373     desc.descriptor = NULL;
    374     return 0;
    375 }
    376 
    377 /*****************************************************************************/
    378 /*  function name        : Status04Event23            E_PtvId_Mt_Trf_Cfm */
    379 /*  function outline     : Status04/Event23 procedure                        */
    380 /*  function discription : Status04Event23( pReceiveInf )                */
    381 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    382 /*  output data          : uint32                 Terminal Status              */
    383 /*  draw time            : '96.10.09                                         */
    384 /*---------------------------------------------------------------------------*/
    385 /*  amendment career(x)  :                                                   */
    386 /*                                                                           */
    387 /*              Copyright (C) 1996 NTT DoCoMo                                */
    388 /*****************************************************************************/
    389 uint32 TSC_324m::Status04Event23(PS_ControlMsgHeader  pReceiveInf)
    390 {
    391     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    392                     (0, "TSC_324m::Status04Event23 sn=%d", pReceiveInf->InfSupplement1));
    393     iTSCcomponent->MuxTableSendComplete(pReceiveInf->InfSupplement1, PVMFSuccess);
    394     return 0;
    395 }
    396 
    397 
    398 OsclAny TSC_324m::TcsMsdComplete()
    399 {
    400     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    401                     (0, "TSC_324m::TcsMsdComplete"));
    402     SignalCsupComplete(PVMFSuccess);
    403     iTSCcomponent->TcsMsdComplete();
    404 }
    405 
    406 OsclAny TSC_324m::SignalCsupComplete(PVMFStatus status)
    407 {
    408     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    409                     (0, "TSC_324m::SignalCsupComplete(%d)\n", status));
    410     iObserver->ConnectComplete(status);
    411     // update the node state
    412     if (status == PVMFSuccess)
    413     {
    414         iTerminalStatus = PhaseE_Comm;
    415     }
    416 }
    417 
    418 /*****************************************************************************/
    419 /*  function name        : Status04Event24            E_PtvId_Mt_Rjt_Idc */
    420 /*  function outline     : Status04/Event24 procedure                        */
    421 /*  function discription : Status04Event24( pReceiveInf )                */
    422 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    423 /*  output data          : uint32                 Terminal Status              */
    424 /*  draw time            : '96.10.09                                         */
    425 /*---------------------------------------------------------------------------*/
    426 /*  amendment career(x)  :                                                   */
    427 /*                                                                           */
    428 /*              Copyright (C) 1996 NTT DoCoMo                                */
    429 /*****************************************************************************/
    430 uint32 TSC_324m::Status04Event24(PS_ControlMsgHeader  pReceiveInf)
    431 {
    432     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING,
    433                     (0, "TSC_324m::Status04Event24 Mux table reject received dir(%d), sn(%d)",
    434                      pReceiveInf->InfSupplement1, pReceiveInf->InfSupplement2));
    435     if ((S_InfHeader::TDirection)pReceiveInf->InfSupplement1 == S_InfHeader::OUTGOING)
    436     {
    437         iTSCcomponent->MuxTableSendComplete(pReceiveInf->InfSupplement2,
    438                                             PVMFFailure);
    439     }
    440     return(PhaseD_CSUP);
    441 }
    442 
    443 // =============================================================
    444 // Status04Event50()                  E_PtvId_Blc_Etb_Cfm2
    445 //
    446 // This is "BLCSE ESTABLISH.confirm2"
    447 // It is called when SE receives an OLCConfirm (Bi-Dir).
    448 // =============================================================
    449 uint32 TSC_324m::BlcEtbCfm2(PS_ControlMsgHeader  pReceiveInf)
    450 {
    451     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    452                     (0, "TSC_324m: BlcEtbCfm2.\n"));
    453     return iTSCcomponent->BlcEtbCfm2(pReceiveInf);
    454 }
    455 
    456 
    457 /*****************************************************************************/
    458 /*  function name        : Status08Event12           E_PtvId_Lc_Rls_Cfm  */
    459 /*  function outline     : Status08/Event12 procedure                        */
    460 /*  function discription : Status08Event12( pReceiveInf )                */
    461 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    462 /*  output data          : uint32                 Terminal Status              */
    463 /*  draw time            : '00.4.13                                          */
    464 /*---------------------------------------------------------------------------*/
    465 uint32 TSC_324m::LcRlsCfm(PS_ControlMsgHeader pReceiveInf)
    466 {
    467     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    468                     (0, "TSC_324m: LcRlsCfm.\n"));
    469     iTSCcomponent->LcRlsCfm(pReceiveInf);
    470     return(PhaseE_Comm);
    471 }
    472 
    473 
    474 /*****************************************************************************/
    475 /*  function name        : Status08Event17          E_PtvId_Blc_Rls_Cfm  */
    476 /*  function outline     : Status08/Event17 procedure                        */
    477 /*  function discription : Status08Event17( pReceiveInf )                */
    478 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    479 /*  output data          : uint32                 Terminal Status              */
    480 /*  draw time            : '00.4.13                                         */
    481 /*---------------------------------------------------------------------------*/
    482 /* RAN - Bi-Dir OLCAck */
    483 uint32 TSC_324m::BlcRlsCfm(PS_ControlMsgHeader pReceiveInf)
    484 {
    485     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    486                     (0, "TSC_324m: BlcRlsCfm.\n"));
    487     iTSCcomponent->BlcRlsCfm(pReceiveInf);
    488     return(PhaseE_Comm);
    489 }
    490 
    491 /*****************************************************************************/
    492 /*  function name        : Status08Event19          E_PtvId_Clc_Cls_Idc  */
    493 /*  function outline     : Status08/Event19 procedure                        */
    494 /*  function discription : Status08Event19( pReceiveInf )                */
    495 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    496 /*  output data          : uint32                 Terminal Status              */
    497 /*  draw time            : '96.10.09                                         */
    498 /*---------------------------------------------------------------------------*/
    499 /*  amendment career(x)  :                                                   */
    500 /*                                                                           */
    501 /*              Copyright (C) 1996 NTT DoCoMo                                */
    502 /*****************************************************************************/
    503 uint32 TSC_324m::Status08Event19(PS_ControlMsgHeader pReceiveInf)
    504 {
    505     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    506                     (0, "TSC_324m: Status08Event19.\n"));
    507     return iTSCcomponent->Status08Event19(pReceiveInf);
    508 }
    509 
    510 /*****************************************************************************/
    511 /*  function name        : Status08Event20          E_PtvId_Clc_Cls_Cfm  */
    512 /*  function outline     : Status08/Event20 procedure                        */
    513 /*  function discription : Status08Event20( pReceiveInf )                */
    514 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    515 /*  output data          : uint32                 Terminal Status              */
    516 /*  draw time            : '96.10.09                                         */
    517 /*---------------------------------------------------------------------------*/
    518 /*  amendment career(x)  :                                                   */
    519 /*                                                                           */
    520 /*              Copyright (C) 1996 NTT DoCoMo                                */
    521 /*****************************************************************************/
    522 uint32 TSC_324m::Status08Event20(PS_ControlMsgHeader  pReceiveInf)
    523 {
    524     OSCL_UNUSED_ARG(pReceiveInf);
    525     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    526                     (0, "TSC_324m: RequestChannelClose(S)...Complete\n"));
    527     return(PhaseE_Comm);
    528 }
    529 
    530 /*****************************************************************************/
    531 /*  function name        : Status08Event21           E_PtvId_Clc_Rjt_Idc */
    532 /*  function outline     : Status08/Event21 procedure                        */
    533 /*  function discription : Status08Event21( pReceiveInf )                */
    534 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    535 /*  output data          : uint32                 Terminal Status              */
    536 /*  draw time            : '96.10.09                                         */
    537 /*---------------------------------------------------------------------------*/
    538 /*  amendment career(x)  :                                                   */
    539 /*                                                                           */
    540 /*              Copyright (C) 1996 NTT DoCoMo                                */
    541 /*****************************************************************************/
    542 uint32 TSC_324m::Status08Event21(PS_ControlMsgHeader  pReceiveInf)
    543 {
    544     OSCL_UNUSED_ARG(pReceiveInf);
    545     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    546                     (0, "TSC_324m: RequestChannelClose(%d)...Failed\n", pReceiveInf->InfSupplement1));
    547     return(PhaseE_Comm);
    548 }
    549 
    550 /*****************************************************************************/
    551 /*  function name        : Status08Event22            E_PtvId_Mt_Trf_Idc */
    552 /*  function outline     : Status08/Event22 procedure                        */
    553 /*  function discription : Status08Event22( pReceiveInf )                */
    554 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    555 /*  output data          : uint32                 Terminal Status              */
    556 /*  draw time            : '96.10.09                                         */
    557 /*---------------------------------------------------------------------------*/
    558 /*  amendment career(x)  :                                                   */
    559 /*                                                                           */
    560 /*              Copyright (C) 1996 NTT DoCoMo                                */
    561 /*****************************************************************************/
    562 uint32 TSC_324m::Status08Event22(PS_ControlMsgHeader  pReceiveInf)
    563 {
    564     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    565                     (0, "TSC_324m::Status08Event22 Received mux entries sn=%d",
    566                      pReceiveInf->InfSupplement1));
    567     return MuxTableTransferIndication(pReceiveInf);
    568 }
    569 
    570 /*****************************************************************************/
    571 /*  function name        : Status08Event23            E_PtvId_Mt_Trf_Cfm */
    572 /*  function outline     : Status08/Event23 procedure                        */
    573 /*  function discription : Status08Event23( pReceiveInf )                */
    574 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    575 /*  output data          : uint32                 Terminal Status              */
    576 /*  draw time            : '96.10.09                                         */
    577 /*---------------------------------------------------------------------------*/
    578 /*  amendment career(x)  :                                                   */
    579 /*                                                                           */
    580 /*              Copyright (C) 1996 NTT DoCoMo                                */
    581 /*****************************************************************************/
    582 uint32 TSC_324m::Status08Event23(PS_ControlMsgHeader  pReceiveInf)
    583 {
    584     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    585                     (0, "TSC_324m::Status04Event23 sn=%d",
    586                      pReceiveInf->InfSupplement1));
    587     iTSCcomponent->MuxTableSendComplete(pReceiveInf->InfSupplement1,
    588                                         PVMFSuccess);
    589     return(PhaseE_Comm);
    590 }
    591 
    592 /*****************************************************************************/
    593 /*  function name        : Status08Event24            E_PtvId_Mt_Rjt_Idc */
    594 /*  function outline     : Status08/Event24 procedure                        */
    595 /*  function discription : Status08Event24( pReceiveInf )                */
    596 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    597 /*  output data          : uint32                 Terminal Status              */
    598 /*  draw time            : '96.10.09                                         */
    599 /*---------------------------------------------------------------------------*/
    600 /*  amendment career(x)  :                                                   */
    601 /*                                                                           */
    602 /*              Copyright (C) 1996 NTT DoCoMo                                */
    603 /*****************************************************************************/
    604 uint32 TSC_324m::Status08Event24(PS_ControlMsgHeader  pReceiveInf)
    605 {
    606     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING,
    607                     (0, "TSC_324m::Status08Event24 Mux table reject received dir(%d), sn(%d)",
    608                      pReceiveInf->InfSupplement1, pReceiveInf->InfSupplement2));
    609     if ((S_InfHeader::TDirection)pReceiveInf->InfSupplement1 ==
    610             S_InfHeader::OUTGOING)
    611     {
    612         iTSCcomponent->MuxTableSendComplete(pReceiveInf->InfSupplement2,
    613                                             PVMFFailure);
    614     }
    615     return(PhaseE_Comm);
    616 }
    617 
    618 /*****************************************************************************/
    619 /*  function name        : Status08Event25          E_PtvId_Rme_Send_Idc */
    620 /*  function outline     : Status08/Event25 procedure                        */
    621 /*  function discription : Status08Event25( pReceiveInf )                */
    622 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    623 /*  output data          : uint32                 Terminal Status              */
    624 /*  draw time            : '96.10.09                                         */
    625 /*---------------------------------------------------------------------------*/
    626 /*  amendment career(x)  :                                                   */
    627 /*                                                                           */
    628 /*              Copyright (C) 1996 NTT DoCoMo                                */
    629 /*****************************************************************************/
    630 uint32 TSC_324m::Status08Event25(PS_ControlMsgHeader  pReceiveInf)
    631 {
    632     OSCL_UNUSED_ARG(pReceiveInf);
    633     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    634                     (0, "TSC_324m::Status08Event25 RME received.  Rejecting it."));
    635     RmeRjtReq();
    636     return(PhaseE_Comm);
    637 }
    638 
    639 /*****************************************************************************/
    640 /*  function name        : Status08Event26          E_PtvId_Rme_Send_Cfm */
    641 /*  function outline     : Status08/Event26 procedure                        */
    642 /*  function discription : Status08Event26( pReceiveInf )                */
    643 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    644 /*  output data          : uint32                 Terminal Status              */
    645 /*  draw time            : '96.10.09                                         */
    646 /*---------------------------------------------------------------------------*/
    647 /*  amendment career(x)  :                                                   */
    648 /*                                                                           */
    649 /*              Copyright (C) 1996 NTT DoCoMo                                */
    650 /*****************************************************************************/
    651 uint32 TSC_324m::Status08Event26(PS_ControlMsgHeader  pReceiveInf)
    652 {
    653     OSCL_UNUSED_ARG(pReceiveInf);
    654     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    655                     (0, "TSC: RME complete.\n"));
    656 
    657     return(PhaseE_Comm);
    658 }
    659 
    660 /*****************************************************************************/
    661 /*  function name        : Status08Event27         E_PtvId_Rme_Rjt_Idc   */
    662 /*  function outline     : Status08/Event27 procedure                        */
    663 /*  function discription : Status08Event27( pReceiveInf )                */
    664 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    665 /*  output data          : uint32                 Terminal Status              */
    666 /*  draw time            : '96.10.09                                         */
    667 /*---------------------------------------------------------------------------*/
    668 /*  amendment career(x)  :                                                   */
    669 /*                                                                           */
    670 /*              Copyright (C) 1996 NTT DoCoMo                                */
    671 /*****************************************************************************/
    672 uint32 TSC_324m::Status08Event27(PS_ControlMsgHeader  pReceiveInf)
    673 {
    674     OSCL_UNUSED_ARG(pReceiveInf);
    675     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    676                     (0, "TSC: RME failed: reject indication.\n"));
    677     /*  NO ACTION FOR NOW.  MAY WANT TO ADD BETTER HANDLING LATER.
    678     */
    679     return(PhaseE_Comm);
    680 }
    681 
    682 /*****************************************************************************/
    683 /*  function name        : ModeRequestIndication           E_PtvId_Mr_Trf_Idc  */
    684 /*  function outline     : ModeRequestIndication procedure                        */
    685 /*  function discription : ModeRequestIndication( pReceiveInf )                */
    686 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    687 /*  output data          : uint32                 Terminal Status              */
    688 /*  draw time            : '96.10.09                                         */
    689 /*---------------------------------------------------------------------------*/
    690 /*  amendment career(x)  :                                                   */
    691 /*                                                                           */
    692 /*              Copyright (C) 1996 NTT DoCoMo                                */
    693 /*****************************************************************************/
    694 /* WWURM: modified to handle incoming request mode message */
    695 uint32 TSC_324m::ModeRequestIndication(PS_ControlMsgHeader  pReceiveInf)
    696 {
    697     OSCL_UNUSED_ARG(pReceiveInf);
    698     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    699                     (0, "TSC_324m::ModeRequestIndication"));
    700     MrRjtReq();
    701     return(PhaseE_Comm);
    702 }
    703 
    704 // -------------------------------------------------
    705 // getModeRequestInfo()
    706 //
    707 // WWURM: help function for request mode message.
    708 // -------------------------------------------------
    709 OsclAny TSC_324m::getModeRequestInfo(PS_ControlMsgHeader pReceiveInf,
    710                                      int32 *param1, int32 *param2)
    711 {
    712     OSCL_UNUSED_ARG(pReceiveInf);
    713     OSCL_UNUSED_ARG(param2);
    714     OSCL_UNUSED_ARG(param1);
    715 }
    716 
    717 /*****************************************************************************/
    718 /*  function name        : Status08Event29           E_PtvId_Mr_Trf_Cfm  */
    719 /*  function outline     : Status08/Event29 procedure                        */
    720 /*  function discription : Status08Event29( pReceiveInf )                */
    721 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    722 /*  output data          : uint32                 Terminal Status              */
    723 /*  draw time            : '96.10.09                                         */
    724 /*---------------------------------------------------------------------------*/
    725 /*  amendment career(x)  :                                                   */
    726 /*                                                                           */
    727 /*              Copyright (C) 1996 NTT DoCoMo                                */
    728 /*****************************************************************************/
    729 uint32 TSC_324m::Status08Event29(PS_ControlMsgHeader  pReceiveInf)
    730 {
    731     OSCL_UNUSED_ARG(pReceiveInf);
    732     return(PhaseE_Comm);
    733 }
    734 
    735 /*****************************************************************************/
    736 /*  function name        : Status08Event30            E_PtvId_Mr_Rjt_Idc */
    737 /*  function outline     : Status08/Event30 procedure                        */
    738 /*  function discription : Status08Event30( pReceiveInf )                */
    739 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    740 /*  output data          : uint32                 Terminal Status              */
    741 /*  draw time            : '96.10.09                                         */
    742 /*---------------------------------------------------------------------------*/
    743 /*  amendment career(x)  :                                                   */
    744 /*                                                                           */
    745 /*              Copyright (C) 1996 NTT DoCoMo                                */
    746 /*****************************************************************************/
    747 uint32 TSC_324m::Status08Event30(PS_ControlMsgHeader  pReceiveInf)
    748 {
    749     OSCL_UNUSED_ARG(pReceiveInf);
    750     return(PhaseE_Comm);
    751 }
    752 
    753 /*****************************************************************************/
    754 /*  function name        : Status08Event31           E_PtvId_Rtd_Trf_Cfm */
    755 /*  function outline     : Status08/Event31 procedure                        */
    756 /*  function discription : Status08Event31( pReceiveInf )                */
    757 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    758 /*  output data          : uint32                 Terminal Status              */
    759 /*  draw time            : '96.10.09                                         */
    760 /*---------------------------------------------------------------------------*/
    761 /*  amendment career(x)  :                                                   */
    762 /*                                                                           */
    763 /*              Copyright (C) 1996 NTT DoCoMo                                */
    764 /*****************************************************************************/
    765 uint32 TSC_324m::Status08Event31(PS_ControlMsgHeader  pReceiveInf)
    766 {
    767     OSCL_UNUSED_ARG(pReceiveInf);
    768     uint32 rtd = (uint32)((PS_Delay_Rtd)pReceiveInf->pParameter)->Delay_Value;
    769     iNumRtdRequests++;
    770 
    771     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    772                     (0, "TSC_324m::Status08Event31 - iNumRtdRequests = %d, RTD = %d ms",
    773                      iNumRtdRequests, rtd));
    774     iRtdAve += rtd;
    775     if (rtd < iRtdMin)
    776     {
    777         iRtdMin = rtd;
    778     }
    779     if (rtd > iRtdMax)
    780     {
    781         iRtdMax = rtd;
    782     }
    783 
    784     return(PhaseE_Comm);
    785 }
    786 
    787 /*****************************************************************************/
    788 /*  function name        : Status08Event32           E_PtvId_Rtd_Exp_Idc */
    789 /*  function outline     : Status08/Event32 procedure                        */
    790 /*  function discription : Status08Event32( pReceiveInf )                */
    791 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    792 /*  output data          : uint32                 Terminal Status              */
    793 /*  draw time            : '96.10.09                                         */
    794 /*---------------------------------------------------------------------------*/
    795 /*  amendment career(x)  :                                                   */
    796 /*                                                                           */
    797 /*              Copyright (C) 1996 NTT DoCoMo                                */
    798 /*****************************************************************************/
    799 uint32 TSC_324m::Status08Event32(PS_ControlMsgHeader  pReceiveInf)
    800 {
    801     OSCL_UNUSED_ARG(pReceiveInf);
    802     return(PhaseE_Comm);
    803 }
    804 
    805 //===============================================================
    806 // SendTerminalCapabilitySet()               E_PtvId_Cmd_Stcs_Cfm (RAN)
    807 //
    808 // Handle a received SendTerminalCapabilitySet codeword.
    809 //===============================================================
    810 uint32 TSC_324m::SendTerminalCapabilitySet(PS_ControlMsgHeader  pReceiveInf)
    811 {
    812     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    813                     (0, "TSC_324m::SendTerminalCapabilitySet"));
    814     OSCL_UNUSED_ARG(pReceiveInf);
    815     CEStart();
    816     return(PhaseE_Comm);
    817 }
    818 
    819 //===============================================================
    820 // FlowControlCommandReceived()                 E_PtvId_Cmd_Fc_Cfm (RAN)
    821 //
    822 // This routine handles a received FlowControl (FC) command.
    823 // For now it does nothing but print the command received message.
    824 // But later we should pass the received params up to application layer.
    825 //===============================================================
    826 uint32 TSC_324m::FlowControlCommandReceived(PS_ControlMsgHeader  pReceiveInf)
    827 {
    828     OSCL_UNUSED_ARG(pReceiveInf);
    829     SendFunctionNotSupportedIndication(2, pReceiveInf->EncodedMsg,
    830                                        (uint16)pReceiveInf->EncodedMsgSize);//unknown function
    831 
    832     return(PhaseE_Comm);
    833 }
    834 
    835 //===============================================================
    836 // MiscCmdRecv()              E_PtvId_Cmd_Mscl_Cfm (RAN)
    837 //
    838 // This routine handles a received Miscellaneous (MSCL) command.
    839 //===============================================================
    840 uint32 TSC_324m::MiscCmdRecv(PS_ControlMsgHeader  pReceiveInf)
    841 {
    842     PS_MiscellaneousCommand mc;
    843     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    844                     (0, "TSC_324m::MiscCmdRecv - Received Miscellaneous command"));
    845     mc = (PS_MiscellaneousCommand) pReceiveInf->pParameter;
    846 
    847     // if command is a request for new I-Frame, then verify outgoing
    848     // channel exists and request new I-Frame from observer
    849     if (mc->mcType.index == 5)    // 5 = videoFastUpdatePicture
    850     {
    851         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    852                         (0, "TSC_324m: MiscCmdRecv - Received videoFastUpdatePicture, lcn(%d)\n",
    853                          mc->logicalChannelNumber));
    854         if (iTerminalStatus != PhaseE_Comm)
    855         {
    856             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    857                             (0, "TSC_324m: MiscCmdRecv Error - invalid state(%d)",
    858                              iTerminalStatus));
    859             return iTerminalStatus;
    860         }
    861         H223OutgoingChannelPtr lcn;
    862         PVMFStatus aStatus = iH223->GetOutgoingChannel(mc->logicalChannelNumber,
    863                              lcn);
    864         if (aStatus != PVMFSuccess)
    865         {
    866             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    867                             (0, "TSC_324m::MiscCmdRecv Error - Request I-Frame for invalid channel ID=%d",
    868                              mc->logicalChannelNumber));
    869             return iTerminalStatus;
    870         }
    871         if (iObserver) iObserver->RequestFrameUpdate(lcn);
    872     }
    873     if (mc->mcType.index == 7)    // 7 = videoSpatialTemporalTradeoff
    874     {
    875         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    876                         (0, "TSC_324m: MiscCmdRecv - Received videoTemporalSpatialTradeOff lcn(%d), value(%d)",
    877                          mc->logicalChannelNumber, mc->mcType.videoTemporalSpatialTradeOff));
    878         if (iTerminalStatus != PhaseE_Comm)
    879         {
    880             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    881                             (0, "TSC_324m: MiscCmdRecv Error - invalid state(%d)",
    882                              iTerminalStatus));
    883             return iTerminalStatus;
    884         }
    885         if (iTSC_324mObserver)
    886         {
    887             iTSC_324mObserver->VideoSpatialTemporalTradeoffCommandReceived(mc->logicalChannelNumber,
    888                     mc->mcType.videoTemporalSpatialTradeOff);
    889         }
    890     }
    891     else if (mc->mcType.index == 11)   // 11 = maxMuxPduSize
    892     {
    893         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    894                         (0, "TSC_324m: MiscCmdRecv - Received maxMuxPduSize, size(%d)\n",
    895                          mc->mcType.maxH223MUXPDUsize));
    896         TPVStatusCode ret = iH223->SetMaxOutgoingPduSize(mc->mcType.maxH223MUXPDUsize);
    897         if (ret != EPVT_Success)
    898         {
    899             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    900                             (0, "TSC_324m: Error - Request maxMuxPduSize(%d), error(%d)\n",
    901                              mc->mcType.maxH223MUXPDUsize, ret));
    902         }
    903     }
    904     return(iTerminalStatus);
    905 }
    906 
    907 //===============================================================
    908 // Status08Event55()               E_PtvId_Cmd_Hmr_Cfm (RAN)
    909 //
    910 // This routine handles a received H223MultiplexReconfiguration (HMR) command.
    911 // For now it does nothing but print the command received message.
    912 // But later we should pass the received params up to application layer.
    913 //===============================================================
    914 uint32 TSC_324m::Status08Event55(PS_ControlMsgHeader  pReceiveInf)
    915 {
    916     OSCL_UNUSED_ARG(pReceiveInf);
    917     SendFunctionNotSupportedIndication(2, pReceiveInf->EncodedMsg,
    918                                        (uint16)pReceiveInf->EncodedMsgSize);//unknown function
    919     return(PhaseE_Comm);
    920 }
    921 
    922 /*****************************************************************************/
    923 /*  function name        : EndSessionRecv          E_PtvId_Cmd_Es_Cfm    */
    924 /*  function outline     : EndSessionCommand Receive procedure               */
    925 /*  function discription : EndSessionRecv( pReceiveInf )                 */
    926 /*  input data           : PS_ControlMsgHeader         Receive InfHeader Pointer    */
    927 /*  output data          : uint32                 Terminal Status              */
    928 /*  draw time            : '96.10.09                                         */
    929 /*---------------------------------------------------------------------------*/
    930 /*  amendment career(x)  :                                                   */
    931 /*                                                                           */
    932 /*              Copyright (C) 1996 NTT DoCoMo                                */
    933 /*****************************************************************************/
    934 uint32 TSC_324m::EndSessionRecv(PS_ControlMsgHeader  pReceiveInf)
    935 {
    936     OSCL_UNUSED_ARG(pReceiveInf);
    937     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    938                     (0, "TSC_324m::EndSessionRecv"));
    939     iDisconnectInitiator |= EPVT_REMOTE;
    940     switch (iInterfaceState)
    941     {
    942         case EPVMFNodeStarted:
    943         case EPVMFNodePaused:
    944             iObserver->DisconnectRequestReceived();
    945             break;
    946         default:
    947             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    948                             (0, "EndSession...Received in invalid state"));
    949             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE,
    950                             (0, "TSC_324m::EndSessionRecv Ignoring end session due to invalid state(%d)",
    951                              iInterfaceState));
    952     }
    953     StopData();
    954     iTSCcomponent->CloseChannels();
    955     return PhaseF_End;
    956 }
    957 
    958 
    959 // ===============================================================
    960 // StopData()
    961 //
    962 // Sets flags in the H324 system table which stop data transmission
    963 // for each open, outgoing logical channel.
    964 // ================================================================
    965 OsclAny TSC_324m::StopData()
    966 {
    967     iTSCcomponent->StopData();
    968 }
    969 
    970 
    971 // ======================================================
    972 // GetDecoderConfigFromOLC()
    973 //
    974 // Returns the decoder configuration info from an incoming
    975 // OLC codeword.  The info is copied from either the
    976 // Forward or Reverse LogicalChannelParameters, depending
    977 // on the value of input argument forRev:
    978 //
    979 //     forRev = 0  --> info from Forward Parameters
    980 //     forRev = 1  --> info from Reverse Parameters
    981 //
    982 // Note that if 'pPara' does not have genericVideo description
    983 //   (i.e. MPEG4), then a NULL string is returned.
    984 // =======================================================
    985 uint8* GetDecoderConfigFromOLC(PS_ForwardReverseParam pPara, uint32 forRev, uint16 *nOctets)
    986 {
    987     uint32 i = 0, n = 0;
    988     PS_GenericCapability pGenericCap = NULL;
    989     PS_GenericParameter nonCollapsing = NULL;
    990     uint8* ret = NULL;
    991 
    992     if (forRev)     /* reverse */
    993     {
    994         if (pPara->reverseLogicalChannelParameters.dataType.videoData->index == 5) /* genericVideoCapability */
    995         {
    996             pGenericCap = pPara->reverseLogicalChannelParameters.dataType.videoData->genericVideoCapability;
    997         }
    998     }
    999     else        /* forward  */
   1000     {
   1001         if (pPara->forwardLogicalChannelParameters.dataType.videoData->index == 5) /* genericVideoCapability */
   1002         {
   1003             pGenericCap = pPara->forwardLogicalChannelParameters.dataType.videoData->genericVideoCapability;
   1004         }
   1005     }
   1006 
   1007     if (pGenericCap != NULL)    /* Search for decoderConfig parameters */
   1008     {
   1009         n = pGenericCap->size_of_nonCollapsing;
   1010         for (i = 0; i < n; i++)
   1011         {
   1012             nonCollapsing = &pGenericCap->nonCollapsing[i];
   1013             if (nonCollapsing->parameterIdentifier.standard == 2)
   1014             {
   1015                 *nOctets = nonCollapsing->parameterValue.octetString->size;
   1016                 ret = (uint8*) OSCL_DEFAULT_MALLOC(*nOctets);
   1017                 oscl_memcpy(ret, nonCollapsing->parameterValue.octetString->data, *nOctets);
   1018                 return ret;
   1019             }
   1020         }
   1021     }
   1022     *nOctets = 0;   /* None found; return empty string */
   1023     return NULL;
   1024 }
   1025 
   1026 // =========================================================
   1027 // ShowTsc()
   1028 //
   1029 // This function takes an output analysis line, adds the
   1030 // proper indent, and sends the result out to the display
   1031 // routine.  The 'tag' argument is simply passed on.
   1032 // =========================================================
   1033 OsclAny TSC_324m::ShowTsc(uint16 tag, uint16 indent, char* inString)
   1034 {
   1035     OSCL_UNUSED_ARG(inString);
   1036     OSCL_UNUSED_ARG(indent);
   1037     OSCL_UNUSED_ARG(tag);
   1038 #ifdef PVTsc_Analyzer
   1039     uint32 i;
   1040     char outString[200];
   1041 
   1042     /* Construct outString with proper indent */
   1043     for (i = 0; i < indent; ++i)
   1044     {
   1045         outString[i] = ' ';
   1046     }
   1047     sprintf(outString + i, "%s", inString);
   1048 
   1049     /* Send outString to display */
   1050     PV//Tsc_Analyzer(tag,outString);         /* The real deal */
   1051 #endif
   1052 }
   1053 
   1054 // =======================================================
   1055 // //Tsc_Analyzer()
   1056 //
   1057 // Display messages using the central Tsc_Analyzer functions.
   1058 // =======================================================
   1059 /*OsclAny TSC_324m::Tsc_Analyzer(char* msg)
   1060 {
   1061 #ifdef PVTsc_Analyzer
   1062     ShowTsc(Tsc_Analyzer_TSC,0,msg);
   1063 #endif
   1064 }*/
   1065 
   1066 
   1067 
   1068 
   1069 
   1070 // =======================================================
   1071 // CheckAltCapSet()                             (RAN-32K)
   1072 //
   1073 // This routine checks an AlternativeCapabilitySet structure
   1074 //   to see if a particular entry number is present.  Simple.
   1075 // =======================================================
   1076 uint32 TSC_324m::CheckAltCapSet(PS_AlternativeCapabilitySet pAltCapSet,
   1077                                 uint32 entry, uint32* preference_index)
   1078 {
   1079     uint32 i;
   1080     *preference_index = 999;
   1081     for (i = 0; i < pAltCapSet->size; ++i)
   1082     {
   1083         if (pAltCapSet->item[i] == entry)
   1084         {
   1085             *preference_index = i;
   1086             return(true);
   1087         }
   1088     }
   1089 
   1090     return(false);
   1091 }
   1092 
   1093 
   1094 CPvtTerminalCapability* TSC_324m::GetRemoteCapability()
   1095 {
   1096     return iTSCcapability.GetRemoteCapability();
   1097 }
   1098