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

#include <sms_service.h>

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

Classes

struct  BroadcastConfig
 
struct  SmsMessage
 
struct  SmsServiceCenterAddress
 

Public Member Functions

 SmsService (int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
 
 ~SmsService ()=default
 
 SmsService (const SmsService &)=delete
 
SmsServiceoperator= (const SmsService &)=delete
 
void SetupDependency (SimService *sim)
 
void HandleSendSMS (const Client &client, std::string &command)
 
void HandleSendSMSPDU (const Client &client, std::string &command)
 
void HandleSMSAcknowledge (const Client &client, std::string &command)
 
void HandleWriteSMSToSim (const Client &client, std::string &command)
 
void HandleDeleteSmsOnSim (const Client &client, std::string &command)
 
void HandleBroadcastConfig (const Client &client, std::string &command)
 
void HandleGetSmscAddress (const Client &client)
 
void HandleSetSmscAddress (const Client &client, std::string &command)
 
void HandleWriteSMSPduToSim (const Client &client, std::string &command)
 
void HandleReceiveRemoteSMS (const Client &client, std::string &command)
 
bool IsWaitingSmsPdu ()
 
bool IsWaitingSmsToSim ()
 
- 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 Member Functions

void InitializeServiceState ()
 
std::vector< CommandHandlerInitializeCommandHandlers ()
 
void HandleReceiveSMS (PDUParser sms_pdu)
 
void HandleSMSStatuReport (PDUParser sms_pdu, int message_reference)
 
void SendSmsToRemote (std::string remote_port, PDUParser &sms_pdu)
 

Private Attributes

SimServicesim_service_
 
bool is_waiting_sms_pdu_
 
bool is_waiting_sms_to_sim_
 
int message_id_
 
int message_reference_
 
SmsMessage::SmsStatus sms_status_on_sim_
 
BroadcastConfig broadcast_config_
 
SmsServiceCenterAddress sms_service_center_address_
 
std::map< int, SmsMessagemessages_on_sim_card_
 

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_
 

Constructor & Destructor Documentation

◆ SmsService() [1/2]

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

◆ ~SmsService()

cuttlefish::SmsService::~SmsService ( )
default

◆ SmsService() [2/2]

cuttlefish::SmsService::SmsService ( const SmsService )
delete

Member Function Documentation

◆ HandleBroadcastConfig()

void cuttlefish::SmsService::HandleBroadcastConfig ( const Client client,
std::string &  command 
)

AT+CSCB Set command selects which types of CBMs are to be received by the ME.

Command Possible response(s) +CSCB=[<mode>[,<mids>[,<dcss>]]] OK +CSCB? +CSCB: <mode>,<mids>,<dcss>

<mode>: 0: message types specified in <mids> and <dcss> are accepted 1: message types specified in <mids> and <dcss> are not accepted <mids>: string type; all different possible combinations of CBM message identifiers (refer <mid>). <dcss>: string type; all different possible combinations of CBM data coding schemes.

see RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG & RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG in RIL Notes: This command is allowed in TEXT mode.

◆ HandleDeleteSmsOnSim()

void cuttlefish::SmsService::HandleDeleteSmsOnSim ( const Client client,
std::string &  command 
)

AT+CMGD This command deletes message from preferred message storage <mem1> location <index>.

Command Possible response(s) +CMGD=<index>[, <DelFlag>] OK +CMS ERROR: <err> < index>: index id of <mem2>

see RIL_REQUEST_DELETE_SMS_ON_SIM in RIL

◆ HandleGetSmscAddress()

void cuttlefish::SmsService::HandleGetSmscAddress ( const Client client)

AT+CSCA Set command updates the SMSC address, through which mobile originated SMs are transmitted.

Command Possible response(s) +CSCA=<sca>[,<tosca>] OK +CSCA? +CSCA: <sca>,<tosca>

<sca>: service center address, its maximum length is 20. <tosca>: service center address format,protocol uses 8-bit address integer.

see RIL_REQUEST_SET_SMSC_ADDRESS in RIL

◆ HandleReceiveRemoteSMS()

void cuttlefish::SmsService::HandleReceiveRemoteSMS ( const Client client,
std::string &  command 
)

◆ HandleReceiveSMS()

void cuttlefish::SmsService::HandleReceiveSMS ( PDUParser  sms_pdu)
private

◆ HandleSendSMS()

void cuttlefish::SmsService::HandleSendSMS ( const Client client,
std::string &  command 
)

AT+CMGS This command sends message from a TE to the network (SMS-SUBMIT).

Command Possible response(s) +CMGS=<length><CR> "> " PDU is given<ctrl-Z/ESC> +CMGS: <mr>[,<ackpdu>]<CR>OK +CMS ERROR: <err>

<length>:must indicate the number of octets coded in the TP layer data unit to be given.

see RIL_REQUEST_SEND_SMS in RIL

◆ HandleSendSMSPDU()

void cuttlefish::SmsService::HandleSendSMSPDU ( const Client client,
std::string &  command 
)

◆ HandleSetSmscAddress()

void cuttlefish::SmsService::HandleSetSmscAddress ( const Client client,
std::string &  command 
)

◆ HandleSMSAcknowledge()

void cuttlefish::SmsService::HandleSMSAcknowledge ( const Client client,
std::string &  command 
)

AT+CNMA This command confirms reception of a new message (SMS-DELIVER or SMS-STATUS-REPORT) which is routed directly to the TE.

Command Possible response(s) +CNMA [=<n>[, <length> [<CR> OK PDU is given<ctrl-Z/ESC>]]] +CMS ERROR: <err>

<n>: integer type 0: command operates similarly as defined for the text mode 1: send RP-ACK 2: send RP-ERROR <length>: ACKPDU length(octet)

see RIL_REQUEST_SMS_ACKNOWLEDGE in RIL

◆ HandleSMSStatuReport()

void cuttlefish::SmsService::HandleSMSStatuReport ( PDUParser  sms_pdu,
int  message_reference 
)
private

◆ HandleWriteSMSPduToSim()

void cuttlefish::SmsService::HandleWriteSMSPduToSim ( const Client client,
std::string &  command 
)

◆ HandleWriteSMSToSim()

void cuttlefish::SmsService::HandleWriteSMSToSim ( const Client client,
std::string &  command 
)

◆ InitializeCommandHandlers()

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

◆ InitializeServiceState()

void cuttlefish::SmsService::InitializeServiceState ( )
private

◆ IsWaitingSmsPdu()

bool cuttlefish::SmsService::IsWaitingSmsPdu ( )
inline

◆ IsWaitingSmsToSim()

bool cuttlefish::SmsService::IsWaitingSmsToSim ( )
inline

◆ operator=()

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

◆ SendSmsToRemote()

void cuttlefish::SmsService::SendSmsToRemote ( std::string  remote_port,
PDUParser sms_pdu 
)
private

◆ SetupDependency()

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

Member Data Documentation

◆ broadcast_config_

BroadcastConfig cuttlefish::SmsService::broadcast_config_
private

◆ is_waiting_sms_pdu_

bool cuttlefish::SmsService::is_waiting_sms_pdu_
private

◆ is_waiting_sms_to_sim_

bool cuttlefish::SmsService::is_waiting_sms_to_sim_
private

◆ message_id_

int cuttlefish::SmsService::message_id_
private

◆ message_reference_

int cuttlefish::SmsService::message_reference_
private

◆ messages_on_sim_card_

std::map<int, SmsMessage> cuttlefish::SmsService::messages_on_sim_card_
private

◆ sim_service_

SimService* cuttlefish::SmsService::sim_service_
private

◆ sms_service_center_address_

SmsServiceCenterAddress cuttlefish::SmsService::sms_service_center_address_
private

◆ sms_status_on_sim_

SmsMessage::SmsStatus cuttlefish::SmsService::sms_status_on_sim_
private

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