Bluetooth Slave JDY-31 SPP (Serial Port Profile) Task Handler C Driver
This library is written in portable C, and is MCU independent. JDY-31 is a bluetooth V4.0 SPP slave module. In order to implement it to your MCU of choice, you need to manipulate functions inside jdy_slave.h, jdy_slave_low_level.c and jdy_slave_tasks.c.
An arbitrary number of tasks could be defined by user (256 tasks maximum, theoretically).
Any resemblance to pre-existing code is unintentional.
JDY-31 SPP bluetooth module, otherwise known as SPP-C, is a bluetooth slave module based on BK3231S Bluetooth SoC by Beken. It supports a total of 8 AT Commands:
AT+VERSION
AT+RESET
AT+DISC
AT+LADDR
AT+PIN
AT+BAUD
AT+NAME
AT+DEFAULT
After configuring low level functions inside jdy_slave_low_level, you need to add your predefined tasks and their names into the case-switch statement inside jdy_slave_tasks.c. Next, add the task names inside the ‘enum tasks’, and NUMBER_OF_TASKS inside jdy_slave.h.
Inside your own firmware, use bluetooth_slave_init() to start communicating with SPP module, and bluetooth_tasks_handler() to check for incoming tasks.
Functions can be categorized in different levels. Higher level functions use Lower level functions.
LEVEL 1:
LEVEL 2:
LEVEL 3: