2018-11-30 04:49 PM
I am trying to use mbed to send AT Commands to the SPBT3.0DP2 module in order to change it's baud rate. I am using the ATCmdParser to send the AT commands. It seems like I am not able to enter the command mode? I'm not sure. please help.
I do at.send("^#^$^%") to try to enter command mode before changing the baud rate.
#include mbed.h
Serial pc(PA_2, PA_15);
Serial bt(PA_9, PA_10);
ATCmdParser at(&bt, "\r\n");
int main()
{
pc.baud(921600);
bt.baud(115200);
pc.printf("hello starting off\n");
bt.printf("hello starting off\n");
at.send("^#^$^%");
at.send("AT+AB ChangeBaud [921600]");
at.send("AT+AB Bypass");
bt.baud(921600);
while(1) {
wait(2);
pc.printf("921600 baud rate\n");
bt.printf("921600 baud rate\n");
}
}