# WARNING: Please don't edit this file. It was generated by Python/WinRT v3.2.1

import datetime
import sys
import types
import typing
import uuid as _uuid
from builtins import property as _property

import winrt._winrt
import winrt.system
import winrt.windows.foundation as windows_foundation
import winrt.windows.storage.streams as windows_storage_streams

from winrt.windows.devices.serialcommunication import SerialError, SerialHandshake, SerialParity, SerialPinChange, SerialStopBitCount

Self = typing.TypeVar('Self')

@typing.final
class ErrorReceivedEventArgs(winrt.system.Object):
    # Windows.Devices.SerialCommunication.SerialError Windows.Devices.SerialCommunication.ErrorReceivedEventArgs::get_Error()
    @_property
    def error(self) -> SerialError: ...

@typing.final
class PinChangedEventArgs(winrt.system.Object):
    # Windows.Devices.SerialCommunication.SerialPinChange Windows.Devices.SerialCommunication.PinChangedEventArgs::get_PinChange()
    @_property
    def pin_change(self) -> SerialPinChange: ...

@typing.final
class SerialDevice_Static(winrt._winrt.IInspectable_Static):
    # Windows.Foundation.IAsyncOperation`1<Windows.Devices.SerialCommunication.SerialDevice> Windows.Devices.SerialCommunication.SerialDevice::FromIdAsync(System.String)
    def from_id_async(cls, device_id: str, /) -> windows_foundation.IAsyncOperation[SerialDevice]: ...
    # System.String Windows.Devices.SerialCommunication.SerialDevice::GetDeviceSelector()
    def get_device_selector(cls) -> str: ...
    # System.String Windows.Devices.SerialCommunication.SerialDevice::GetDeviceSelector(System.String)
    def get_device_selector_from_port_name(cls, port_name: str, /) -> str: ...
    # System.String Windows.Devices.SerialCommunication.SerialDevice::GetDeviceSelectorFromUsbVidPid(System.UInt16,System.UInt16)
    def get_device_selector_from_usb_vid_pid(cls, vendor_id: winrt.system.UInt16, product_id: winrt.system.UInt16, /) -> str: ...

@typing.final
class SerialDevice(winrt.system.Object, windows_foundation.IClosable, metaclass=SerialDevice_Static):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::Close()
    def close(self) -> None: ...
    # Windows.Foundation.EventRegistrationToken Windows.Devices.SerialCommunication.SerialDevice::add_ErrorReceived(Windows.Foundation.TypedEventHandler`2<Windows.Devices.SerialCommunication.SerialDevice,Windows.Devices.SerialCommunication.ErrorReceivedEventArgs>)
    def add_error_received(self, report_handler: windows_foundation.TypedEventHandler[SerialDevice, ErrorReceivedEventArgs], /) -> windows_foundation.EventRegistrationToken: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::remove_ErrorReceived(Windows.Foundation.EventRegistrationToken)
    def remove_error_received(self, token: typing.Union[windows_foundation.EventRegistrationToken, typing.Tuple[winrt.system.Int64]], /) -> None: ...
    # Windows.Foundation.EventRegistrationToken Windows.Devices.SerialCommunication.SerialDevice::add_PinChanged(Windows.Foundation.TypedEventHandler`2<Windows.Devices.SerialCommunication.SerialDevice,Windows.Devices.SerialCommunication.PinChangedEventArgs>)
    def add_pin_changed(self, report_handler: windows_foundation.TypedEventHandler[SerialDevice, PinChangedEventArgs], /) -> windows_foundation.EventRegistrationToken: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::remove_PinChanged(Windows.Foundation.EventRegistrationToken)
    def remove_pin_changed(self, token: typing.Union[windows_foundation.EventRegistrationToken, typing.Tuple[winrt.system.Int64]], /) -> None: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_IsDataTerminalReadyEnabled()
    @_property
    def is_data_terminal_ready_enabled(self) -> bool: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_IsDataTerminalReadyEnabled(System.Boolean)
    @is_data_terminal_ready_enabled.setter
    def is_data_terminal_ready_enabled(self, value: bool) -> None: ...
    # System.UInt16 Windows.Devices.SerialCommunication.SerialDevice::get_DataBits()
    @_property
    def data_bits(self) -> winrt.system.UInt16: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_DataBits(System.UInt16)
    @data_bits.setter
    def data_bits(self, value: winrt.system.UInt16) -> None: ...
    # Windows.Devices.SerialCommunication.SerialHandshake Windows.Devices.SerialCommunication.SerialDevice::get_Handshake()
    @_property
    def handshake(self) -> SerialHandshake: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_Handshake(Windows.Devices.SerialCommunication.SerialHandshake)
    @handshake.setter
    def handshake(self, value: SerialHandshake) -> None: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_BreakSignalState()
    @_property
    def break_signal_state(self) -> bool: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_BreakSignalState(System.Boolean)
    @break_signal_state.setter
    def break_signal_state(self, value: bool) -> None: ...
    # System.UInt32 Windows.Devices.SerialCommunication.SerialDevice::get_BaudRate()
    @_property
    def baud_rate(self) -> winrt.system.UInt32: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_BaudRate(System.UInt32)
    @baud_rate.setter
    def baud_rate(self, value: winrt.system.UInt32) -> None: ...
    # Windows.Foundation.TimeSpan Windows.Devices.SerialCommunication.SerialDevice::get_WriteTimeout()
    @_property
    def write_timeout(self) -> datetime.timedelta: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_WriteTimeout(Windows.Foundation.TimeSpan)
    @write_timeout.setter
    def write_timeout(self, value: datetime.timedelta) -> None: ...
    # Windows.Devices.SerialCommunication.SerialStopBitCount Windows.Devices.SerialCommunication.SerialDevice::get_StopBits()
    @_property
    def stop_bits(self) -> SerialStopBitCount: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_StopBits(Windows.Devices.SerialCommunication.SerialStopBitCount)
    @stop_bits.setter
    def stop_bits(self, value: SerialStopBitCount) -> None: ...
    # Windows.Foundation.TimeSpan Windows.Devices.SerialCommunication.SerialDevice::get_ReadTimeout()
    @_property
    def read_timeout(self) -> datetime.timedelta: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_ReadTimeout(Windows.Foundation.TimeSpan)
    @read_timeout.setter
    def read_timeout(self, value: datetime.timedelta) -> None: ...
    # Windows.Devices.SerialCommunication.SerialParity Windows.Devices.SerialCommunication.SerialDevice::get_Parity()
    @_property
    def parity(self) -> SerialParity: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_Parity(Windows.Devices.SerialCommunication.SerialParity)
    @parity.setter
    def parity(self, value: SerialParity) -> None: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_IsRequestToSendEnabled()
    @_property
    def is_request_to_send_enabled(self) -> bool: ...
    # System.Void Windows.Devices.SerialCommunication.SerialDevice::put_IsRequestToSendEnabled(System.Boolean)
    @is_request_to_send_enabled.setter
    def is_request_to_send_enabled(self, value: bool) -> None: ...
    # System.UInt32 Windows.Devices.SerialCommunication.SerialDevice::get_BytesReceived()
    @_property
    def bytes_received(self) -> winrt.system.UInt32: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_CarrierDetectState()
    @_property
    def carrier_detect_state(self) -> bool: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_ClearToSendState()
    @_property
    def clear_to_send_state(self) -> bool: ...
    # System.Boolean Windows.Devices.SerialCommunication.SerialDevice::get_DataSetReadyState()
    @_property
    def data_set_ready_state(self) -> bool: ...
    # Windows.Storage.Streams.IInputStream Windows.Devices.SerialCommunication.SerialDevice::get_InputStream()
    @_property
    def input_stream(self) -> windows_storage_streams.IInputStream: ...
    # Windows.Storage.Streams.IOutputStream Windows.Devices.SerialCommunication.SerialDevice::get_OutputStream()
    @_property
    def output_stream(self) -> windows_storage_streams.IOutputStream: ...
    # System.String Windows.Devices.SerialCommunication.SerialDevice::get_PortName()
    @_property
    def port_name(self) -> str: ...
    # System.UInt16 Windows.Devices.SerialCommunication.SerialDevice::get_UsbProductId()
    @_property
    def usb_product_id(self) -> winrt.system.UInt16: ...
    # System.UInt16 Windows.Devices.SerialCommunication.SerialDevice::get_UsbVendorId()
    @_property
    def usb_vendor_id(self) -> winrt.system.UInt16: ...

