]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/platform-hardware-interfaces.git/blob - tests/foo/1.0/IFoo.hal
Merge changes from topic "nnapi-cherrypick-from-master-and-pi-dev-to-aosp"
[android/platform-hardware-interfaces.git] / tests / foo / 1.0 / IFoo.hal
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
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 express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
17 package android.hardware.tests.foo@1.0;
19 import IFooCallback;
20 import IMyTypes.SomeStruct;
21 import ISimple;
22 import ITheirTypes.FloatArray;
24 interface IFoo {
26     enum SomeBaseEnum : uint8_t {
27         bar = 66
28     };
30     enum SomeEnum : SomeBaseEnum {
31         quux = 33,
32         goober = 192,
33         blah = goober
34     };
36     enum BitField : uint8_t {
37         V0 = 1 << 0,
38         V1 = 1 << 1,
39         V2 = 1 << 2,
40         V3 = 1 << 3,
41         VALL = V0 | V1 | V2 | V3,
42     };
44     struct Fumble {
45         Outer.Inner data;
46     };
48     typedef Fumble Gumble;
50     struct Goober {
51         int32_t q;
52         string name;
53         string address;
54         double[10] numbers;
55         Fumble fumble;
56         Gumble gumble;
57         // vec<double> lotsOfFumbles;
58         // handle loveHandle;
59     };
61     typedef float[3] ThreeFloats;
62     typedef float[5] FiveFloats;
64     struct Quux {
65         string first;
66         string last;
67     };
69     typedef Quux[3] ThreeQuuxes;
71     struct MultiDimensional {
72         ThreeQuuxes[5] quuxMatrix;
73     };
75     typedef string[3] ThreeStrings;
76     typedef string[5] FiveStrings;
78     struct StringMatrix3x5 {
79         FiveStrings[3] s;
80     };
82     struct StringMatrix5x3 {
83         ThreeStrings[5] s;
84     };
86     struct MyStruct {
87         SomeStruct innerStruct;
88         FloatArray myFloatArray;
89     };
91     struct MyHandle {
92         handle h;
93         int32_t guard;
94     };
96     struct MyMask {
97         bitfield<BitField> value;
98     };
100     typedef bitfield<BitField> Mask;
102     struct Everything {
103         union U {
104             int8_t number;
105             int8_t[1][2] multidimArray;
106             Fumble anotherStruct;
107             bitfield<BitField> bf;
108         } u;
110         int8_t number;
111         handle h;
112         fmq_sync<uint8_t> descSync;
113         fmq_unsync<uint8_t> descUnsync;
114         memory mem;
115         pointer p;
116         string s;
117         vec<string> vs;
118         string[2][2] multidimArray;
119         string[3] sArray;
120         Quux anotherStruct;
121         bitfield<BitField> bf;
122     };
124     struct WithFmq {
125         fmq_sync<uint8_t> descSync;
126     };
128     enum Discriminator : uint8_t {
129         BOOL,
130         INT,
131     };
132     union Union {
133         bool boolValue;
134         int64_t intValue;
135     };
136     struct ContainsUnion {
137         Discriminator discriminator;
138         Union value;
139     };
141     typedef int32_t[5][6][7] multidimArrayOne;
142     typedef multidimArrayOne[8][9][10] multidimArrayTwo;
143     typedef multidimArrayTwo[2][3][4] multidimArrayThree;
145     struct InnerTestStruct {};
146     typedef InnerTestStruct InnerTestStructTypedef;
147     struct S1 {
148         struct InnerTestStruct {};
149         InnerTestStructTypedef foo;
150     };
152     enum InnerTestEnum : int32_t {
153         VALUE = 0
154     };
155     typedef InnerTestEnum InnerTestEnumTypedef;
156     struct S2 {
157         enum InnerTestEnum : int32_t {
158             VALUE = 1
159         };
160         InnerTestEnumTypedef foo;
161     };
163     /**
164      * If d is INT, converts all values to bools which are small enough (0 or 1).
165      * If d is BOOL, should leave all values as BOOLs.
166      *
167      * @param d discriminator for all values in u
168      * @param u values to be expanded
169      * @return c must have same length as u unless there is an error in which case it will be empty.
170      */
171     convertToBoolIfSmall(Discriminator d, vec<Union> u) generates (vec<ContainsUnion> c);
173     doThis(float param);
174     doThatAndReturnSomething(int64_t param) generates (int32_t result);
175     doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
176     doSomethingElse(int32_t[15] param) generates (int32_t[32] something);
177     doStuffAndReturnAString() generates (string something);
178     mapThisVector(vec<int32_t> param) generates (vec<int32_t> something);
179     oneway callMe(IFooCallback cb);
180     useAnEnum(SomeEnum zzz) generates (SomeEnum sleepy);
182     haveAGooberVec(vec<Goober> param);
183     haveAGoober(Goober g);
184     haveAGooberArray(Goober[20] lots);
186     haveATypeFromAnotherFile(Abc def);
188     haveSomeStrings(string[3] array) generates (string[2] result);
189     haveAStringVec(vec<string> vector) generates (vec<string> result);
191     transposeMe(FiveFloats[3] in) generates (ThreeFloats[5] out);
192     callingDrWho(MultiDimensional in) generates (MultiDimensional out);
194     transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out);
195     transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out);
197     sendVec(vec<uint8_t> data) generates (vec<uint8_t> data);
199     sendVecVec() generates (vec<vec<uint8_t>> vecvec);
201     haveAVectorOfInterfaces(vec<ISimple> in) generates (vec<ISimple> out);
203     haveAVectorOfGenericInterfaces(vec<interface> in)
204         generates (vec<interface> out);
206     echoNullInterface(IFooCallback cb) generates (bool receivedNull, IFooCallback cb);
208     createMyHandle() generates (MyHandle h);
209     createHandles(uint32_t size) generates (vec<handle> handles);
210     closeHandles();
212     repeatWithFmq(WithFmq withFmq) generates (WithFmq withFmq);
213 };