PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Network
WiFi
Leave a Network.c
1
/*
2
Application circuit:
3
DO -> P11, DI <- P10, SEL - GND. Use USB cable and the
4
USB COM port for loading code and debugging.
5
6
Note: This example relies on the 0.8 version of the wifi library.
7
Updates may change some function behaviors in later releases.
8
*/
9
10
#include "
simpletools.h
"
11
#include "
wifi.h
"
12
13
int
main
()
14
{
15
wifi_start
(9, 8, 115200,
USB_PGM_TERM
);
16
17
print
(
"Leave a Network\r"
);
18
19
// Leaves network where it was a station and sets
20
// the Wi-Fi module's mode. This example puts the
21
// Wi-Fi module in AP (access point) mode after
22
// leaving the network. Another option is STA_AP,
23
// which would make the Wi-Fi module ready to join
24
// another network.
25
26
wifi_leave
(
AP
);
27
28
// Verify mode after leaving the network.
29
30
int
mode =
wifi_mode
(
CHECK
);
31
switch
(mode)
32
{
33
case
STA
:
//0xf4:
34
print
(
"mode=STA\r"
);
35
break
;
36
case
AP
:
//0xf3
37
print
(
"mode=AP\r"
);
38
break
;
39
case
STA_AP
:
//0xf2
40
print
(
"mode=STA+AP"
);
41
break
;
42
}
43
}
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
wifi_mode
int wifi_mode(int mode)
Set or check the Wi-Fi module's network mode.
Definition:
mode.c:48
CHECK
#define CHECK
Command token used to check a Wi-Fi module setting or I/O pin state.
Definition:
wifi.h:168
STA_AP
#define STA_AP
Token used for both setting up and indicating station plus access point mode. This mode should only b...
Definition:
wifi.h:327
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
AP
#define AP
Token that can be used for both setting up and checking the Wi-Fi module's access point mode....
Definition:
wifi.h:259
main
int main(void)
Definition:
GraphicsTest.c:20
wifi_leave
int wifi_leave(int newMode)
Leave an AP network and transition into a mode that's not pure STA. The wi-fi module will forget the ...
Definition:
leave.c:48
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17