#include <SPP.h>
|
| SPP (BTD *p, const char *name="Arduino", const char *pin="1234") |
|
|
virtual void | ACLData (uint8_t *ACLData) |
|
virtual void | Run () |
|
virtual void | Reset () |
|
virtual void | disconnect () |
|
|
void | print (const String &str) |
|
void | println (const String &str) |
|
void | print (const char *str) |
|
void | println (const char *str) |
|
void | print (uint8_t data) |
|
void | println (uint8_t data) |
|
void | print (uint8_t *array, uint8_t length) |
|
void | println (uint8_t *array, uint8_t length) |
|
void | print (const __FlashStringHelper *ifsh) |
|
void | println (const __FlashStringHelper *ifsh) |
|
void | printFlashString (const __FlashStringHelper *ifsh, bool newline) |
|
void | println (void) |
|
void | printNumber (uint8_t n) |
|
void | printNumberln (uint8_t n) |
|
void | printNumber (int8_t n) |
|
void | printNumberln (int8_t n) |
|
void | printNumber (uint16_t n) |
|
void | printNumberln (uint16_t n) |
|
void | printNumber (int16_t n) |
|
void | printNumberln (int16_t n) |
|
void | printNumber (uint32_t n) |
|
void | printNumberln (uint32_t n) |
|
void | printNumber (int32_t n) |
|
void | printNumberln (int32_t n) |
|
void | intToString (int32_t input, char *output) |
|
void | intToString (uint32_t input, char *output) |
|
void | printNumber (double n, uint8_t digits=2) |
|
void | printNumberln (double n, uint8_t digits=2) |
|
void | doubleToString (double input, char *output, uint8_t digits=2) |
|
uint8_t | available () |
|
uint8_t | read () |
|
void | flush () |
|
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 |
void SPP::print |
( |
const String & |
str | ) |
|
Used to send Arduino String data type.
- Parameters
-
Definition at line 721 of file SPP.cpp.
void SPP::println |
( |
const String & |
str | ) |
|
void SPP::print |
( |
const char * |
str | ) |
|
Used to send standard strings.
- Parameters
-
Definition at line 739 of file SPP.cpp.
void SPP::println |
( |
const char * |
str | ) |
|
void SPP::print |
( |
uint8_t |
data | ) |
|
|
inline |
Used to send single bytes.
- Parameters
-
Definition at line 147 of file SPP.h.
void SPP::println |
( |
uint8_t |
data | ) |
|
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 757 of file SPP.cpp.
void SPP::println |
( |
uint8_t * |
array, |
|
|
uint8_t |
length |
|
) |
| |
void SPP::print |
( |
const __FlashStringHelper * |
ifsh | ) |
|
|
inline |
Used to print strings stored in flash. Use "SerialBT.print(F("String"));" to print a string stored in flash.
- Parameters
-
Definition at line 174 of file SPP.h.
void SPP::println |
( |
const __FlashStringHelper * |
ifsh | ) |
|
|
inline |
void SPP::printFlashString |
( |
const __FlashStringHelper * |
ifsh, |
|
|
bool |
newline |
|
) |
| |
Helper function to print a string stored in flash.
- Parameters
-
ifsh | String stored in flash you want to print. |
newline | Set this to true to include newline and carriage return. |
Definition at line 799 of file SPP.cpp.
void SPP::println |
( |
void |
| ) |
|
Use this to print newline and carriage return.
Definition at line 821 of file SPP.cpp.
void SPP::printNumber |
( |
uint8_t |
n | ) |
|
|
inline |
Used to print unsigned integers.
- Parameters
-
n | Unsigned integer to send. |
Definition at line 200 of file SPP.h.
void SPP::printNumberln |
( |
uint8_t |
n | ) |
|
|
inline |
Same as printNumber(uint8_t n), but will include newline and carriage return.
- Parameters
-
n | Unsigned integer to send. |
Definition at line 208 of file SPP.h.
void SPP::printNumber |
( |
int8_t |
n | ) |
|
|
inline |
Used to print signed integers.
- Parameters
-
Definition at line 216 of file SPP.h.
void SPP::printNumberln |
( |
int8_t |
n | ) |
|
|
inline |
void SPP::printNumber |
( |
uint16_t |
n | ) |
|
|
inline |
Used to print unsigned integers.
- Parameters
-
n | Unsigned integer to send. |
Definition at line 232 of file SPP.h.
void SPP::printNumberln |
( |
uint16_t |
n | ) |
|
|
inline |
void SPP::printNumber |
( |
int16_t |
n | ) |
|
|
inline |
Used to print signed integers.
- Parameters
-
Definition at line 248 of file SPP.h.
void SPP::printNumberln |
( |
int16_t |
n | ) |
|
|
inline |
void SPP::printNumber |
( |
uint32_t |
n | ) |
|
Used to print unsigned integers.
- Parameters
-
n | Unsigned integer to send. |
Definition at line 827 of file SPP.cpp.
void SPP::printNumberln |
( |
uint32_t |
n | ) |
|
void SPP::printNumber |
( |
int32_t |
n | ) |
|
Used to print signed integers.
- Parameters
-
Definition at line 840 of file SPP.cpp.
void SPP::printNumberln |
( |
int32_t |
n | ) |
|
void SPP::intToString |
( |
int32_t |
input, |
|
|
char * |
output |
|
) |
| |
Helper function to convert from an unsigned integer to a string.
- Parameters
-
input | Unsigned integer to convert. |
output | Output buffer. |
Definition at line 853 of file SPP.cpp.
void SPP::intToString |
( |
uint32_t |
input, |
|
|
char * |
output |
|
) |
| |
Helper function to convert from a signed integer to a string.
- Parameters
-
input | Signed integer to convert. |
output | Output buffer. |
Definition at line 863 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 881 of file SPP.cpp.
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 887 of file SPP.cpp.
void SPP::doubleToString |
( |
double |
input, |
|
|
char * |
output, |
|
|
uint8_t |
digits = 2 |
|
) |
| |
Helper function to convert from a double to a 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 894 of file SPP.cpp.
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 319 of file SPP.h.
Used to read the buffer.
- Returns
- Return the byte. Will return 0 if no byte is available.
Definition at line 923 of file SPP.cpp.
Discard all the bytes in the buffer.
Definition at line 329 of file SPP.h.
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: