.
Dependencies: WiflyInterface mbed
Fork of Wifly_HelloWorld by
main.cpp@4:fd030db1a6f4, 2012-08-17 (annotated)
- Committer:
- samux
- Date:
- Fri Aug 17 11:31:32 2012 +0000
- Revision:
- 4:fd030db1a6f4
- Parent:
- 3:3b84102f022e
- Child:
- 5:867d16e948eb
change default passw
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 0:90ba0f51aa64 | 1 | #include "mbed.h" |
samux | 3:3b84102f022e | 2 | #include "WiflyInterface.h" |
samux | 1:49e1e9ed6e39 | 3 | |
samux | 1:49e1e9ed6e39 | 4 | Serial pc(USBTX, USBRX); |
samux | 1:49e1e9ed6e39 | 5 | |
samux | 1:49e1e9ed6e39 | 6 | /* wifly object where: |
samux | 1:49e1e9ed6e39 | 7 | * - p9 and p10 are for the serial communication |
samux | 3:3b84102f022e | 8 | * - p25 is for the reset pin |
samux | 3:3b84102f022e | 9 | * - p26 is for the connection status |
samux | 1:49e1e9ed6e39 | 10 | * - "mbed" is the ssid of the network |
samux | 1:49e1e9ed6e39 | 11 | * - "password" is the password |
samux | 1:49e1e9ed6e39 | 12 | * - true means that the security of the network is WPA |
samux | 1:49e1e9ed6e39 | 13 | */ |
samux | 4:fd030db1a6f4 | 14 | WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", true); |
samux | 0:90ba0f51aa64 | 15 | |
samux | 1:49e1e9ed6e39 | 16 | int main() { |
samux | 3:3b84102f022e | 17 | wifly.init(); // use DHCP |
samux | 3:3b84102f022e | 18 | while (!wifly.connect()); // join the network |
samux | 3:3b84102f022e | 19 | printf("IP Address is %s\n\r", wifly.getIPAddress()); |
samux | 1:49e1e9ed6e39 | 20 | } |