1 /*
2  * Copyright (C) 2020 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 CHPP_WWAN_COMMON_H_
18 #define CHPP_WWAN_COMMON_H_
19 
20 #include <stdint.h>
21 
22 #include "chpp/app.h"
23 #include "chpp/macros.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /************************************************
30  *  Public Definitions
31  ***********************************************/
32 
33 #define CHPP_PAL_WWAN_API_VERSION CHRE_PAL_WWAN_API_V1_4
34 
35 /**
36  * Data structures used by the Get Capabilities Response.
37  */
38 CHPP_PACKED_START
39 struct ChppWwanGetCapabilitiesParameters {
40   uint32_t capabilities;
41 } CHPP_PACKED_ATTR;
42 CHPP_PACKED_END
43 
44 CHPP_PACKED_START
45 struct ChppWwanGetCapabilitiesResponse {
46   struct ChppAppHeader header;
47   struct ChppWwanGetCapabilitiesParameters params;
48 } CHPP_PACKED_ATTR;
49 CHPP_PACKED_END
50 
51 /**
52  * Commands used by the WWAN (cellular) Service.
53  */
54 enum ChppWwanCommands {
55   //! Initializes the service.
56   CHPP_WWAN_OPEN = 0x0000,
57 
58   //! Deinitializes the service.
59   CHPP_WWAN_CLOSE = 0x0001,
60 
61   //! Retrieves a set of flags indicating supported features.
62   CHPP_WWAN_GET_CAPABILITIES = 0x0002,
63 
64   //! Query information about the current serving cell and its neighbors.
65   CHPP_WWAN_GET_CELLINFO_ASYNC = 0x0003,
66 };
67 #define CHPP_WWAN_CLIENT_REQUEST_MAX CHPP_WWAN_GET_CELLINFO_ASYNC
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif  // CHPP_WWAN_COMMON_H_
74