mirror of
https://github.com/inthehand/32feet.git
synced 2026-10-27 03:59:42 +08:00
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
// 32feet.NET - Personal Area Networking for .NET
|
|
//
|
|
// InTheHand.Net.Sockets.IBluetoothClient
|
|
//
|
|
// Copyright (c) 2023-24 In The Hand Ltd, All rights reserved.
|
|
// This source code is licensed under the MIT License
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.Sockets;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace InTheHand.Net.Sockets
|
|
{
|
|
internal interface IBluetoothClient : IDisposable
|
|
{
|
|
void Connect(BluetoothAddress address, Guid service);
|
|
void Connect(BluetoothEndPoint remoteEP);
|
|
Task ConnectAsync(BluetoothAddress address, Guid service);
|
|
|
|
void Close();
|
|
|
|
IEnumerable<BluetoothDeviceInfo> PairedDevices { get; }
|
|
|
|
IReadOnlyCollection<BluetoothDeviceInfo> DiscoverDevices(int maxDevices);
|
|
#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
|
|
IAsyncEnumerable<BluetoothDeviceInfo> DiscoverDevicesAsync([EnumeratorCancellation] CancellationToken cancellationToken = default);
|
|
#endif
|
|
bool Authenticate { get; set; }
|
|
|
|
Socket Client { get; }
|
|
|
|
bool Connected { get; }
|
|
|
|
bool Encrypt { get; set; }
|
|
|
|
TimeSpan InquiryLength { get; set; }
|
|
|
|
string RemoteMachineName { get; }
|
|
|
|
NetworkStream GetStream();
|
|
}
|
|
} |