#include <SPP.h>
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.
void SPP::ACLData |
( |
uint8_t * |
ACLData | ) |
|
|
virtual |
uint8_t SPP::available |
( |
| ) |
|
|
inline |
Get number of bytes waiting to be read.
- Returns
- Return the number of bytes ready to be read.
Definition at line 212 of file SPP.h.
void SPP::doubleToString |
( |
double |
input, |
|
|
char * |
output, |
|
|
uint8_t |
digits = 2 |
|
) |
| |
Helper function to convert from double to string.
- Parameters
-
input | Floating-point number to convert. |
output | Output buffer. |
digits | Number of digits to convert. If argument is omitted, then 2 digits will be used. |
Definition at line 876 of file SPP.cpp.
Discard all the bytes in the buffer.
Definition at line 219 of file SPP.h.
void SPP::print |
( |
const String & |
str | ) |
|
Used to send Strings. Used to send Arduino String data type.
- Parameters
-
Definition at line 687 of file SPP.cpp.
void SPP::print |
( |
const char * |
str | ) |
|
Used to send standard strings.
- Parameters
-
Definition at line 703 of file SPP.cpp.
void SPP::print |
( |
uint8_t |
data | ) |
|
Used to send single bytes.
- Parameters
-
Definition at line 719 of file SPP.cpp.
void SPP::print |
( |
uint8_t * |
array, |
|
|
uint8_t |
length |
|
) |
| |
Used to send arrays.
- Parameters
-
array | Array to send. |
length | Number of bytes to send. |
Definition at line 722 of file SPP.cpp.
void SPP::print |
( |
const __FlashStringHelper * |
ifsh | ) |
|
Used to print strings stored in flash.
- Parameters
-
Definition at line 737 of file SPP.cpp.
void SPP::println |
( |
const String & |
str | ) |
|
void SPP::println |
( |
const char * |
str | ) |
|
void SPP::println |
( |
uint8_t |
data | ) |
|
void SPP::println |
( |
uint8_t * |
array, |
|
|
uint8_t |
length |
|
) |
| |
void SPP::println |
( |
const __FlashStringHelper * |
ifsh | ) |
|
void SPP::println |
( |
void |
| ) |
|
Use this to print newline and carriage return.
Definition at line 792 of file SPP.cpp.
void SPP::printNumber |
( |
int32_t |
n | ) |
|
Used to print integers.
- Parameters
-
Definition at line 798 of file SPP.cpp.
void SPP::printNumber |
( |
double |
n, |
|
|
uint8_t |
digits = 2 |
|
) |
| |
Used to print floating-point numbers.
- Parameters
-
n | Floating-point number to print. |
digits | Number of digits to send. If argument is omitted, then 2 digits will be used. |
Definition at line 863 of file SPP.cpp.
void SPP::printNumberln |
( |
int32_t |
n | ) |
|
void SPP::printNumberln |
( |
double |
n, |
|
|
uint8_t |
digits = 2 |
|
) |
| |
Same as printNumber(double n, uint8_t digits), but will include newline and carriage return.
- Parameters
-
n | Floating-point number to print. |
digits | Number of digits to send. If argument is omitted, then 2 digits will be used. |
Definition at line 868 of file SPP.cpp.
Used to read the buffer.
- Returns
- Return the byte. Will return 0 if no byte is available.
Definition at line 906 of file SPP.cpp.
Variable used to indicate if the connection is established.
Definition at line 118 of file SPP.h.
The documentation for this class was generated from the following files: