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

#include <data_service.h>

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

Classes

struct  PDPContext
 

Public Member Functions

 DataService (int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
 
 ~DataService ()=default
 
 DataService (const DataService &)=delete
 
DataServiceoperator= (const DataService &)=delete
 
void HandleActivateDataCall (const Client &client, const std::string &command)
 
void HandleQueryDataCallList (const Client &client)
 
void HandlePDPContext (const Client &client, const std::string &command)
 
void HandleQueryPDPContextList (const Client &client)
 
void HandleEnterDataState (const Client &client, const std::string &command)
 
void HandleReadDynamicParam (const Client &client, const std::string &command)
 
void onUpdatePhysicalChannelconfigs (int modem_tech, int freq, int cellBandwidthDownlink)
 
- 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

std::vector< CommandHandlerInitializeCommandHandlers ()
 
void InitializeServiceState ()
 
void sendOnePhysChanCfgUpdate (int status, int bandwidth, int rat, int freq, int id)
 
void updatePhysicalChannelconfigs (int modem_tech, int freq, int cellBandwidthDownlink, int count)
 

Private Attributes

std::vector< PDPContextpdp_context_
 

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

◆ DataService() [1/2]

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

◆ ~DataService()

cuttlefish::DataService::~DataService ( )
default

◆ DataService() [2/2]

cuttlefish::DataService::DataService ( const DataService )
delete

Member Function Documentation

◆ HandleActivateDataCall()

void cuttlefish::DataService::HandleActivateDataCall ( const Client client,
const std::string &  command 
)

AT+CGACT The execution command is used to activate or deactivate the specified PDP context(s).

Command Possible response(s) +CGACT=[<state>[,<cid> OK [,<cid>[,...]]]] +CME ERROR: <err> +CGACT? [+CGACT: <cid>,<state>] [<CR><LF>+CGACT: <cid>,<state>[...]] <state>: integer type; indicates the state of PDP context activation. 0: deactivated 1: activated <cid>: (PDP Context Identifier) integer(1~15), specifies the PDP context ID.

see RIL_REQUEST_SETUP_DATA_CALL in RIL

◆ HandleEnterDataState()

void cuttlefish::DataService::HandleEnterDataState ( const Client client,
const std::string &  command 
)

AT+CGDATA The execution command causes the MT to perform whatever actions are necessary to establish communication between the TE and the network using one or more Packet Domain PDP types.

Command Possible response(s) +CGDATA[=<L2P>[,[,<cid> CONNECT [,...]]]] ERROR +CME ERROR: <err>

<L2P>: string type; indicates the layer 2 protocol to be used between the TE and MT NULL none, for PDP type OSP:IHOSS (Obsolete) value: PPP, PAD, X25, M-xxxx <cid>: see AT+CGACT

see RIL_REQUEST_SETUP_DATA_CALL in RIL

◆ HandlePDPContext()

void cuttlefish::DataService::HandlePDPContext ( const Client client,
const std::string &  command 
)

AT+CGDCONT The set command specifies PDP context parameter values for a PDP context identified by the (local) context identification parameter, <cid>.

Command Possible response(s) +CGDCONT=[<cid>[,<PDP_type>[,<APN> OK [,<PDP_addr>[,<d_comp> [,<h_comp>] +CME ERROR: <err> ]]]]] +CGDCONT? +CGDCONT: <cid>,<pdp_type>,<APN>, <pdp_addr>,<d_comp>,<h_comp><CR><LF> [+CGDCONT: <cid>,<pdp_type>,<APN>, <pdp_addr>,<d_comp>,<h_comp><CR><LF>[...]] OK <cid>: see AT+CGACT <PDP_type>: string type; specifies the type of packet data protocol. Value: X.25, IP, IPV6, IPV4V6, OSPIH, PPP, Non-IP,Ethernet <APN>: string type; a logical name that is used to select the GGSN or the external packet data network.If the value is null or omitted, then the subscription value will be requested <PDP_addr>: string type; identifies the MT in the address space applicable to the PDP <d_comp>: integer type; controls PDP data compression <h_comp>: integer type; controls PDP header compression

see RIL_REQUEST_SETUP_DATA_CALL in RIL

◆ HandleQueryDataCallList()

void cuttlefish::DataService::HandleQueryDataCallList ( const Client client)

see AT+CGACT

◆ HandleQueryPDPContextList()

void cuttlefish::DataService::HandleQueryPDPContextList ( const Client client)

see AT+CGDCONT above

◆ HandleReadDynamicParam()

void cuttlefish::DataService::HandleReadDynamicParam ( const Client client,
const std::string &  command 
)

AT+CGCONTRDP The execution command returns the relevant information for an active non secondary PDP context with the context identifier <cid>.

Command Possible response(s) +CGCONTRDP[=<cid>] [+CGCONTRDP: <cid>,<bearer_id>,<apn> [,<local_addr and subnet_mask>[,<gw_addr> [,<DNS_prim_addr>[<DNS_sec_addr>[...]]]]]] [<CR><LF>+CGCONTRDP: <cid>,<bearer_id>,<apn> [,<local_addr and subnet_mask>[,<gw_addr> [,<DNS_prim_addr>[<DNS_sec_addr>[...]]]]]]

<cid>: see AT+CGACT <bearer_id>: integer type; identifies the bearer, i.e. the EPS bearer and the NSAPI. <local_addr and subnet_mask>: string type; shows the IP address and subnet mask of the MT. <gw_addr>: string type; shows the Gateway Address of the MT. The string is given as dot-separated numeric (0-255) parameters. <DNS_prim_addr>: string type; shows the IP address of the primary DNS server. <DNS_sec_addr>: string type; shows the IP address of the secondary DNS server.

see RIL_REQUEST_SETUP_DATA_CALL in RIL

◆ InitializeCommandHandlers()

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

◆ InitializeServiceState()

void cuttlefish::DataService::InitializeServiceState ( )
private

◆ onUpdatePhysicalChannelconfigs()

void cuttlefish::DataService::onUpdatePhysicalChannelconfigs ( int  modem_tech,
int  freq,
int  cellBandwidthDownlink 
)

◆ operator=()

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

◆ sendOnePhysChanCfgUpdate()

void cuttlefish::DataService::sendOnePhysChanCfgUpdate ( int  status,
int  bandwidth,
int  rat,
int  freq,
int  id 
)
private

◆ updatePhysicalChannelconfigs()

void cuttlefish::DataService::updatePhysicalChannelconfigs ( int  modem_tech,
int  freq,
int  cellBandwidthDownlink,
int  count 
)
private

Member Data Documentation

◆ pdp_context_

std::vector<PDPContext> cuttlefish::DataService::pdp_context_
private

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