3.4 Bluetooth Click Module Functions
The RN4678 Bluetooth Click module uses a custom written set of seven functions that setup, control, and communicate with the RN4678 Bluetooth Click modules.
The BT_initialConditions()
function sets the base state for the SW_RST,
the RST, and CTS pins.
The BT_initialize()
function switches the SW_RST, the RST, and the CTS pins to the active state with the correct timing between
the commands.
The BT_enterCommandMode()
sends the ‘$$$’
that puts the RN4678 Bluetooth Click into Command Mode.
The BT_scan()
function sends the correct command to scan for other
RN4678 Bluetooth Clicks and waits for that scan to complete (about 20 seconds).
The BT_connect()
function sends the correct command to connect to the RN4678 Bluetooth Click door module and uses the correct timing
to ensure that the connection is made.
- The
BT_scan()
andBT_connect()
functions are used only in the desk module's code since they initiate the Bluetooth connection. - This connection uses the specific MAC address for the modules that are used in this application. The MAC address will need to be changed for other RN4678 Bluetooth Click modules that may be used in the application.