CustomDevice
CustomDevice
CustomDevice
CustomDevice
Class
Definition
Represents a custom device.
public : sealed class CustomDevice : ICustomDevicepublic sealed class CustomDevice : ICustomDevicePublic NotInheritable Class CustomDevice Implements ICustomDevice// You can use this class in JavaScript.
- Attributes
| Device family |
Windows Desktop Extension SDK (introduced v10.0.10240.0)
|
| API contract |
Windows.Devices.Custom.CustomDeviceContract (introduced v1)
|
Properties
InputStream InputStream InputStream InputStream
The input stream.
public : IInputStream InputStream { get; }public IInputStream InputStream { get; }Public ReadOnly Property InputStream As IInputStream// You can use this property in JavaScript.
The input stream.
Methods
FromIdAsync(String, DeviceAccessMode, DeviceSharingMode) FromIdAsync(String, DeviceAccessMode, DeviceSharingMode) FromIdAsync(String, DeviceAccessMode, DeviceSharingMode) FromIdAsync(String, DeviceAccessMode, DeviceSharingMode)
Creates a CustomDevice object asynchronously for the specified DeviceInformation.Id.
public : static IAsyncOperation<CustomDevice> FromIdAsync(PlatForm::String deviceId, DeviceAccessMode desiredAccess, DeviceSharingMode sharingMode)public static IAsyncOperation<CustomDevice> FromIdAsync(String deviceId, DeviceAccessMode desiredAccess, DeviceSharingMode sharingMode)Public Static Function FromIdAsync(deviceId As String, desiredAccess As DeviceAccessMode, sharingMode As DeviceSharingMode) As IAsyncOperation( Of CustomDevice )// You can use this method in JavaScript.
- deviceId
- PlatForm::String String String String
The DeviceInformation.Id of the device .
- desiredAccess
- DeviceAccessMode DeviceAccessMode DeviceAccessMode DeviceAccessMode
The desired access.
The sharing mode.
Returns a custom device.
| Device family |
Windows Desktop Extension SDK (introduced v10.0.10240.0)
|
| API contract |
Windows.Devices.Custom.CustomDeviceContract (introduced v1)
|
| Capabilities |
optical
|
GetDeviceSelector(Guid) GetDeviceSelector(Guid) GetDeviceSelector(Guid) GetDeviceSelector(Guid)
Gets a device selector.
public : static PlatForm::String GetDeviceSelector(PlatForm::Guid classGuid)public static string GetDeviceSelector(Guid classGuid)Public Static Function GetDeviceSelector(classGuid As Guid) As string// You can use this method in JavaScript.
- classGuid
- PlatForm::Guid Guid Guid Guid
The Device Interface Class GUID of the device interface to create a device selector for.
The device selector.
Remarks
For more info about the Device Interface Class GUID, see Overview of Device Interface Classes.
- See Also
SendIOControlAsync(IIOControlCode, IBuffer, IBuffer) SendIOControlAsync(IIOControlCode, IBuffer, IBuffer) SendIOControlAsync(IIOControlCode, IBuffer, IBuffer) SendIOControlAsync(IIOControlCode, IBuffer, IBuffer)
Sends an IO control code.
public : IAsyncOperation<unsigned int> SendIOControlAsync(IIOControlCode ioControlCode, IBuffer inputBuffer, IBuffer outputBuffer)public IAsyncOperation<uint> SendIOControlAsync(IIOControlCode ioControlCode, IBuffer inputBuffer, IBuffer outputBuffer)Public Function SendIOControlAsync(ioControlCode As IIOControlCode, inputBuffer As IBuffer, outputBuffer As IBuffer) As IAsyncOperation( Of uint )// You can use this method in JavaScript.
- ioControlCode
- IIOControlCode IIOControlCode IIOControlCode IIOControlCode
The IO control code.
The result of the async operation.
Remarks
SendIOControlAsync is like TrySendIOControlAsync, except this method throws an exception if the operation fails. If you want to handle any exceptions that occur during the operation, use the SendIOControlAsync method. If you just want to be notified whether the operation is successful, but not handle any specific exceptions, use TrySendIOControlAsync.
TrySendIOControlAsync(IIOControlCode, IBuffer, IBuffer) TrySendIOControlAsync(IIOControlCode, IBuffer, IBuffer) TrySendIOControlAsync(IIOControlCode, IBuffer, IBuffer) TrySendIOControlAsync(IIOControlCode, IBuffer, IBuffer)
Sends an IO control code. A return value indicates whether the operation succeeded.
public : IAsyncOperation<PlatForm::Boolean> TrySendIOControlAsync(IIOControlCode ioControlCode, IBuffer inputBuffer, IBuffer outputBuffer)public IAsyncOperation<bool> TrySendIOControlAsync(IIOControlCode ioControlCode, IBuffer inputBuffer, IBuffer outputBuffer)Public Function TrySendIOControlAsync(ioControlCode As IIOControlCode, inputBuffer As IBuffer, outputBuffer As IBuffer) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
- ioControlCode
- IIOControlCode IIOControlCode IIOControlCode IIOControlCode
The IO control code.
true if the operation is successful; otherwise, false.
Remarks
TrySendIOControlAsync is like SendIOControlAsync, except this method doesn't throw an exception if the operation fails. Instead, it returns false. If you want to handle any exceptions that occur during the operation, use the SendIOControlAsync method.