objc2_core_bluetooth/generated/
CBError.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10 pub static CBErrorDomain: &'static NSString;
12}
13
14#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct CBError(pub NSInteger);
21impl CBError {
22 #[doc(alias = "CBErrorUnknown")]
23 pub const Unknown: Self = Self(0);
24 #[doc(alias = "CBErrorInvalidParameters")]
25 pub const InvalidParameters: Self = Self(1);
26 #[doc(alias = "CBErrorInvalidHandle")]
27 pub const InvalidHandle: Self = Self(2);
28 #[doc(alias = "CBErrorNotConnected")]
29 pub const NotConnected: Self = Self(3);
30 #[doc(alias = "CBErrorOutOfSpace")]
31 pub const OutOfSpace: Self = Self(4);
32 #[doc(alias = "CBErrorOperationCancelled")]
33 pub const OperationCancelled: Self = Self(5);
34 #[doc(alias = "CBErrorConnectionTimeout")]
35 pub const ConnectionTimeout: Self = Self(6);
36 #[doc(alias = "CBErrorPeripheralDisconnected")]
37 pub const PeripheralDisconnected: Self = Self(7);
38 #[doc(alias = "CBErrorUUIDNotAllowed")]
39 pub const UUIDNotAllowed: Self = Self(8);
40 #[doc(alias = "CBErrorAlreadyAdvertising")]
41 pub const AlreadyAdvertising: Self = Self(9);
42 #[doc(alias = "CBErrorConnectionFailed")]
43 pub const ConnectionFailed: Self = Self(10);
44 #[doc(alias = "CBErrorConnectionLimitReached")]
45 pub const ConnectionLimitReached: Self = Self(11);
46 #[doc(alias = "CBErrorUnkownDevice")]
47 #[deprecated = "Use CBErrorUnknownDevice instead"]
48 pub const UnkownDevice: Self = Self(12);
49 #[doc(alias = "CBErrorUnknownDevice")]
50 pub const UnknownDevice: Self = Self(12);
51 #[doc(alias = "CBErrorOperationNotSupported")]
52 pub const OperationNotSupported: Self = Self(13);
53 #[doc(alias = "CBErrorPeerRemovedPairingInformation")]
54 pub const PeerRemovedPairingInformation: Self = Self(14);
55 #[doc(alias = "CBErrorEncryptionTimedOut")]
56 pub const EncryptionTimedOut: Self = Self(15);
57 #[doc(alias = "CBErrorTooManyLEPairedDevices")]
58 pub const TooManyLEPairedDevices: Self = Self(16);
59 #[doc(alias = "CBErrorLeGattExceededBackgroundNotificationLimit")]
60 pub const LeGattExceededBackgroundNotificationLimit: Self = Self(17);
61 #[doc(alias = "CBErrorLeGattNearBackgroundNotificationLimit")]
62 pub const LeGattNearBackgroundNotificationLimit: Self = Self(18);
63}
64
65unsafe impl Encode for CBError {
66 const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for CBError {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73extern "C" {
74 pub static CBATTErrorDomain: &'static NSString;
76}
77
78#[repr(transparent)]
81#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
82pub struct CBATTError(pub NSInteger);
83impl CBATTError {
84 #[doc(alias = "CBATTErrorSuccess")]
85 pub const Success: Self = Self(0x00);
86 #[doc(alias = "CBATTErrorInvalidHandle")]
87 pub const InvalidHandle: Self = Self(0x01);
88 #[doc(alias = "CBATTErrorReadNotPermitted")]
89 pub const ReadNotPermitted: Self = Self(0x02);
90 #[doc(alias = "CBATTErrorWriteNotPermitted")]
91 pub const WriteNotPermitted: Self = Self(0x03);
92 #[doc(alias = "CBATTErrorInvalidPdu")]
93 pub const InvalidPdu: Self = Self(0x04);
94 #[doc(alias = "CBATTErrorInsufficientAuthentication")]
95 pub const InsufficientAuthentication: Self = Self(0x05);
96 #[doc(alias = "CBATTErrorRequestNotSupported")]
97 pub const RequestNotSupported: Self = Self(0x06);
98 #[doc(alias = "CBATTErrorInvalidOffset")]
99 pub const InvalidOffset: Self = Self(0x07);
100 #[doc(alias = "CBATTErrorInsufficientAuthorization")]
101 pub const InsufficientAuthorization: Self = Self(0x08);
102 #[doc(alias = "CBATTErrorPrepareQueueFull")]
103 pub const PrepareQueueFull: Self = Self(0x09);
104 #[doc(alias = "CBATTErrorAttributeNotFound")]
105 pub const AttributeNotFound: Self = Self(0x0A);
106 #[doc(alias = "CBATTErrorAttributeNotLong")]
107 pub const AttributeNotLong: Self = Self(0x0B);
108 #[doc(alias = "CBATTErrorInsufficientEncryptionKeySize")]
109 pub const InsufficientEncryptionKeySize: Self = Self(0x0C);
110 #[doc(alias = "CBATTErrorInvalidAttributeValueLength")]
111 pub const InvalidAttributeValueLength: Self = Self(0x0D);
112 #[doc(alias = "CBATTErrorUnlikelyError")]
113 pub const UnlikelyError: Self = Self(0x0E);
114 #[doc(alias = "CBATTErrorInsufficientEncryption")]
115 pub const InsufficientEncryption: Self = Self(0x0F);
116 #[doc(alias = "CBATTErrorUnsupportedGroupType")]
117 pub const UnsupportedGroupType: Self = Self(0x10);
118 #[doc(alias = "CBATTErrorInsufficientResources")]
119 pub const InsufficientResources: Self = Self(0x11);
120}
121
122unsafe impl Encode for CBATTError {
123 const ENCODING: Encoding = NSInteger::ENCODING;
124}
125
126unsafe impl RefEncode for CBATTError {
127 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
128}