2016-08-30 20:27:56 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2016-08-11 21:52:43 +02:00
|
|
|
package android.hardware.tests.foo@1.0;
|
|
|
|
|
|
|
|
import IFooCallback;
|
2016-10-05 21:15:51 +02:00
|
|
|
import IMyTypes.SomeStruct;
|
2016-10-19 23:10:55 +02:00
|
|
|
import ISimple;
|
2016-10-05 21:15:51 +02:00
|
|
|
import ITheirTypes.FloatArray;
|
2016-08-11 21:52:43 +02:00
|
|
|
|
|
|
|
interface IFoo {
|
|
|
|
|
|
|
|
enum SomeBaseEnum : uint8_t {
|
|
|
|
bar = 66
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SomeEnum : SomeBaseEnum {
|
|
|
|
quux = 33,
|
|
|
|
goober = 192,
|
|
|
|
blah = goober
|
|
|
|
};
|
|
|
|
|
2016-12-05 21:34:42 +01:00
|
|
|
enum BitField : uint8_t {
|
|
|
|
V0 = 1 << 0,
|
|
|
|
V1 = 1 << 1,
|
|
|
|
V2 = 1 << 2,
|
|
|
|
V3 = 1 << 3,
|
2017-02-23 01:07:33 +01:00
|
|
|
VALL = V0 | V1 | V2 | V3,
|
2016-12-05 21:34:42 +01:00
|
|
|
};
|
|
|
|
|
2016-08-11 21:52:43 +02:00
|
|
|
struct Fumble {
|
2016-10-03 19:30:55 +02:00
|
|
|
Outer.Inner data;
|
2016-08-11 21:52:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef Fumble Gumble;
|
|
|
|
|
|
|
|
struct Goober {
|
|
|
|
int32_t q;
|
|
|
|
string name;
|
|
|
|
string address;
|
|
|
|
double[10] numbers;
|
|
|
|
Fumble fumble;
|
|
|
|
Gumble gumble;
|
|
|
|
// vec<double> lotsOfFumbles;
|
|
|
|
// handle loveHandle;
|
|
|
|
};
|
|
|
|
|
2016-09-13 00:01:02 +02:00
|
|
|
typedef float[3] ThreeFloats;
|
|
|
|
typedef float[5] FiveFloats;
|
|
|
|
|
|
|
|
struct Quux {
|
|
|
|
string first;
|
|
|
|
string last;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef Quux[3] ThreeQuuxes;
|
|
|
|
|
|
|
|
struct MultiDimensional {
|
|
|
|
ThreeQuuxes[5] quuxMatrix;
|
|
|
|
};
|
|
|
|
|
2016-09-19 22:59:52 +02:00
|
|
|
typedef string[3] ThreeStrings;
|
|
|
|
typedef string[5] FiveStrings;
|
|
|
|
|
|
|
|
struct StringMatrix3x5 {
|
|
|
|
FiveStrings[3] s;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StringMatrix5x3 {
|
|
|
|
ThreeStrings[5] s;
|
|
|
|
};
|
|
|
|
|
2016-10-05 21:15:51 +02:00
|
|
|
struct MyStruct {
|
|
|
|
SomeStruct innerStruct;
|
|
|
|
FloatArray myFloatArray;
|
|
|
|
};
|
|
|
|
|
2016-10-14 19:41:41 +02:00
|
|
|
struct MyHandle {
|
|
|
|
handle h;
|
|
|
|
int32_t guard;
|
|
|
|
};
|
|
|
|
|
2016-12-05 21:34:42 +01:00
|
|
|
struct MyMask {
|
|
|
|
bitfield<BitField> value;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef bitfield<BitField> Mask;
|
|
|
|
|
2017-01-06 18:10:11 +01:00
|
|
|
struct Everything {
|
|
|
|
union U {
|
|
|
|
int8_t number;
|
|
|
|
int8_t[1][2] multidimArray;
|
|
|
|
pointer p;
|
|
|
|
Fumble anotherStruct;
|
|
|
|
bitfield<BitField> bf;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
int8_t number;
|
|
|
|
handle h;
|
|
|
|
fmq_sync<uint8_t> descSync;
|
|
|
|
fmq_unsync<uint8_t> descUnsync;
|
|
|
|
memory mem;
|
|
|
|
pointer p;
|
|
|
|
string s;
|
|
|
|
vec<string> vs;
|
|
|
|
string[2][2] multidimArray;
|
|
|
|
string[3] sArray;
|
|
|
|
Quux anotherStruct;
|
|
|
|
bitfield<BitField> bf;
|
|
|
|
};
|
|
|
|
|
2017-12-14 03:12:45 +01:00
|
|
|
enum Discriminator : uint8_t {
|
|
|
|
BOOL,
|
|
|
|
INT,
|
|
|
|
};
|
|
|
|
union Union {
|
|
|
|
bool boolValue;
|
|
|
|
int64_t intValue;
|
|
|
|
};
|
|
|
|
struct ContainsUnion {
|
|
|
|
Discriminator discriminator;
|
|
|
|
Union value;
|
|
|
|
};
|
|
|
|
|
2017-09-01 00:18:45 +02:00
|
|
|
typedef int32_t[5][6][7] multidimArrayOne;
|
|
|
|
typedef multidimArrayOne[8][9][10] multidimArrayTwo;
|
|
|
|
typedef multidimArrayTwo[2][3][4] multidimArrayThree;
|
|
|
|
|
2017-09-14 02:35:10 +02:00
|
|
|
struct InnerTestStruct {};
|
|
|
|
typedef InnerTestStruct InnerTestStructTypedef;
|
|
|
|
struct S1 {
|
|
|
|
struct InnerTestStruct {};
|
|
|
|
InnerTestStructTypedef foo;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum InnerTestEnum : int32_t {
|
|
|
|
VALUE = 0
|
|
|
|
};
|
|
|
|
typedef InnerTestEnum InnerTestEnumTypedef;
|
|
|
|
struct S2 {
|
|
|
|
enum InnerTestEnum : int32_t {
|
|
|
|
VALUE = 1
|
|
|
|
};
|
|
|
|
InnerTestEnumTypedef foo;
|
|
|
|
};
|
|
|
|
|
2017-12-14 03:12:45 +01:00
|
|
|
/**
|
|
|
|
* If d is INT, converts all values to bools which are small enough (0 or 1).
|
|
|
|
* If d is BOOL, should leave all values as BOOLs.
|
|
|
|
*
|
|
|
|
* @param d discriminator for all values in u
|
|
|
|
* @param u values to be expanded
|
|
|
|
* @return c must have same length as u unless there is an error in which case it will be empty.
|
|
|
|
*/
|
|
|
|
convertToBoolIfSmall(Discriminator d, vec<Union> u) generates (vec<ContainsUnion> c);
|
|
|
|
|
2016-08-11 21:52:43 +02:00
|
|
|
doThis(float param);
|
|
|
|
doThatAndReturnSomething(int64_t param) generates (int32_t result);
|
|
|
|
doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
|
|
|
|
doSomethingElse(int32_t[15] param) generates (int32_t[32] something);
|
|
|
|
doStuffAndReturnAString() generates (string something);
|
|
|
|
mapThisVector(vec<int32_t> param) generates (vec<int32_t> something);
|
2016-08-14 08:05:56 +02:00
|
|
|
oneway callMe(IFooCallback cb);
|
2016-08-11 21:52:43 +02:00
|
|
|
useAnEnum(SomeEnum zzz) generates (SomeEnum sleepy);
|
|
|
|
|
|
|
|
haveAGooberVec(vec<Goober> param);
|
|
|
|
haveAGoober(Goober g);
|
|
|
|
haveAGooberArray(Goober[20] lots);
|
|
|
|
|
|
|
|
haveATypeFromAnotherFile(Abc def);
|
|
|
|
|
|
|
|
haveSomeStrings(string[3] array) generates (string[2] result);
|
|
|
|
haveAStringVec(vec<string> vector) generates (vec<string> result);
|
2016-09-13 00:01:02 +02:00
|
|
|
|
|
|
|
transposeMe(FiveFloats[3] in) generates (ThreeFloats[5] out);
|
|
|
|
callingDrWho(MultiDimensional in) generates (MultiDimensional out);
|
2016-09-19 22:59:52 +02:00
|
|
|
|
|
|
|
transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out);
|
|
|
|
transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out);
|
2016-09-27 23:54:20 +02:00
|
|
|
|
|
|
|
sendVec(vec<uint8_t> data) generates (vec<uint8_t> data);
|
2016-10-05 22:43:53 +02:00
|
|
|
|
|
|
|
sendVecVec() generates (vec<vec<uint8_t>> vecvec);
|
2016-10-19 23:10:55 +02:00
|
|
|
|
|
|
|
haveAVectorOfInterfaces(vec<ISimple> in) generates (vec<ISimple> out);
|
|
|
|
|
|
|
|
haveAVectorOfGenericInterfaces(vec<interface> in)
|
|
|
|
generates (vec<interface> out);
|
2016-10-27 11:51:46 +02:00
|
|
|
|
|
|
|
echoNullInterface(IFooCallback cb) generates (bool receivedNull, IFooCallback cb);
|
|
|
|
|
2016-10-14 19:41:41 +02:00
|
|
|
createMyHandle() generates (MyHandle h);
|
|
|
|
createHandles(uint32_t size) generates (vec<handle> handles);
|
|
|
|
closeHandles();
|
2016-08-11 21:52:43 +02:00
|
|
|
};
|