Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: IoT_Ex BatteryModelTester BatteryModelTester
Fork of WiflyInterface by
Diff: Wifly/Wifly.cpp
- Revision:
- 15:eaa1ec0e26bf
- Parent:
- 13:8846f12fa277
- Child:
- 16:de16e8b077c1
--- a/Wifly/Wifly.cpp Sat Feb 20 16:39:09 2016 +0000 +++ b/Wifly/Wifly.cpp Sat Feb 20 17:20:28 2016 +0000 @@ -65,6 +65,22 @@ state.cmd_mode = false; } +void Wifly::setBaud(int baudrate) +{ + char cmd[20]; + // None of these work, although I am not sure where the issue is + // This sets the baud rate 'instantly' + sprintf(cmd, "set u i %d\r", baudrate); + // This one sets it some other way that does not work + //sprintf(cmd, "set u b %d\r", baudrate); + // Set baud rate of wifly: + sendCommand(cmd, "AOK"); + + // Set baud rate of UART: + wifi.baud(baudrate); + exit(); +} + bool Wifly::join() { char cmd[20];