Android-cuttlefish cvd tool
Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
cuttlefish::ModemService Class Reference

#include <modem_service.h>

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

Public Member Functions

virtual ~ModemService ()=default
 
 ModemService (const ModemService &)=delete
 
ModemServiceoperator= (const ModemService &)=delete
 
bool HandleModemCommand (const Client &client, std::string command)
 
void CloseRemoteConnection (ClientId remote_client)
 

Static Public Attributes

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

 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

static std::string GetHostId ()
 

Protected Attributes

int32_t service_id_
 
const std::vector< CommandHandlercommand_handlers_
 
ThreadLooperthread_looper_
 
ChannelMonitorchannel_monitor_
 

Constructor & Destructor Documentation

◆ ~ModemService()

virtual cuttlefish::ModemService::~ModemService ( )
virtualdefault

◆ ModemService() [1/2]

cuttlefish::ModemService::ModemService ( const ModemService )
delete

◆ ModemService() [2/2]

cuttlefish::ModemService::ModemService ( int32_t  service_id,
std::vector< CommandHandler command_handlers,
ChannelMonitor channel_monitor,
ThreadLooper thread_looper 
)
protected

Member Function Documentation

◆ CloseRemoteConnection()

void cuttlefish::ModemService::CloseRemoteConnection ( ClientId  remote_client)

◆ ConnectToRemoteCvd()

cuttlefish::SharedFD cuttlefish::ModemService::ConnectToRemoteCvd ( std::string  port)
protected

◆ GetHostId()

std::string cuttlefish::ModemService::GetHostId ( )
staticprotected

◆ HandleCommandDefaultSupported()

void cuttlefish::ModemService::HandleCommandDefaultSupported ( const Client client)
protected

◆ HandleModemCommand()

bool cuttlefish::ModemService::HandleModemCommand ( const Client client,
std::string  command 
)

◆ operator=()

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

◆ SendCommandToRemote()

void cuttlefish::ModemService::SendCommandToRemote ( ClientId  remote_client,
std::string  response 
)
protected

◆ SendUnsolicitedCommand()

void cuttlefish::ModemService::SendUnsolicitedCommand ( std::string  unsol_command)
protected

Member Data Documentation

◆ channel_monitor_

ChannelMonitor* cuttlefish::ModemService::channel_monitor_
protected

◆ command_handlers_

const std::vector<CommandHandler> cuttlefish::ModemService::command_handlers_
protected

◆ kCmeErrorFixedDialNumberOnlyAllowed

constexpr char cuttlefish::ModemService::kCmeErrorFixedDialNumberOnlyAllowed[]
staticconstexpr
Initial value:
=
"+CME ERROR: 56"

◆ kCmeErrorInCorrectParameters

constexpr char cuttlefish::ModemService::kCmeErrorInCorrectParameters[] = "+CME ERROR: 50"
staticconstexpr

◆ kCmeErrorIncorrectPassword

constexpr char cuttlefish::ModemService::kCmeErrorIncorrectPassword[] = "+CME ERROR: 16"
staticconstexpr

◆ kCmeErrorInvalidCharactersInTextString

constexpr char cuttlefish::ModemService::kCmeErrorInvalidCharactersInTextString[]
staticconstexpr
Initial value:
=
"+CME ERROR: 27"

◆ kCmeErrorInvalidIndex

constexpr char cuttlefish::ModemService::kCmeErrorInvalidIndex[] = "+CME ERROR: 21"
staticconstexpr

◆ kCmeErrorMemoryFull

constexpr char cuttlefish::ModemService::kCmeErrorMemoryFull[] = "+CME ERROR: 20"
staticconstexpr

◆ kCmeErrorNetworkNotAllowedEmergencyCallsOnly

constexpr char cuttlefish::ModemService::kCmeErrorNetworkNotAllowedEmergencyCallsOnly[]
staticconstexpr
Initial value:
=
"+CME ERROR: 32"

◆ kCmeErrorNetworkNotAttachedDueToMTFunctionalRestrictions

constexpr char cuttlefish::ModemService::kCmeErrorNetworkNotAttachedDueToMTFunctionalRestrictions[]
staticconstexpr
Initial value:
=
"+CME ERROR: 53"

◆ kCmeErrorNoNetworkService

constexpr char cuttlefish::ModemService::kCmeErrorNoNetworkService[] = "+CME ERROR: 30"
staticconstexpr

◆ kCmeErrorNotFound

constexpr char cuttlefish::ModemService::kCmeErrorNotFound[] = "+CME ERROR: 22"
staticconstexpr

◆ kCmeErrorOperationNotAllowed

constexpr char cuttlefish::ModemService::kCmeErrorOperationNotAllowed[] = "+CME ERROR: 3"
staticconstexpr

◆ kCmeErrorOperationNotSupported

constexpr char cuttlefish::ModemService::kCmeErrorOperationNotSupported[] = "+CME ERROR: 4"
staticconstexpr

◆ kCmeErrorSimBusy

constexpr char cuttlefish::ModemService::kCmeErrorSimBusy[] = "+CME ERROR: 14"
staticconstexpr

◆ kCmeErrorSimNotInserted

constexpr char cuttlefish::ModemService::kCmeErrorSimNotInserted[] = "+CME ERROR: 10"
staticconstexpr

◆ kCmeErrorSimPinRequired

constexpr char cuttlefish::ModemService::kCmeErrorSimPinRequired[] = "+CME ERROR: 11"
staticconstexpr

◆ kCmeErrorSimPukRequired

constexpr char cuttlefish::ModemService::kCmeErrorSimPukRequired[] = "+CME ERROR: 12"
staticconstexpr

◆ kCmsErrorInvalidPDUModeParam

constexpr char cuttlefish::ModemService::kCmsErrorInvalidPDUModeParam[] = "+CMS ERROR: 304"
staticconstexpr

◆ kCmsErrorOperationNotAllowed

constexpr char cuttlefish::ModemService::kCmsErrorOperationNotAllowed[] = "+CMS ERROR: 302"
staticconstexpr

◆ kCmsErrorOperationNotSupported

constexpr char cuttlefish::ModemService::kCmsErrorOperationNotSupported[] = "+CMS ERROR: 303"
staticconstexpr

◆ kCmsErrorSCAddressUnknown

constexpr char cuttlefish::ModemService::kCmsErrorSCAddressUnknown[] = "+CMS ERROR: 304"
staticconstexpr

◆ kRemotePortRange

constexpr std::pair<int, int> cuttlefish::ModemService::kRemotePortRange {6520, 6527}
staticconstexpr

◆ service_id_

int32_t cuttlefish::ModemService::service_id_
protected

◆ thread_looper_

ThreadLooper* cuttlefish::ModemService::thread_looper_
protected

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