objc

Instance Methods | Class Methods
NXWireless Class Reference

A class for managing wireless connections. More...

#import <Network/Network.h>

Inheritance diagram for NXWireless:
Inheritance graph
[legend]
Collaboration diagram for NXWireless:
Collaboration graph
[legend]

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...
 
- Instance Methods inherited from NXObject
(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.
 
- Instance Methods inherited from Object
(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...
 
- Instance Methods inherited from <ObjectProtocol>
(BOOL- respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Class Methods

(id+ sharedInstance
 A shared instance of the wireless manager. More...
 
- Class Methods inherited from NXObject
(id+ allocWithZone:
 Allocates a new instance of an object in a specific memory zone. More...
 
- Class Methods inherited from Object
(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

- Protected Attributes inherited from NXObject
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.
 
- Protected Attributes inherited from Object
Class isa
 A pointer to the object's class structure. More...
 

Detailed Description

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.

Examples:
examples/Network/ntp/main.m, and examples/Network/scan/main.m.

Definition at line 28 of file NXWireless.h.

Method Documentation

◆ connect:()

- (BOOL) connect: (NXWirelessNetwork *)  network

Begin an asynchronous connection to a Wi‑Fi network.

Parameters
networkThe target network descriptor (SSID/BSSID/etc.).
Returns
YES if the connection attempt was started; NO if another operation is in progress or parameters are invalid.

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.

◆ connect:withPassword:()

- (BOOL) connect: (NXWirelessNetwork *)  network
withPassword: (id< NXConstantStringProtocol >)  password 

Begin an asynchronous connection with an explicit password.

Parameters
networkThe target network descriptor (SSID/BSSID/etc.).
passwordNULL‑terminated password string (may be empty for open networks).
Returns
YES if the connection attempt was started; NO otherwise.

The call returns immediately; the outcome will be determined asynchronously.

◆ delegate()

- (id<WirelessDelegate>) delegate

Gets the current wireless delegate.

Returns
The current wireless delegate, or nil if no delegate is set.

This method returns the object that serves as the wireless delegate.

See also
- setDelegate: for setting the wireless - delegate.

◆ disconnect()

- (BOOL) disconnect

Disconnect from the current Wi‑Fi network.

Returns
YES if a disconnect was initiated; NO if not connected or another operation prevents it.

The operation is asynchronous; the interface will transition to a disconnected state shortly after the request.

◆ scan()

- (BOOL) scan

Initiates a scan for available Wi-Fi networks.

Returns
YES if the scan was started successfully, NO otherwise.

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.

◆ setDelegate:()

- (void) setDelegate: (id< WirelessDelegate >)  delegate

Sets the wireless delegate.

Parameters
delegateThe 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.

◆ sharedInstance()

+ (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.


The documentation for this class was generated from the following file: