PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Network
WiFi
Check Station IP Address.c
1
/*
2
Check Station IP Address.c
3
4
Check the current station IP address.
5
6
Application circuit:
7
DO -> P9, DI <- P8, SEL - GND. Use USB cable and the
8
USB COM port for loading code and debugging.
9
10
Note: This example relies on the 0.8 version of the wifi library.
11
Updates may change some function behaviors in later releases.
12
*/
13
14
#include "
simpletools.h
"
15
#include "
wifi.h
"
16
17
int
main
()
18
{
19
wifi_start
(9, 8, 115200,
USB_PGM_TERM
);
20
21
print
(
"Check Station IP Address\r"
);
22
23
int
ip[] = {0, 0, 0, 0};
24
memset(ip, 0, 16);
25
do
26
{
27
wifi_ip
(
STA
, ip);
28
}
29
while
(ip[0] == 0 && ip[1] == 0 && ip[2] == 0 && ip[3] == 0);
30
31
print
(
"\rip=%d.%d.%d.%d\r"
, ip[0], ip[1], ip[2], ip[3]);
32
}
wifi.h
API for the Parallax WX Wi-Fi Module ESP8266-WROOM-02 (Part #32420). This library has a preliminary A...
wifi_start
fdserial * wifi_start(int fromDO, int toDI, int baud, int comSelect)
Set up Wi-Fi module serial connections for data command and transparent data communication.
Definition:
wifi.c:47
STA
#define STA
Token used for both setting up and indicating station mode. In this mode, the Wi-Fi module is a stati...
Definition:
wifi.h:314
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
USB_PGM_TERM
#define USB_PGM_TERM
Definition:
wifi.h:114
main
int main(void)
Definition:
GraphicsTest.c:20
wifi_ip
int wifi_ip(int mode, int *ipAddr)
Check the IP address for the Parallax Wi-Fi module.
Definition:
ipaddr.c:48
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17