• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 #pragma once
18 
19 #include <string_view>
20 
21 namespace aidl {
22 namespace android {
23 namespace hardware {
24 namespace radio {
25 namespace implementation {
26 namespace atCmds {
27 using namespace std::literals;
28 
29 static constexpr std::string_view kCmeErrorOperationNotAllowed = "3"sv;
30 static constexpr std::string_view kCmeErrorOperationNotSupported = "4"sv;
31 static constexpr std::string_view kCmeErrorSimNotInserted = "10"sv;
32 static constexpr std::string_view kCmeErrorSimPinRequired = "11"sv;
33 static constexpr std::string_view kCmeErrorSimPukRequired = "12"sv;
34 static constexpr std::string_view kCmeErrorSimBusy = "14"sv;
35 static constexpr std::string_view kCmeErrorIncorrectPassword = "16"sv;
36 static constexpr std::string_view kCmeErrorMemoryFull = "20"sv;
37 static constexpr std::string_view kCmeErrorInvalidIndex = "21"sv;
38 static constexpr std::string_view kCmeErrorNotFound = "22"sv;
39 static constexpr std::string_view kCmeErrorInvalidCharactersInTextString = "27"sv;
40 static constexpr std::string_view kCmeErrorNoNetworkService = "30"sv;
41 static constexpr std::string_view kCmeErrorNetworkNotAllowedEmergencyCallsOnly = "32"sv;
42 static constexpr std::string_view kCmeErrorInCorrectParameters = "50"sv;
43 static constexpr std::string_view kCmeErrorNetworkNotAttachedDueToMTFunctionalRestrictions = "53"sv;
44 static constexpr std::string_view kCmeErrorFixedDialNumberOnlyAllowed = "56"sv;
45 
46 static constexpr std::string_view kCmsErrorOperationNotAllowed = "302";
47 static constexpr std::string_view kCmsErrorOperationNotSupported = "303";
48 static constexpr std::string_view kCmsErrorInvalidPDUModeParam = "304";
49 static constexpr std::string_view kCmsErrorSCAddressUnknown = "304";
50 
51 constexpr int kClckUnlock = 0;
52 constexpr int kClckLock = 1;
53 constexpr int kClckQuery = 2;
54 
55 static constexpr std::string_view getModemPowerState =
56     "AT+CFUN?"sv;
57 
58 static constexpr std::string_view getSupportedRadioTechs =
59     "AT+CTEC=?"sv;
60 
61 static constexpr std::string_view getCurrentPreferredRadioTechs =
62     "AT+CTEC?"sv;
63 
64 static constexpr std::string_view getSimCardStatus =
65     "AT+CPIN?"sv;
66 
67 static constexpr std::string_view reportStkServiceRunning =
68     "AT+CUSATD?"sv;
69 
70 static constexpr std::string_view getICCID = "AT+CICCID"sv;
71 
72 static constexpr std::string_view getIMEI = "AT+CGSN=2"sv;
73 
74 static constexpr std::string_view getIMSI = "AT+CIMI"sv;
75 
76 static constexpr std::string_view getSignalStrength =
77     "AT+CSQ"sv;
78 
79 static constexpr std::string_view getNetworkSelectionMode =
80     "AT+COPS?"sv;
81 
82 static constexpr std::string_view getAvailableNetworks =
83     "AT+COPS=?"sv;
84 
85 static constexpr std::string_view getOperator =
86     "AT+COPS=3,0;+COPS?;+COPS=3,1;+COPS?;+COPS=3,2;+COPS?"sv;
87 
88 static constexpr std::string_view setNetworkSelectionModeAutomatic =
89     "AT+COPS=0"sv;
90 
91 static constexpr std::string_view getCdmaRoamingPreference =
92     "AT+WRMP?"sv;
93 
94 static constexpr std::string_view getVoiceRegistrationState =
95     "AT+CREG?"sv;
96 
97 static constexpr std::string_view getDataRegistrationState =
98     "AT+CEREG?"sv;
99 
100 static constexpr std::string_view getCdmaSubscriptionSource =
101     "AT+CCSS?"sv;
102 
103 static constexpr std::string_view getCurrentCalls = "AT+CLCC"sv;
104 
105 static constexpr std::string_view acceptCall = "ATA"sv;
106 static constexpr std::string_view rejectCall = "ATH"sv;
107 static constexpr std::string_view hangupWaiting = "AT+CHLD=0"sv;
108 static constexpr std::string_view hangupForeground = "AT+CHLD=1"sv;
109 static constexpr std::string_view switchWaiting = "AT+CHLD=2"sv;
110 static constexpr std::string_view conference = "AT+CHLD=3"sv;
111 
112 static constexpr std::string_view cancelUssd = "AT+CUSD=2"sv;
113 
114 static constexpr std::string_view getClip = "AT+CLIP?"sv;
115 static constexpr std::string_view getClir = "AT+CLIR?"sv;
116 static constexpr std::string_view getMute = "AT+CMUT?"sv;
117 
118 static constexpr std::string_view exitEmergencyMode = "AT+WSOS=0"sv;
119 
120 static constexpr std::string_view getSmscAddress = "AT+CSCA?"sv;
121 
122 static constexpr std::string_view getBroadcastConfig = "AT+CSCB?"sv;
123 
124 }  // namespace atCmds
125 }  // namespace implementation
126 }  // namespace radio
127 }  // namespace hardware
128 }  // namespace android
129 }  // namespace aidl
130 
131