SmsDevice2 SmsDevice2 SmsDevice2 SmsDevice2 Class

Definition

Extends the SmsDevice class, and supports the operation of a mobile broadband SMS device.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators, mobile broadband adapter IHV, or OEM. For more information, see Mobile Broadband: device apps.

public : sealed class SmsDevice2 : ISmsDevice2public sealed class SmsDevice2 : ISmsDevice2Public NotInheritable Class SmsDevice2 Implements ISmsDevice2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

Remarks

Use this class as you would use the SmsDevice class, when you need the additional properties and methods this class provides.

Properties

AccountPhoneNumber AccountPhoneNumber AccountPhoneNumber AccountPhoneNumber

Gets the phone number associated with the SMS device. The phone number can be used to associate incoming messages with the account and possibly an external storage mechanism such as an account inbox.

public : PlatForm::String AccountPhoneNumber { get; }public string AccountPhoneNumber { get; }Public ReadOnly Property AccountPhoneNumber As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string representation of the account phone number.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

CellularClass CellularClass CellularClass CellularClass

Returns the cellular class of the SMS device. The class can be used to determine which encodings are appropriate or which device limitations are in effect.

public : CellularClass CellularClass { get; }public CellularClass CellularClass { get; }Public ReadOnly Property CellularClass As CellularClass// You can use this property in JavaScript.
Value
CellularClass CellularClass CellularClass CellularClass

An enumerated value indicating the device's cellular class.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

DeviceId DeviceId DeviceId DeviceId

The device ID of the device represented by this instance.

public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

String representation of the device ID.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

DeviceStatus DeviceStatus DeviceStatus DeviceStatus

Returns the SMS device's status, which indicates whether the device is ready, or not. It also indicates what type of problem exists if the device is not ready.

public : SmsDeviceStatus DeviceStatus { get; }public SmsDeviceStatus DeviceStatus { get; }Public ReadOnly Property DeviceStatus As SmsDeviceStatus// You can use this property in JavaScript.
Value
SmsDeviceStatus SmsDeviceStatus SmsDeviceStatus SmsDeviceStatus

An enumerated value that indicates the readiness of an SMS device to engage in cellular network traffic operations.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

ParentDeviceId ParentDeviceId ParentDeviceId ParentDeviceId

The parent device ID of this device.

public : PlatForm::String ParentDeviceId { get; }public string ParentDeviceId { get; }Public ReadOnly Property ParentDeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string representation of the device ID of the parent to this device.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

SmscAddress SmscAddress SmscAddress SmscAddress

Gets or sets the SMSC address of this device.

public : PlatForm::String SmscAddress { get; set; }public string SmscAddress { get; set; }Public ReadWrite Property SmscAddress As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string representation of the SMSC address of this device.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

Methods

CalculateLength(ISmsMessageBase) CalculateLength(ISmsMessageBase) CalculateLength(ISmsMessageBase) CalculateLength(ISmsMessageBase)

Estimates the transmitted message length of the specified text message. The estimate can be useful to clients that want to give an indication of how many messages will be sent on the network to carry the text of the full message.

public : SmsEncodedLength CalculateLength(ISmsMessageBase message)public SmsEncodedLength CalculateLength(ISmsMessageBase message)Public Function CalculateLength(message As ISmsMessageBase) As SmsEncodedLength// You can use this method in JavaScript.
Parameters
message
ISmsMessageBase ISmsMessageBase ISmsMessageBase ISmsMessageBase

A reference to the SMS text message to measure.

Returns

A reference to an SmsEncodedLength structure that is populated with the length information.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

FromId(String) FromId(String) FromId(String) FromId(String)

Creates an instance of SmsDevice2 for a device that received an SMS message.

public : static SmsDevice2 FromId(PlatForm::String deviceId)public static SmsDevice2 FromId(String deviceId)Public Static Function FromId(deviceId As String) As SmsDevice2// You can use this method in JavaScript.
Parameters
deviceId
PlatForm::String String String String

A string representation of the device ID of the device that received an SMS message.

Returns

An instance of SmsDevice2 initialized for the device with the given ID.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

FromParentId(String) FromParentId(String) FromParentId(String) FromParentId(String)

Creates an instance of SmsDevice2 for a device, given the device ID of the parent device.

public : static SmsDevice2 FromParentId(PlatForm::String parentDeviceId)public static SmsDevice2 FromParentId(String parentDeviceId)Public Static Function FromParentId(parentDeviceId As String) As SmsDevice2// You can use this method in JavaScript.
Parameters
parentDeviceId
PlatForm::String String String String

The device ID of the parent device.

Returns

An instance of SmsDevice2 initialized for the device with the given parent ID.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

GetDefault() GetDefault() GetDefault() GetDefault()

Creates an instance of SmsDevice2 associated with the default SMS device.

public : static SmsDevice2 GetDefault()public static SmsDevice2 GetDefault()Public Static Function GetDefault() As SmsDevice2// You can use this method in JavaScript.
Returns

An instance of SmsDevice2 initialized for the default SMS device.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Retrieves the class selection string that can be used to enumerate SMS devices.

public : static PlatForm::String GetDeviceSelector()public static string GetDeviceSelector()Public Static Function GetDeviceSelector() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

A reference to an Advanced Query Syntax (AQS) string that identifies an SMS device.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

SendMessageAndGetResultAsync(ISmsMessageBase) SendMessageAndGetResultAsync(ISmsMessageBase) SendMessageAndGetResultAsync(ISmsMessageBase) SendMessageAndGetResultAsync(ISmsMessageBase)

Asynchronously sends a message using the SMS device. The method is asynchronous because the send operation might not occur instantaneously. The message operation object is returned immediately.

public : IAsyncOperation<SmsSendMessageResult> SendMessageAndGetResultAsync(ISmsMessageBase message)public IAsyncOperation<SmsSendMessageResult> SendMessageAndGetResultAsync(ISmsMessageBase message)Public Function SendMessageAndGetResultAsync(message As ISmsMessageBase) As IAsyncOperation( Of SmsSendMessageResult )// You can use this method in JavaScript.
Parameters
message
ISmsMessageBase ISmsMessageBase ISmsMessageBase ISmsMessageBase

A reference to an object that implements the ISmsMessageBase interface. The message can be in text or binary format.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging

Events

DeviceStatusChanged DeviceStatusChanged DeviceStatusChanged DeviceStatusChanged

Sets an event handler to be called when the status of the SMS device changes.

public : event TypedEventHandler DeviceStatusChanged<SmsDevice2,  object>public event TypedEventHandler DeviceStatusChanged<SmsDevice2,  object>Public Event DeviceStatusChanged<SmsDevice2,  object>// You can use this event in JavaScript.
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
cellularMessaging