?? gsm_sms.h
字號:
bool _moreMessagesToSend;
bool _statusReportQualifier;
unsigned char _messageReference;
Address _recipientAddress;
Timestamp _serviceCentreTimestamp;
Timestamp _dischargeTime;
unsigned char _status; // octet
// initialize members to sensible values
void init();
public:
// constructor, sets sensible default values
SMSStatusReportMessage() {init();}
// constructor with given pdu
SMSStatusReportMessage(string pdu) throw(GsmException);
// encode pdu, return hexadecimal pdu string
virtual string encode();
// create textual representation of SMS
virtual string toString() const;
// inherited from SMSMessage
Address address() const;
Ref<SMSMessage> clone();
// accessor functions
bool moreMessagesToSend() const {return _moreMessagesToSend;}
bool statusReportQualifier() const {return _statusReportQualifier;}
unsigned char messageReference() const {return _messageReference;}
Address recipientAddress() const {return _recipientAddress;}
Timestamp serviceCentreTimestamp() const {return _serviceCentreTimestamp;}
Timestamp dischargeTime() const {return _dischargeTime;}
unsigned char status() const {return _status;}
void setMoreMessagesToSend(bool x) {_moreMessagesToSend = x;}
void setStatusReportQualifier(bool x) {_statusReportQualifier = x;}
void setMessageReference(unsigned char x) {_messageReference = x;}
void setRecipientAddress(Address x) {_recipientAddress = x;}
void setServiceCentreTimestamp(Timestamp x) {_serviceCentreTimestamp = x;}
void setDischargeTime(Timestamp x) {_serviceCentreTimestamp = x;}
void setStatus(unsigned char x) {_status = x;}
virtual ~SMSStatusReportMessage() {}
};
// SMS-COMMAND TPDU
class SMSCommandMessage : public SMSMessage
{
public:
// command types, other values are reserved or SC-specific
enum CommandType {EnquireSM = 0, CancelStatusReportRequest = 1,
DeleteSubmittedSM = 2, EnalbeStatusReportRequest = 3};
private:
// SMS-COMMAND PDU (see GSM 03.40 section 9.2.2.4)
unsigned char _messageReference;
bool _statusReportRequest;
unsigned char _protocolIdentifier;
unsigned char _commandType;
unsigned char _messageNumber;
Address _destinationAddress;
unsigned char _commandDataLength;
string _commandData;
// initialize members to sensible values
void init();
public:
// constructor, sets sensible default values
SMSCommandMessage() {init();}
// constructor with given pdu
SMSCommandMessage(string pdu) throw(GsmException);
// encode pdu, return hexadecimal pdu string
virtual string encode();
// create textual representation of SMS
virtual string toString() const;
// inherited from SMSMessage
Address address() const;
Ref<SMSMessage> clone();
// accessor functions
unsigned char messageReference() const {return _messageReference;}
bool statusReportRequest() const {return _statusReportRequest;}
unsigned char protocolIdentifier() const {return _protocolIdentifier;}
unsigned char commandType() const {return _commandType;}
unsigned char messageNumber() const {return _messageNumber;}
Address destinationAddress() const {return _destinationAddress;}
unsigned char commandDataLength() const {return _commandDataLength;}
string commandData() const {return _commandData;}
void setMessageReference(unsigned char x) {_messageReference = x;}
void setStatusReportRequest(bool x) {_statusReportRequest = x;}
void setProtocolIdentifier(unsigned char x) {_protocolIdentifier = x;}
void setCommandType(unsigned char x) {_commandType = x;}
void setMessageNumber(unsigned char x) {_messageNumber = x;}
void setDestinationAddress(Address &x) {_destinationAddress = x;}
void setCommandDataLength(unsigned char x) {_commandDataLength = x;}
void setCommandData(string x) {_commandData = x;}
virtual ~SMSCommandMessage() {}
};
// SMS-DELIVER-REPORT TPDU for RP-ACK
class SMSDeliverReportMessage : public SMSMessage
{
private:
// SMS-DELIVER-REPORT PDU (see GSM 03.40 section 9.2.2.1a (II))
bool _protocolIdentifierPresent; // parameter indicator
bool _dataCodingSchemePresent;
bool _userDataLengthPresent;
unsigned char _protocolIdentifier;
// initialize members to sensible values
void init();
public:
// constructor, sets sensible default values
SMSDeliverReportMessage() {init();}
// constructor with given pdu
SMSDeliverReportMessage(string pdu) throw(GsmException);
// encode pdu, return hexadecimal pdu string
virtual string encode();
// create textual representation of SMS
virtual string toString() const;
// inherited from SMSMessage
Address address() const;
Ref<SMSMessage> clone();
// accessor functions
bool protocolIdentifierPresent() const {return _protocolIdentifierPresent;}
bool dataCodingSchemePresent() const {return _dataCodingSchemePresent;}
bool userDataLengthPresent() const {return _userDataLengthPresent;}
unsigned char protocolIdentifier() const
{assert(_protocolIdentifierPresent); return _protocolIdentifier;}
DataCodingScheme dataCodingScheme() const
{assert(_dataCodingSchemePresent); return _dataCodingScheme;}
UserDataHeader userDataHeader() const
{assert(_userDataLengthPresent); return _userDataHeader;}
string userData() const
{assert(_userDataLengthPresent); return _userData;}
void setProtocolIdentifier(unsigned char x)
{_protocolIdentifierPresent = true; _protocolIdentifier = x;}
void setDataCodingScheme(DataCodingScheme x)
{_dataCodingSchemePresent = true; _dataCodingScheme = x;}
void setUserDataHeader(UserDataHeader x)
{
_userDataLengthPresent = true;
_userDataHeader = x;
}
void setUserData(string x)
{
_userDataLengthPresent = true;
_userData = x;
}
virtual ~SMSDeliverReportMessage() {}
};
// SMS-SUBMIT-REPORT TPDU for RP-ACK
class SMSSubmitReportMessage : public SMSMessage
{
private:
// SMS-SUBMIT-REPORT PDU (see GSM 03.40 section 9.2.2.2a (II))
Timestamp _serviceCentreTimestamp;
bool _protocolIdentifierPresent; // parameter indicator
bool _dataCodingSchemePresent;
bool _userDataLengthPresent;
unsigned char _protocolIdentifier;
DataCodingScheme _dataCodingScheme;
// initialize members to sensible values
void init();
public:
// constructor, sets sensible default values
SMSSubmitReportMessage() {init();}
// constructor with given pdu
SMSSubmitReportMessage(string pdu) throw(GsmException);
// encode pdu, return hexadecimal pdu string
virtual string encode();
// create textual representation of SMS
virtual string toString() const;
// inherited from SMSMessage
Address address() const;
Ref<SMSMessage> clone();
// accessor functions
Timestamp serviceCentreTimestamp() const {return _serviceCentreTimestamp;}
bool protocolIdentifierPresent() const {return _protocolIdentifierPresent;}
bool dataCodingSchemePresent() const {return _dataCodingSchemePresent;}
bool userDataLengthPresent() const {return _userDataLengthPresent;}
unsigned char protocolIdentifier() const
{assert(_protocolIdentifierPresent); return _protocolIdentifier;}
DataCodingScheme dataCodingScheme() const
{assert(_dataCodingSchemePresent); return _dataCodingScheme;}
UserDataHeader userDataHeader() const
{assert(_userDataLengthPresent); return _userDataHeader;}
string userData() const
{assert(_userDataLengthPresent); return _userData;}
void setServiceCentreTimestamp(Timestamp &x) {_serviceCentreTimestamp = x;}
void setProtocolIdentifier(unsigned char x)
{_protocolIdentifierPresent = true; _protocolIdentifier = x;}
void setDataCodingScheme(DataCodingScheme x)
{_dataCodingSchemePresent = true; _dataCodingScheme = x;}
void setUserDataHeader(UserDataHeader x)
{
_userDataLengthPresent = true;
_userDataHeader = x;
}
void setUserData(string x)
{
_userDataLengthPresent = true;
_userData = x;
}
virtual ~SMSSubmitReportMessage() {}
};
// some useful typdefs
typedef Ref<SMSMessage> SMSMessageRef;
};
#endif // GSM_SMS_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -