Editar

Share via


CBPeripheral.IsConnected Property

Definition

Developers should not use this obsolete property. Instead, they should test the State property.

[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 7, ObjCRuntime.PlatformArchitecture.Arch64, null)]
[ObjCRuntime.Obsoleted(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool IsConnected { [Foundation.Export("isConnected")] [ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 7, ObjCRuntime.PlatformArchitecture.Arch64, null)] [ObjCRuntime.Obsoleted(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.IsConnected : bool

Property Value

Attributes

Remarks

This property was deprecated in iOS 7 and removed in iOS 9. Connection status should be determined using the State property:

if (myPeripheral.State != CBPeripheralState.Connected)
{
   Console.WriteLine("Peripheral is not connected");
}

Applies to