# POSWIFIManager Class Reference

Inherits from | NSObject
Declared in | POSWIFIManager.h POSWIFIManager.m

### `+ shareWifiManager`

Create WiFi management object

`+ (instancetype)shareWifiManager`

#### Discussion

Create WiFi management object

#### Declared In

`POSWIFIManager.m`

### `– POSDisConnect`

Disconnect manually

`- (void)POSDisConnect`

#### Discussion

Disconnect manually

#### Declared In

`POSWIFIManager.m`

### `– POSWriteCommandWithData:`

send data

`- (void)POSWriteCommandWithData:(NSData *)data`

#### Parameters

`data` | data

#### Discussion

send data

#### Declared In

`POSWIFIManager.m`

### `– POSWriteCommandWithData:withResponse:`

Send data and call back

`- (void)POSWriteCommandWithData:(NSData *)data withResponse:(POSWIFICallBackBlock)block`

#### Parameters

`data` | data
`block` | callback

#### Discussion

Send data and call back

#### Declared In

`POSWIFIManager.m`

### `– POSSendMSGWith:`

send messages

`- (void)POSSendMSGWith:(NSString *)str`

#### Parameters

`str` | data

#### Discussion

send messages

#### Declared In

`POSWIFIManager.m`

### `– POSConnectWithHost:port:completion:`

Connect the printer

`- (void)POSConnectWithHost:(NSString *)hostStr port:(UInt16)port completion:(POSWIFIBlock)block`

#### Parameters

`hostStr` | Printer ip address
`port` | port of printer
`block` | callback

#### Discussion

Connect the printer

#### Declared In

`POSWIFIManager.m`

### `– onSocket:didConnectToHost:port:`

Connection established

`- (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port`

#### Parameters

`sock` | sock object
`host` | Host address
`port` | The port number

#### Discussion

Connection established

#### Declared In

`POSWIFIManager.m`

### `– onSocket:didWriteDataWithTag:`

写数据

`- (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag`

#### Discussion

写数据

#### Declared In

`POSWIFIManager.m`

### `– POSGetBuffer`

**

`- (NSArray *)POSGetBuffer`

#### Discussion

**

#### Declared In

`POSWIFIManager.m`

### `– POSSetCommandMode:`

**

`- (void)POSSetCommandMode:(BOOL)Mode`

#### Discussion

**

#### Declared In

`POSWIFIManager.h`