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: C12832 GPS GSM mbed
Fork of myBlueUSB_localfix by
btserial.h
00001 #ifndef BTSERIAL_H 00002 #define BTSERIAL_H 00003 #include "mbed.h" 00004 #include "RFCOMM.h" 00005 00006 class btserial { 00007 static const int bufsize = 4; 00008 int recbufsize, sndbufsize; 00009 int sock; 00010 unsigned char sendbuf[bufsize], recbuf[bufsize]; 00011 int sendptr, recptrin, recptrout, free; 00012 static void cb(int socket, SocketState state, const unsigned char *data, int len, void* userData); 00013 void stash(const unsigned char *data, int len); 00014 bool open; 00015 public: 00016 btserial(char ba[6], char ch);//outgoing 00017 btserial(char ch);//incoming 00018 void baud(int); 00019 void format(int, Serial::Parity, int); 00020 int putc(int); 00021 int getc(); 00022 int readable() { 00023 if (!open) return -1; 00024 return bufsize-free; 00025 } 00026 int writeable() { 00027 if (!open) return -1; 00028 return bufsize - sendptr; 00029 } 00030 }; 00031 00032 #endif
Generated on Wed Jul 13 2022 02:37:52 by
1.7.2
