Android-cuttlefish cvd tool
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cuttlefish::StkService Class Reference

#include <stk_service.h>

Inheritance diagram for cuttlefish::StkService:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::StkService:
Collaboration graph
[legend]

Public Member Functions

 StkService (int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
 
 ~StkService ()=default
 
 StkService (const StkService &)=delete
 
StkServiceoperator= (const StkService &)=delete
 
void SetupDependency (SimService *sim)
 
void HandleReportStkServiceIsRunning (const Client &client)
 
void HandleSendEnvelope (const Client &client, std::string &command)
 
void HandleSendTerminalResponseToSim (const Client &client, std::string &command)
 
- Public Member Functions inherited from cuttlefish::ModemService
virtual ~ModemService ()=default
 
 ModemService (const ModemService &)=delete
 
ModemServiceoperator= (const ModemService &)=delete
 
bool HandleModemCommand (const Client &client, std::string command)
 
void CloseRemoteConnection (ClientId remote_client)
 

Private Types

enum  CommandType {
  DISPLAY_TEXT = 0x21 , GET_INKEY = 0x22 , GET_INPUT = 0x23 , LAUNCH_BROWSER = 0x15 ,
  PLAY_TONE = 0x20 , REFRESH = 0x01 , SELECT_ITEM = 0x24 , SEND_SS = 0x11 ,
  SEND_USSD = 0x12 , SEND_SMS = 0x13 , RUN_AT = 0x34 , SEND_DTMF = 0x14 ,
  SET_UP_EVENT_LIST = 0x05 , SET_UP_IDLE_MODE_TEXT = 0x28 , SET_UP_MENU = 0x25 , SET_UP_CALL = 0x10 ,
  PROVIDE_LOCAL_INFORMATION = 0x26 , LANGUAGE_NOTIFICATION = 0x35 , OPEN_CHANNEL = 0x40 , CLOSE_CHANNEL = 0x41 ,
  RECEIVE_DATA = 0x42 , SEND_DATA = 0x43 , GET_CHANNEL_STATUS = 0x44
}
 

Private Member Functions

std::vector< CommandHandlerInitializeCommandHandlers ()
 
XMLElement * GetCurrentSelectItem ()
 
void OnUnsolicitedCommandForTR (std::string &command)
 

Private Attributes

SimServicesim_service_
 
std::vector< std::string > current_select_item_menu_ids_
 

Additional Inherited Members

- Static Public Attributes inherited from cuttlefish::ModemService
static constexpr char kCmeErrorOperationNotAllowed [] = "+CME ERROR: 3"
 
static constexpr char kCmeErrorOperationNotSupported [] = "+CME ERROR: 4"
 
static constexpr char kCmeErrorSimNotInserted [] = "+CME ERROR: 10"
 
static constexpr char kCmeErrorSimPinRequired [] = "+CME ERROR: 11"
 
static constexpr char kCmeErrorSimPukRequired [] = "+CME ERROR: 12"
 
static constexpr char kCmeErrorSimBusy [] = "+CME ERROR: 14"
 
static constexpr char kCmeErrorIncorrectPassword [] = "+CME ERROR: 16"
 
static constexpr char kCmeErrorMemoryFull [] = "+CME ERROR: 20"
 
static constexpr char kCmeErrorInvalidIndex [] = "+CME ERROR: 21"
 
static constexpr char kCmeErrorNotFound [] = "+CME ERROR: 22"
 
static constexpr char kCmeErrorInvalidCharactersInTextString []
 
static constexpr char kCmeErrorNoNetworkService [] = "+CME ERROR: 30"
 
static constexpr char kCmeErrorNetworkNotAllowedEmergencyCallsOnly []
 
static constexpr char kCmeErrorInCorrectParameters [] = "+CME ERROR: 50"
 
static constexpr char kCmeErrorNetworkNotAttachedDueToMTFunctionalRestrictions []
 
static constexpr char kCmeErrorFixedDialNumberOnlyAllowed []
 
static constexpr char kCmsErrorOperationNotAllowed [] = "+CMS ERROR: 302"
 
static constexpr char kCmsErrorOperationNotSupported [] = "+CMS ERROR: 303"
 
static constexpr char kCmsErrorInvalidPDUModeParam [] = "+CMS ERROR: 304"
 
static constexpr char kCmsErrorSCAddressUnknown [] = "+CMS ERROR: 304"
 
static constexpr std::pair< int, int > kRemotePortRange {6520, 6527}
 
- Protected Member Functions inherited from cuttlefish::ModemService
 ModemService (int32_t service_id, std::vector< CommandHandler > command_handlers, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
 
void HandleCommandDefaultSupported (const Client &client)
 
void SendUnsolicitedCommand (std::string unsol_command)
 
cuttlefish::SharedFD ConnectToRemoteCvd (std::string port)
 
void SendCommandToRemote (ClientId remote_client, std::string response)
 
- Static Protected Member Functions inherited from cuttlefish::ModemService
static std::string GetHostId ()
 
- Protected Attributes inherited from cuttlefish::ModemService
int32_t service_id_
 
const std::vector< CommandHandlercommand_handlers_
 
ThreadLooperthread_looper_
 
ChannelMonitorchannel_monitor_
 

Member Enumeration Documentation

◆ CommandType

Enumerator
DISPLAY_TEXT 
GET_INKEY 
GET_INPUT 
LAUNCH_BROWSER 
PLAY_TONE 
REFRESH 
SELECT_ITEM 
SEND_SS 
SEND_USSD 
SEND_SMS 
RUN_AT 
SEND_DTMF 
SET_UP_EVENT_LIST 
SET_UP_IDLE_MODE_TEXT 
SET_UP_MENU 
SET_UP_CALL 
PROVIDE_LOCAL_INFORMATION 
LANGUAGE_NOTIFICATION 
OPEN_CHANNEL 
CLOSE_CHANNEL 
RECEIVE_DATA 
SEND_DATA 
GET_CHANNEL_STATUS 

Constructor & Destructor Documentation

◆ StkService() [1/2]

cuttlefish::StkService::StkService ( int32_t  service_id,
ChannelMonitor channel_monitor,
ThreadLooper thread_looper 
)

◆ ~StkService()

cuttlefish::StkService::~StkService ( )
default

◆ StkService() [2/2]

cuttlefish::StkService::StkService ( const StkService )
delete

Member Function Documentation

◆ GetCurrentSelectItem()

XMLElement * cuttlefish::StkService::GetCurrentSelectItem ( )
private

e.g. current_select_item_menu_ids_: {"1", "02"} <SELECTITEM id="1"> <SELECTITEM id="01"> </SELECTITEM> <SELECTITEM id="02"> </SELECTITEM> </SELECTITEM>

◆ HandleReportStkServiceIsRunning()

void cuttlefish::StkService::HandleReportStkServiceIsRunning ( const Client client)

AT+CUSATD This command determines if, and optionally which profile should be downloaded to the UICC automatically upon start-up.

Command Possible response(s) +CUSATD=[<download>[,<reporting>]] +CME ERROR: <err> +CUSATD? +CUSATD: <download>,<reporting>

<download>: integer type. 0 Download MT default profile automatically during next start-up. 1 Download the combined TE and MT profile 2 Halt next UICC start-up when ready for profile download. <reporting>: integer type. 0 Disable +CUSATS, i.e. no notification. 1 Enable +CUSATS, i.e. notify TE.

see RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING in RIL

◆ HandleSendEnvelope()

void cuttlefish::StkService::HandleSendEnvelope ( const Client client,
std::string &  command 
)

AT+CUSATE Execution command allows the TE to send a USAT envelope command to the MT

Command Possible response(s) +CUSATE=<envelope_command> +CUSATE: <envelope_response>[,<busy>] [<CR><LF>+CUSATE2: <sw1>,<sw2>] +CME ERROR: <err>

<envelope_command>: string type in hexadecimal character format. <envelope_response>: string type in hexadecimal character format. <busy>: integer type. 0 UICC indicated normal ending of the command. 1 UICC responded with USAT is busy, no retry by the MT. 2 UICC responded with USAT is busy even after one or more retries by the MT. <sw1>: integer type. <sw2>: integer type.

see RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND in RIL

◆ HandleSendTerminalResponseToSim()

void cuttlefish::StkService::HandleSendTerminalResponseToSim ( const Client client,
std::string &  command 
)

AT+CUSATT Execution command sends a USAT terminal response to the MT as an answer to a preceding USAT proactive command sent from the UICC with unsolicited result code +CUSATP: <proactive_command>

Command Possible response(s) +CUSATT=<terminal_response> +CME ERROR: <err>

<terminal_response>: string type in hexadecimal character format.

see RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE in RIL

◆ InitializeCommandHandlers()

std::vector< CommandHandler > cuttlefish::StkService::InitializeCommandHandlers ( )
private

◆ OnUnsolicitedCommandForTR()

void cuttlefish::StkService::OnUnsolicitedCommandForTR ( std::string &  command)
private

◆ operator=()

StkService & cuttlefish::StkService::operator= ( const StkService )
delete

◆ SetupDependency()

void cuttlefish::StkService::SetupDependency ( SimService sim)

Member Data Documentation

◆ current_select_item_menu_ids_

std::vector<std::string> cuttlefish::StkService::current_select_item_menu_ids_
private

◆ sim_service_

SimService* cuttlefish::StkService::sim_service_
private

The documentation for this class was generated from the following files: