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 */ 16 17 package android.hardware.tests.foo@1.0; 18 19 import IFooCallback; 20 import IMyTypes.SomeStruct; 21 import ISimple; 22 import ITheirTypes.FloatArray; 23 24 interface IFoo { 25 26 enum SomeBaseEnum : uint8_t { 27 bar = 66 28 }; 29 30 enum SomeEnum : SomeBaseEnum { 31 quux = 33, 32 goober = 192, 33 blah = goober 34 }; 35 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 }; 43 44 struct Fumble { 45 Outer.Inner data; 46 }; 47 48 typedef Fumble Gumble; 49 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 }; 60 61 typedef float[3] ThreeFloats; 62 typedef float[5] FiveFloats; 63 64 struct Quux { 65 string first; 66 string last; 67 }; 68 69 typedef Quux[3] ThreeQuuxes; 70 71 struct MultiDimensional { 72 ThreeQuuxes[5] quuxMatrix; 73 }; 74 75 typedef string[3] ThreeStrings; 76 typedef string[5] FiveStrings; 77 78 struct StringMatrix3x5 { 79 FiveStrings[3] s; 80 }; 81 82 struct StringMatrix5x3 { 83 ThreeStrings[5] s; 84 }; 85 86 struct MyStruct { 87 SomeStruct innerStruct; 88 FloatArray myFloatArray; 89 }; 90 91 struct MyHandle { 92 handle h; 93 int32_t guard; 94 }; 95 96 struct MyMask { 97 bitfield<BitField> value; 98 }; 99 100 typedef bitfield<BitField> Mask; 101 102 struct Everything { 103 union U { 104 int8_t number; 105 int8_t[1][2] multidimArray; 106 pointer p; 107 Fumble anotherStruct; 108 bitfield<BitField> bf; 109 } u; 110 111 int8_t number; 112 handle h; 113 fmq_sync<uint8_t> descSync; 114 fmq_unsync<uint8_t> descUnsync; 115 memory mem; 116 pointer p; 117 string s; 118 vec<string> vs; 119 string[2][2] multidimArray; 120 string[3] sArray; 121 Quux anotherStruct; 122 bitfield<BitField> bf; 123 }; 124 125 doThis(float param); 126 doThatAndReturnSomething(int64_t param) generates (int32_t result); 127 doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something); 128 doSomethingElse(int32_t[15] param) generates (int32_t[32] something); 129 doStuffAndReturnAString() generates (string something); 130 mapThisVector(vec<int32_t> param) generates (vec<int32_t> something); 131 oneway callMe(IFooCallback cb); 132 useAnEnum(SomeEnum zzz) generates (SomeEnum sleepy); 133 134 haveAGooberVec(vec<Goober> param); 135 haveAGoober(Goober g); 136 haveAGooberArray(Goober[20] lots); 137 138 haveATypeFromAnotherFile(Abc def); 139 140 haveSomeStrings(string[3] array) generates (string[2] result); 141 haveAStringVec(vec<string> vector) generates (vec<string> result); 142 143 transposeMe(FiveFloats[3] in) generates (ThreeFloats[5] out); 144 callingDrWho(MultiDimensional in) generates (MultiDimensional out); 145 146 transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out); 147 transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out); 148 149 sendVec(vec<uint8_t> data) generates (vec<uint8_t> data); 150 151 sendVecVec() generates (vec<vec<uint8_t>> vecvec); 152 153 haveAVectorOfInterfaces(vec<ISimple> in) generates (vec<ISimple> out); 154 155 haveAVectorOfGenericInterfaces(vec<interface> in) 156 generates (vec<interface> out); 157 158 echoNullInterface(IFooCallback cb) generates (bool receivedNull, IFooCallback cb); 159 160 createMyHandle() generates (MyHandle h); 161 createHandles(uint32_t size) generates (vec<handle> handles); 162 closeHandles(); 163 }; 164