
N-BW2 Networker Bridge (WIFI)
API-N-BW2
Issue 1.3 Page 8 of 48
2.4 Opening a TCP Connection with the N-BW2
Before opening a TCP connection with the N-BW2 either the N-BW2 must:
-
Be associated with if it is operating in one of its Access Point states, or
-
Associate with the router it was configured to associate with when operating in its Station state.
Once this is the case the N-BW2 broadcasts a 256 byte long UDP packet every second using the following
broadcast settings:
-
Broadcast address : ###.###.###.255
-
Broadcast port : 50000
Embedded within this UDP broadcast packet is information listed in the example shown in FIG 2.4a.
FIG 2.4a: N-BW2 UDP Broadcast Packet
From this UDP packet the IP address of the N-BW2 (source address) can be determined and together with the
information listed above all the information needed to open a TCP connection with the N-BW2 is available. Once
a valid TCP connection with the N-BW2 is opened the N-BW2 responds with “
*HELLO*
”. Provided the client
issues commands to the N-BW2 the TCP connection will remain open. If no response from the client that initiates
the connection is received within the TCP timeout time (
T
TCPOUT
), the N-BW2 will terminate the connection and
perform a reboot.
Index
Description
0000h – 001Fh
N-BW2 identification tag.
0020h – 0021h
TCP port, high byte first.
In this case 6Ch C7h equates to port 27847.
0022h
Default AP operating state indication.
AAh
Operating in Default AP state.
55h
Not operating in Default AP state.
0023h
Overal firmware version of module.
0024h
Wi-Fi Module firmware version.
0025h
WLAN access mode.
0
AP Mode – Default.
1
AP Mode – User Configured.
2
Station Mode – Uer Configured.
00FFh
Number of scanned SSIDs (Default AP mode only).
FOR SCANNED SSIDs n = 0 to 9
0100h + n x 23h
SSID name.
0100h + n x 20h
SSID name length.
0100h + n x 21h
Security type
OPEN – 0
WEP – 1
WPA – 2
WPA2 – 3
0100h + n x 22h
Received Signal Strength Indication (RSSI)
N-BW2 IP Address