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.
Dependencies: SensoryTest
Fork of btbee by
Revision 2:12c38a710982, committed 2013-05-16
- Comitter:
- ngoldin
- Date:
- Thu May 16 14:01:24 2013 +0000
- Parent:
- 1:56f437e4d9e0
- Child:
- 3:ddeb620fb25e
- Commit message:
- added default and at baud commands
Changed in this revision
| btbee.cpp | Show annotated file Show diff for this revision Revisions of this file |
| btbee.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/btbee.cpp Thu May 16 12:09:30 2013 +0000
+++ b/btbee.cpp Thu May 16 14:01:24 2013 +0000
@@ -3,13 +3,15 @@
btbee::btbee(PinName respin, PinName tx, PinName rx) :
Serial(tx, rx) , reset_out(respin)
{
- reset_out.write(1);
+ reset_out.write(1);
+ baud(DEFAULT_BAUD);
}
btbee::btbee( ) :
Serial(p28,p27), reset_out(p26)
{
reset_out.write(1);
+ baud(DEFAULT_BAUD);
}
void btbee::reset(void){
@@ -18,6 +20,17 @@
reset_out.write(1);
}
+void btbee::at_baud(void){
+baud(AT_BAUD);
+}
+
+void btbee::factory_baud(void){
+baud(FACTORY_BAUD);
+}
+
+void btbee::default_baud(void){
+baud(DEFAULT_BAUD);
+}
/* Read from the serial as long as it is readable.
* Params: pointer to char array for the return,
--- a/btbee.h Thu May 16 12:09:30 2013 +0000
+++ b/btbee.h Thu May 16 14:01:24 2013 +0000
@@ -1,11 +1,18 @@
#include "mbed.h"
#include "platform.h"
+#define FACTORY_BAUD 9600
+#define DEFAULT_BAUD 115200
+#define AT_BAUD 38400
+
class btbee: public Serial{
public:
btbee(PinName respin, PinName tx, PinName rx);
btbee(void);
void reset(void);
+ void at_baud(void);
+ void factory_baud(void);
+ void default_baud(void);
int read_all(char*,const int, int*);
protected:
