A class for managing wireless connections. More...
#import <Network/Network.h>
Instance Methods | |
(id< WirelessDelegate >) | - delegate |
Gets the current wireless delegate. More... | |
(void) | - setDelegate: |
Sets the wireless delegate. More... | |
(BOOL) | - scan |
Initiates a scan for available Wi-Fi networks. More... | |
(BOOL) | - connect: |
Begin an asynchronous connection to a Wi‑Fi network. More... | |
(BOOL) | - connect:withPassword: |
Begin an asynchronous connection with an explicit password. More... | |
(BOOL) | - disconnect |
Disconnect from the current Wi‑Fi network. More... | |
![]() | |
(id) | - retain |
Increases the retain count of the receiver. More... | |
(void) | - release |
Decreases the retain count of the receiver. More... | |
(id) | - autorelease |
Adds the receiver to the autorelease pool. | |
![]() | |
(void) | - dealloc |
Free resources for an existing instance. | |
(id) | - init |
Initialize the instance, after allocation. More... | |
(Class) | - class |
Returns the class of the instance. More... | |
(Class) | - superclass |
Returns the superclass of the instance. More... | |
(BOOL) | - isEqual: |
Compares the receiver to another object for equality. More... | |
(BOOL) | - isKindOfClass: |
Returns a Boolean value that indicates whether the receiver is an instance of a given class. More... | |
(BOOL) | - conformsTo: |
Checks if the receiver's class conforms to a protocol. More... | |
(NXString *) | - description |
Returns a string that represents the instance. More... | |
![]() | |
(BOOL) | - respondsToSelector: |
Checks if the receiver responds to a selector. More... | |
Class Methods | |
(id) | + sharedInstance |
A shared instance of the wireless manager. More... | |
![]() | |
(id) | + allocWithZone: |
Allocates a new instance of an object in a specific memory zone. More... | |
![]() | |
(void) | + initialize |
Performs one-time initialization for the class. More... | |
(id) | + alloc |
Allocate a new class instance. More... | |
(Class) | + class |
Returns the class object. More... | |
(Class) | + superclass |
Returns the superclass of the class. More... | |
(const char *) | + name |
Returns the name of the class. More... | |
(BOOL) | + conformsTo: |
Checks if the class conforms to a protocol. More... | |
(NXString *) | + description |
Returns a string that represents the class. More... | |
Additional Inherited Members | |
![]() | |
id | _zone |
The memory zone where the object is allocated. | |
unsigned short | _retain |
The retain count of the object. | |
id | _next |
The next object in an autorelease pool. | |
![]() | |
Class | isa |
A pointer to the object's class structure. More... | |
A class for managing wireless connections.
This class provides an interface for managing Wi-Fi connections. There are currently three main operations, which are all handled asynchronously:
The NXWireless class is designed to be a singleton, ensuring that there is only one instance managing the wireless connection at any given time.
Definition at line 28 of file NXWireless.h.
- (BOOL) connect: | (NXWirelessNetwork *) | network |
Begin an asynchronous connection to a Wi‑Fi network.
network | The target network descriptor (SSID/BSSID/etc.). |
This variant is intended for open networks or cases where credentials are already known to the platform. The call returns immediately; completion or failure will occur asynchronously.
- (BOOL) connect: | (NXWirelessNetwork *) | network | |
withPassword: | (id< NXConstantStringProtocol >) | password | |
Begin an asynchronous connection with an explicit password.
network | The target network descriptor (SSID/BSSID/etc.). |
password | NULL‑terminated password string (may be empty for open networks). |
The call returns immediately; the outcome will be determined asynchronously.
- (id<WirelessDelegate>) delegate |
Gets the current wireless delegate.
This method returns the object that serves as the wireless delegate.
- (BOOL) disconnect |
Disconnect from the current Wi‑Fi network.
The operation is asynchronous; the interface will transition to a disconnected state shortly after the request.
- (BOOL) scan |
Initiates a scan for available Wi-Fi networks.
This method initiates a scan for available Wi-Fi networks. It returns YES if the scan was started successfully, or NO if there was an error (for example, another operation is already in progress).
The scanning process is asynchronous, and the results will be delivered via the delegate.
- (void) setDelegate: | (id< WirelessDelegate >) | delegate |
Sets the wireless delegate.
delegate | The object to set as the wireless delegate, or nil to remove the current delegate. |
The delegate object will receive wireless-related callbacks when the wireless manager detects networks or changes state. The delegate should conform to the WirelessDelegate protocol.
+ (id) sharedInstance |
A shared instance of the wireless manager.
This variable holds the current wireless manager instance that is being used. It is automatically set when a wireless manager is created.