[API] Driver Bluetooth - Thomas-Broussard/hackberry-enableFrance GitHub Wiki
class Hackberry_bluetooth
Summary
| Members | Descriptions |
|---|---|
public Hackberry_bluetooth() |
Constructor of the Bluetooth module driver |
public void init(unsigned char pinRx,unsigned char pinTx,unsigned char pinPower) |
Initialize the Bluetooth module driver |
public void start() |
start Bluetooth module |
public void stop() |
stop Bluetooth module |
public bool isStarted() |
check if bluetooth module is started or not |
public unsigned long getLastActivityTime() |
Get the last activity time of the bluetooth module Remark : the activity time is updated when bluetooth module is started, when it send something, or when it receive something. This function is mainly use to do an automatic shutdown of the module when it is unused (since 10 minutes for example) |
public void send(char c) |
send character through bluetooth emitter |
public void send(String message) |
send String through bluetooth emitter |
public void send(int message) |
send Integer through bluetooth emitter |
public String receive() |
check if data are available in buffer of bluetooth receiver |
public void setName(String name) |
Set the bluetooth module name |
public bool setPassword(String password) |
Set the password of the bluetooth module |
public void setBaud(unsigned long baudrate) |
Set the bluetooth speed communication |
Members
public Hackberry_bluetooth()
Constructor of the Bluetooth module driver
public void init(unsigned char pinRx,unsigned char pinTx,unsigned char pinPower)
Initialize the Bluetooth module driver
Parameters
-
pinRXdigital input - hackberry RX pin (= bluetooth TX pin) -
pinRXdigital output - hackberry TX pin (= bluetooth RX pin) -
pinPowerdigital output - used to power ON/OFF the bluetooth module
public void start()
start Bluetooth module
public void stop()
stop Bluetooth module
public bool isStarted()
check if bluetooth module is started or not
Returns
true if started. false otherwise
public unsigned long getLastActivityTime()
Get the last activity time of the bluetooth module Remark : the activity time is updated when bluetooth module is started, when it send something, or when it receive something. This function is mainly use to do an automatic shutdown of the module when it is unused (since 10 minutes for example)
Returns
last activity time (in ms)
public void send(char c)
send character through bluetooth emitter
Parameters
ccharacter to send
public void send(String message)
send String through bluetooth emitter
Parameters
messageString to send
public void send(int message)
send Integer through bluetooth emitter
Parameters
messageInteger to send
public String receive()
check if data are available in buffer of bluetooth receiver
Returns
data received as String
public void setName(String name)
Set the bluetooth module name
Parameters
nameName to apply
public bool setPassword(String password)
Set the password of the bluetooth module
Parameters
passwordto apply
Returns
true if password is correctly set, false otherwise
public void setBaud(unsigned long baudrate)
Set the bluetooth speed communication
Parameters
baudratespeed to apply (in baud per seconds)