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#ifndef CHRE_UTIL_ID_FROM_STRING_H_
18#define CHRE_UTIL_ID_FROM_STRING_H_
19
20namespace chre {
21
22/**
23 * Formats a string into a CHRE platform version uint64_t.
24 *
25 * @param str the string to format
26 * @return the formatted platform version id
27 */
28constexpr uint64_t createIdFromString(const char str[5]);
29
30/**
31 * Formats a vendor ID and platform ID into one platform ID value. This function
32 * does not handle bit shifting. It is expected that the vendor ID be in the
33 * correct position as created by the  createIdFromString function.
34 *
35 * @param vendorId The vendor ID of the platform.
36 * @param platformId The platform ID of the platform.
37 */
38constexpr uint64_t createPlatformIdFromVendorPlatform(uint64_t vendorId,
39                                                      uint32_t platformId);
40
41}  // namespace chre
42
43#include "chre/util/id_from_string_impl.h"
44
45#endif  // CHRE_UTIL_ID_FROM_STRING_H_
46