#include <SPP.h>
|
| SPP (BTD *p, const char *name="Arduino", const char *pin="1234") |
|
| operator bool () |
|
|
virtual void | ACLData (uint8_t *ACLData) |
|
virtual void | Run () |
|
virtual void | Reset () |
|
virtual void | disconnect () |
|
|
virtual int | available (void) |
|
virtual void | flush (void) |
|
virtual int | peek (void) |
|
virtual int | read (void) |
|
virtual size_t | write (uint8_t data) |
|
virtual size_t | write (const uint8_t *data, size_t size) |
|
void | send (void) |
|
This BluetoothService class implements the Serial Port Protocol (SPP).
Definition at line 93 of file SPP.h.
SPP::SPP |
( |
BTD * |
p, |
|
|
const char * |
name = "Arduino" , |
|
|
const char * |
pin = "1234" |
|
) |
| |
Constructor for the SPP class.
- Parameters
-
p | Pointer to BTD class instance. |
name | Set the name to BTD::btdName. If argument is omitted, then "Arduino" will be used. |
pin | Write the pin to BTD::btdPin. If argument is omitted, then "1234" will be used. |
Definition at line 45 of file SPP.cpp.
Used to provide Boolean tests for the class.
- Returns
- Return true if SPP communication is connected.
Definition at line 107 of file SPP.h.
void SPP::ACLData |
( |
uint8_t * |
ACLData | ) |
|
|
virtual |
int SPP::available |
( |
void |
| ) |
|
|
virtual |
Get number of bytes waiting to be read.
- Returns
- Return the number of bytes ready to be read.
Definition at line 780 of file SPP.cpp.
Discard all the bytes in the buffer.
Definition at line 784 of file SPP.cpp.
Used to read the next value in the buffer without advancing to the next one.
- Returns
- Return the byte. Will return -1 if no bytes are available.
Definition at line 788 of file SPP.cpp.
Used to read the buffer.
- Returns
- Return the byte. Will return -1 if no bytes are available.
Definition at line 794 of file SPP.cpp.
size_t SPP::write |
( |
uint8_t |
data | ) |
|
|
virtual |
Writes the byte to send to a buffer. The message is send when either send() or after Usb.Task() is called.
- Parameters
-
- Returns
- Return the number of bytes written.
Definition at line 739 of file SPP.cpp.
size_t SPP::write |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Writes the bytes to send to a buffer. The message is send when either send() or after Usb.Task() is called.
- Parameters
-
data | The data array to send. |
size | Size of the data. |
- Returns
- Return the number of bytes written.
Definition at line 743 of file SPP.cpp.
This will send all the bytes in the buffer. This is called whenever Usb.Task() is called, but can also be called via this function.
Definition at line 752 of file SPP.cpp.
Variable used to indicate if the connection is established.
Definition at line 111 of file SPP.h.
The documentation for this class was generated from the following files: