objc2_core_wlan/generated/CWNetwork.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// Represents a device participating in a Wi-Fi network, providing accessors to various network attributes.
11 ///
12 /// See also [Apple's documentation](https://developer.apple.com/documentation/corewlan/cwnetwork?language=objc)
13 #[unsafe(super(NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 pub struct CWNetwork;
16);
17
18extern_conformance!(
19 unsafe impl NSCoding for CWNetwork {}
20);
21
22extern_conformance!(
23 unsafe impl NSCopying for CWNetwork {}
24);
25
26unsafe impl CopyingHelper for CWNetwork {
27 type Result = Self;
28}
29
30extern_conformance!(
31 unsafe impl NSObjectProtocol for CWNetwork {}
32);
33
34extern_conformance!(
35 unsafe impl NSSecureCoding for CWNetwork {}
36);
37
38impl CWNetwork {
39 extern_methods!(
40 /// Returns the service set identifier (SSID) for the Wi-Fi network device, encoded as a string.
41 ///
42 ///
43 /// Returns nil if the SSID can not be encoded as a valid UTF-8 or WinLatin1 string.
44 ///
45 ///
46 /// Note: SSID information is not available unless Location Services is enabled and the user has authorized the calling app to use location services.
47 ///
48 ///
49 /// See also: CLLocationManager
50 #[unsafe(method(ssid))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn ssid(&self) -> Option<Retained<NSString>>;
53
54 /// Returns the service set identifier (SSID) for the Wi-Fi network device, encapsulated in an NSData object.
55 ///
56 ///
57 /// The SSID is defined as 1-32 octets.
58 ///
59 ///
60 /// Note: SSID information is not available unless Location Services is enabled and the user has authorized the calling app to use location services.
61 ///
62 ///
63 /// See also: CLLocationManager
64 #[unsafe(method(ssidData))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn ssidData(&self) -> Option<Retained<NSData>>;
67
68 /// Returns the basic service set identifier (BSSID) for the Wi-Fi network device, returned as UTF-8 string.
69 ///
70 ///
71 /// Returns a UTF-8 string using hexadecimal characters formatted as XX:XX:XX:XX:XX:XX.
72 ///
73 ///
74 /// Note: BSSID information is not available unless Location Services is enabled and the user has authorized the calling app to use location services.
75 ///
76 ///
77 /// See also: CLLocationManager
78 #[unsafe(method(bssid))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn bssid(&self) -> Option<Retained<NSString>>;
81
82 #[cfg(feature = "CWChannel")]
83 /// The operating channel of the Wi-Fi device.
84 #[unsafe(method(wlanChannel))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn wlanChannel(&self) -> Option<Retained<CWChannel>>;
87
88 /// Returns the received signal strength indication (RSSI) measurement (dBm) for the Wi-Fi device.
89 #[unsafe(method(rssiValue))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn rssiValue(&self) -> NSInteger;
92
93 /// Returns the noise measurement (dBm) for the Wi-Fi device.
94 #[unsafe(method(noiseMeasurement))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn noiseMeasurement(&self) -> NSInteger;
97
98 /// Returns information element data included in beacon or probe response frames.
99 #[unsafe(method(informationElementData))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn informationElementData(&self) -> Option<Retained<NSData>>;
102
103 /// Returns the advertised country code (ISO/IEC 3166-1:1997) for the Wi-Fi device.
104 ///
105 ///
106 /// Note: Country code information is not available unless Location Services is enabled and the user has authorized the calling app to use location services.
107 ///
108 ///
109 /// See also: CLLocationManager
110 #[unsafe(method(countryCode))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn countryCode(&self) -> Option<Retained<NSString>>;
113
114 /// Returns the beacon interval (ms) for the Wi-Fi device.
115 #[unsafe(method(beaconInterval))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn beaconInterval(&self) -> NSInteger;
118
119 /// Returns: YES if the Wi-Fi device is part of an IBSS network, NO otherwise.
120 ///
121 ///
122 /// Indicates whether or not the Wi-Fi device is participating in an independent basic service set (IBSS), or ad-hoc Wi-Fi network.
123 #[unsafe(method(ibss))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn ibss(&self) -> bool;
126
127 /// Parameter `network`: A CWNetwork object.
128 ///
129 ///
130 /// Returns: YES if the objects are equal, NO otherwise.
131 ///
132 ///
133 /// Determine CWNetwork equality.
134 ///
135 ///
136 /// CWNetwork objects are considered equal if their corresponding
137 /// <i>
138 /// ssidData
139 /// </i>
140 /// and
141 /// <i>
142 /// bssid
143 /// </i>
144 /// properties are equal.
145 #[unsafe(method(isEqualToNetwork:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn isEqualToNetwork(&self, network: &CWNetwork) -> bool;
148
149 #[cfg(feature = "CoreWLANTypes")]
150 /// Parameter `security`: A CWSecurity type value.
151 ///
152 ///
153 /// Returns: <i>
154 /// YES
155 /// </i>
156 /// if the Wi-Fi device supports the specified security type,
157 /// <i>
158 /// NO
159 /// </i>
160 /// otherwise.
161 ///
162 ///
163 /// Determine which security types a Wi-Fi device supports.
164 #[unsafe(method(supportsSecurity:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn supportsSecurity(&self, security: CWSecurity) -> bool;
167
168 #[cfg(feature = "CoreWLANTypes")]
169 /// Parameter `phyMode`: A CWPHYMode type value.
170 ///
171 ///
172 /// Returns: YES if the Wi-Fi device supports the specified PHY mode, NO otherwise.
173 ///
174 ///
175 /// Determine which PHY modes a Wi-Fi device supports.
176 #[unsafe(method(supportsPHYMode:))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn supportsPHYMode(&self, phy_mode: CWPHYMode) -> bool;
179 );
180}
181
182/// Methods declared on superclass `NSObject`.
183impl CWNetwork {
184 extern_methods!(
185 #[unsafe(method(init))]
186 #[unsafe(method_family = init)]
187 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189 #[unsafe(method(new))]
190 #[unsafe(method_family = new)]
191 pub unsafe fn new() -> Retained<Self>;
192 );
193}