local fix version of myBlueUSB (http://mbed.org/users/networker/code/myBlueUSB/). - merge deleted files which are required to compile. - enable echo back of received data via RFCOMM.
Dependencies: AvailableMemory FatFileSystem mbed myUSBHost
btserial.h
- Committer:
- nobukuma
- Date:
- 2013-12-08
- Revision:
- 2:9f25a7fa1a54
- Parent:
- 0:003889bc474f
File content as of revision 2:9f25a7fa1a54:
#ifndef BTSERIAL_H #define BTSERIAL_H #include "mbed.h" #include "RFCOMM.h" class btserial { static const int bufsize = 350; int recbufsize, sndbufsize; int sock; unsigned char sendbuf[bufsize], recbuf[bufsize]; int sendptr, recptrin, recptrout, free; static void cb(int socket, SocketState state, const unsigned char *data, int len, void* userData); void stash(const unsigned char *data, int len); bool open; public: btserial(char ba[6], char ch);//outgoing btserial(char ch);//incoming void baud(int); void format(int, Serial::Parity, int); int putc(int); int getc(); int readable() { if (!open) return -1; return bufsize-free; } int writeable() { if (!open) return -1; return bufsize - sendptr; } }; #endif