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 /* file name : tsc_sub.c */
30 /* file contents : Terminal State Control routine */
31 /* draw : '96.10.04 */
32 /*---------------------------------------------------------------------------*/
33 /* amendment */
34 /* Copyright (C) 1996 NTT DoCoMo */
35 /*****************************************************************************/
36 #include "tsc_sub.h" /* Sub Information Header */
37 #include "oscl_mem.h"
38
39
40 /*****************************************************************************/
41 /* function name : Tsc_SendDataSet */
42 /* function outline : Send Data Set procedure */
43 /* function discription : Tsc_SendDataSet( InfType, */
44 /* InfId, */
45 /* InfSupplement1, */
46 /* InfSupplement2, */
47 /* pParameter, */
48 /* Size ) */
49 /* input data : uint32 Information Type */
50 /* uint32 Information Id */
51 /* uint32 Information Supplement 1 */
52 /* uint32 Information Supplement 2 */
53 /* uint8* Information Parameter */
54 /* uint32 Information Parameter Size */
55 /* output data : PS_ControlMsgHeader Send InfHeader Pointer */
56 /* draw time : '96.10.09 */
57 /*---------------------------------------------------------------------------*/
58 /* amendent career : */
59 /* */
60 /* Copyright (C) 1996 NTT DoCoMo */
61 /*****************************************************************************/
Tsc_SendDataSet(PS_ControlMsgHeader pInfHeader,uint32 InfType,uint32 InfId,uint32 InfSupplement1,uint32 InfSupplement2,uint8 * pParameter,uint32 Size)62 void Tsc_SendDataSet(PS_ControlMsgHeader pInfHeader,
63 uint32 InfType,
64 uint32 InfId,
65 uint32 InfSupplement1,
66 uint32 InfSupplement2,
67 uint8* pParameter,
68 uint32 Size)
69 {
70 // TRANSFER.request primitive - MsgHeader
71 pInfHeader->InfType = InfType;
72 pInfHeader->InfId = InfId;
73 pInfHeader->InfSupplement1 = InfSupplement1;
74 pInfHeader->InfSupplement2 = InfSupplement2;
75 pInfHeader->pParameter = pParameter;
76 pInfHeader->Size = Size;
77 }
78
79
80 /*****************************************************************************/
81 /* function name : Tsc_ChoiceDataSet */
82 /* function outline : Choice Data Set procedure */
83 /* function discription : Tsc_ChoiceDataSet( TrueTarget, */
84 /* pFirstTarget, */
85 /* NumberTarget ) */
86 /* input data : uint32 True Target */
87 /* : uint8* First Target Pointer */
88 /* : uint32 Target Numberd */
89 /* output data : None */
90 /* draw time : '96.10.09 */
91 /*---------------------------------------------------------------------------*/
92 /* amendent career : */
93 /* */
94 /* Copyright (C) 1996 NTT DoCoMo */
95 /*****************************************************************************/
Tsc_ChoiceDataSet(uint32 TrueTarget,uint8 * pFirstTarget,uint32 NumberTarget)96 void Tsc_ChoiceDataSet(uint32 TrueTarget,
97 uint8* pFirstTarget,
98 uint32 NumberTarget)
99 {
100 uint8* pBooleanData;
101 uint32 Cnt;
102
103 for (pBooleanData = pFirstTarget, Cnt = 0;
104 Cnt < NumberTarget;
105 pBooleanData++, Cnt++)
106 {
107 if (TrueTarget == Cnt)
108 {
109 *pBooleanData = true;
110 }
111 else
112 {
113 *pBooleanData = false;
114 }
115 }
116 return;
117 }
118
119