1 /* 2 * Copyright (C) 2022 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 #ifndef CHRE_UTIL_PIGWEED_RPC_COMMON_H_ 18 #define CHRE_UTIL_PIGWEED_RPC_COMMON_H_ 19 20 #include <cstdint> 21 22 /** 23 * @file 24 * Common definitions across nanoapp and host sides. 25 */ 26 27 namespace chre { 28 /** The upper 16b of a channel ID are set to 1 for host clients. */ 29 constexpr uint32_t kChannelIdHostClient = 1 << 16; 30 31 /** Mask to extract the host ID / nanoapp ID from a channel ID. */ 32 constexpr uint32_t kRpcClientIdMask = 0xffff; 33 34 /** Maximum ID for a nanoapp as the value is encoded on 16b. */ 35 constexpr uint32_t kRpcNanoappMaxId = 0xffff; 36 37 } // namespace chre 38 39 #endif // CHRE_UTIL_PIGWEED_RPC_COMMON_H_