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

#include <pdu_parser.h>

Collaboration diagram for cuttlefish::PDUParser:
Collaboration graph
[legend]

Public Member Functions

 PDUParser (std::string &pdu)
 
 ~PDUParser ()=default
 
bool IsValidPDU ()
 
bool IsNeededStatuReport ()
 
std::string CreatePDU ()
 
std::string CreateRemotePDU (std::string &host_port)
 
std::string CreateStatuReport (int message_reference)
 
std::string GetPhoneNumberFromAddress ()
 

Static Public Member Functions

static std::string BCDToString (std::string &data)
 
static std::string StringToBCD (std::string_view data)
 

Private Member Functions

bool DecodePDU (std::string &pdu)
 
int Hex2ToByte (const std::string &hex)
 
int HexCharToInt (char c)
 
std::string IntToHexString (int value)
 
std::string IntToHexStringTimeZoneDiff (int tzdiff_hour)
 
std::string GetCurrentTimeStamp ()
 

Private Attributes

bool is_valid_pdu_
 
std::string pdu_type_
 
std::string message_reference_
 
std::string originator_address_
 
std::string protocol_id_
 
std::string data_code_scheme_
 
std::string user_data_
 

Constructor & Destructor Documentation

◆ PDUParser()

cuttlefish::PDUParser::PDUParser ( std::string &  pdu)
explicit

◆ ~PDUParser()

cuttlefish::PDUParser::~PDUParser ( )
default

Member Function Documentation

◆ BCDToString()

std::string cuttlefish::PDUParser::BCDToString ( std::string &  data)
static

◆ CreatePDU()

std::string cuttlefish::PDUParser::CreatePDU ( )

The PDU-Type of receiver BIT 7 6 5 4 3 2 1 0 Param RP UDHI SRI - - MMS MTI MTI When SRR bit is 1, it represents that SMS status report should be reported.

◆ CreateRemotePDU()

std::string cuttlefish::PDUParser::CreateRemotePDU ( std::string &  host_port)

◆ CreateStatuReport()

std::string cuttlefish::PDUParser::CreateStatuReport ( int  message_reference)

◆ DecodePDU()

bool cuttlefish::PDUParser::DecodePDU ( std::string &  pdu)
private

PDU format: SCA PDU-Type MR OA PID DCS VP UDL UD bytes: 1-12 1 1 2-12 1 1 0 1 0-140 eg. 00 21 00 0B 91 5155255155F4 00 00 0C AB58AD56ABC962B55A8D06

◆ GetCurrentTimeStamp()

std::string cuttlefish::PDUParser::GetCurrentTimeStamp ( )
private

◆ GetPhoneNumberFromAddress()

std::string cuttlefish::PDUParser::GetPhoneNumberFromAddress ( )

◆ Hex2ToByte()

int cuttlefish::PDUParser::Hex2ToByte ( const std::string &  hex)
private

◆ HexCharToInt()

int cuttlefish::PDUParser::HexCharToInt ( char  c)
private

◆ IntToHexString()

std::string cuttlefish::PDUParser::IntToHexString ( int  value)
private

◆ IntToHexStringTimeZoneDiff()

std::string cuttlefish::PDUParser::IntToHexStringTimeZoneDiff ( int  tzdiff_hour)
private

◆ IsNeededStatuReport()

bool cuttlefish::PDUParser::IsNeededStatuReport ( )

the PDU-Type of sender BIT 7 6 5 4 3 2 1 0 Param RP UDHI SRR VPF VPF RD MTI MTI When SRR bit is 1, it represents that SMS status report should be reported.

◆ IsValidPDU()

bool cuttlefish::PDUParser::IsValidPDU ( )

◆ StringToBCD()

std::string cuttlefish::PDUParser::StringToBCD ( std::string_view  data)
static

Member Data Documentation

◆ data_code_scheme_

std::string cuttlefish::PDUParser::data_code_scheme_
private

◆ is_valid_pdu_

bool cuttlefish::PDUParser::is_valid_pdu_
private

◆ message_reference_

std::string cuttlefish::PDUParser::message_reference_
private

◆ originator_address_

std::string cuttlefish::PDUParser::originator_address_
private

◆ pdu_type_

std::string cuttlefish::PDUParser::pdu_type_
private

◆ protocol_id_

std::string cuttlefish::PDUParser::protocol_id_
private

◆ user_data_

std::string cuttlefish::PDUParser::user_data_
private

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