[][src]Struct huawei_modem::pdu::Pdu

pub struct Pdu {
    pub sca: Option<PduAddress>,
    pub first_octet: PduFirstOctet,
    pub message_id: u8,
    pub destination: PduAddress,
    pub dcs: DataCodingScheme,
    pub validity_period: u8,
    pub user_data: Vec<u8>,
    pub user_data_len: u8,
}

An SMS-SUBMIT PDU.

NB: For simple usage, ignore 99% of the stuff in this module and just use Pdu::make_simple_message!

Fields

sca: Option<PduAddress>

Service centre address, if provided here.

If you haven't set the service center address for all messages (see the set_smsc_addr function in cmd::sms), you'll need to provide it in SMS-SUBMIT PDUs using the set_sca method.

first_octet: PduFirstOctet

First octet (contains some extra fields).

message_id: u8

Message ID.

This is set to 0 in make_simple_message. Presumably, you might ostensibly be able to use it to store outgoing messages in modem memory and then address them later?

destination: PduAddress

Destination address (i.e. mesage recipient).

dcs: DataCodingScheme

Message data coding scheme.

validity_period: u8

Validity period (used for message expiry).

FIXME: as yet undocumented.

user_data: Vec<u8>

User data.

user_data_len: u8

User data length.

Methods

impl Pdu[src]

pub fn set_sca(&mut self, sca: PduAddress)[src]

Set the SMS service centre address.

pub fn make_simple_message(recipient: PduAddress, msg: GsmMessageData) -> Self[src]

Simple helper function to send a message to someone, prefilling in all the annoying fields for you.

impl Pdu[src]

pub fn as_bytes(&self) -> (Vec<u8>, usize)[src]

Convert to wire-format bytes, with a TPDU length value.

Trait Implementations

impl PartialEq<Pdu> for Pdu[src]

impl Clone for Pdu[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Pdu[src]

impl Debug for Pdu[src]

Auto Trait Implementations

impl Send for Pdu

impl Sync for Pdu

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T