コード例 #1
0
 public BluetoothReciver(
     ConcurrentValue <ConnectionState> connectionStateWrapper,
     ConcurrentValue <BluetoothSocket> bluetoothSocketWrapper,
     CancellationToken cancellationToken = default,
     int bufferSize = ReciverBufferSizeDefault) : base(
         connectionStateWrapper, bluetoothSocketWrapper, cancellationToken, bufferSize)
 {
 }
コード例 #2
0
 public BluetoothTransmitter(
     ConcurrentValue <ConnectionState> connectionStateWrapper,
     ConcurrentValue <BluetoothSocket> bluetoothSocketWrapper,
     ConcurrentQueue <Memory <byte> > trnasmitQueue,
     CancellationToken cancellationToken = default,
     int bufferSize = TransmitterBufferSizeDefault) : base(
         connectionStateWrapper, bluetoothSocketWrapper, cancellationToken, bufferSize)
 {
     _trnasmitQueue = trnasmitQueue;
 }
        /// <summary>
        /// The <see cref="BluetoothManagedConnection"/> type constructor.
        /// </summary>
        /// <param name="remoteDeviceAddress">The parameter that represents an address of the remote device to connect to.</param>
        /// <param name="connectionType">The parameter that represents a bletooth connection type.</param>
        internal BluetoothManagedConnection(string remoteDeviceAddress,
                                            ConnectionType connectionType = ConnectionType.Transiver)
        {
            _remoteDeviceAddress = remoteDeviceAddress;
            _connectionType      = connectionType;

            _connectionStateWrapper = new ConcurrentValue <ConnectionState>(ConnectionState.Created);
            _socketWrapper          = new ConcurrentValue <BluetoothSocket>();
            _transmitQueue          = new ConcurrentQueue <Memory <byte> >();
        }
        public BluetoothDataTransferUnitBase(
            ConcurrentValue <ConnectionState> connectionStateWrapper,
            ConcurrentValue <BluetoothSocket> bluetoothSocketWrapper,
            CancellationToken cancellationToken = default,
            int bufferSize = BufferSizeDefault)
        {
            _connectionStateWrapper = connectionStateWrapper;
            _bluetoothSocketWrapper = bluetoothSocketWrapper;
            _bufferSize             = bufferSize;
            _cancellationToken      = cancellationToken;

            StartUnitThread();
        }