Component: Bluetooth (BL0170) (E-blocks 2): Difference between revisions
Appearance
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"" |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 66: | Line 66: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ConnectToMAC''' | ||
|- | |- | ||
| colspan="2" | Connects to a specific Bluetooth MAC address. Waits up to 5 seconds for connection to be established. Returns 1 if connection was successful. | | colspan="2" | Connects to a specific Bluetooth MAC address. Waits up to 5 seconds for connection to be established. Returns 1 if connection was successful. | ||
| Line 85: | Line 85: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''EnterCommandMode''' | ||
|- | |- | ||
| colspan="2" | Enters command mode allowing commands to be sent using the SendCommand macro. Returns: 0 = No Reply / 1 = Command Mode OK | | colspan="2" | Enters command mode allowing commands to be sent using the SendCommand macro. Returns: 0 = No Reply / 1 = Command Mode OK | ||
| Line 99: | Line 99: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetMACAddress''' | ||
|- | |- | ||
| colspan="2" | Gets the local Bluetooth device MAC address. | | colspan="2" | Gets the local Bluetooth device MAC address. | ||
| Line 113: | Line 113: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Sets up the Bluetooth module including: - Enabling the UART - Configuring the module (Name / Key / etc) Returns 1 for OK and 0 for no reply. | | colspan="2" | Sets up the Bluetooth module including: - Enabling the UART - Configuring the module (Name / Key / etc) Returns 1 for OK and 0 for no reply. | ||
| Line 127: | Line 127: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LeaveCommandMode''' | ||
|- | |- | ||
| colspan="2" | Leaves command mode allowing data to be passed back and forth, | | colspan="2" | Leaves command mode allowing data to be passed back and forth, | ||
| Line 141: | Line 141: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadString''' | ||
|- | |- | ||
| colspan="2" | Copies the incoming data from the data string array to a local string variable. | | colspan="2" | Copies the incoming data from the data string array to a local string variable. | ||
| Line 160: | Line 160: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveByte''' | ||
|- | |- | ||
| colspan="2" | Receives a single data byte from the Bluetooth module. 0-255 signifies valid data / 256 signifies no data available. | | colspan="2" | Receives a single data byte from the Bluetooth module. 0-255 signifies valid data / 256 signifies no data available. | ||
| Line 179: | Line 179: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveCount''' | ||
|- | |- | ||
| colspan="2" | Returns the number of bytes currently sat waiting in the receive buffer. | | colspan="2" | Returns the number of bytes currently sat waiting in the receive buffer. | ||
| Line 193: | Line 193: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendByte''' | ||
|- | |- | ||
| colspan="2" | Sends a single data byte out to the Bluetooth module. | | colspan="2" | Sends a single data byte out to the Bluetooth module. | ||
| Line 212: | Line 212: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendCommand''' | ||
|- | |- | ||
| colspan="2" | Sends a command string to the Bluetooth module. Returns: 0 = No Reply / 1 = Command sent ok | | colspan="2" | Sends a command string to the Bluetooth module. Returns: 0 = No Reply / 1 = Command sent ok | ||
| Line 241: | Line 241: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendString''' | ||
|- | |- | ||
| colspan="2" | Sends a string to the Bluetooth module. | | colspan="2" | Sends a string to the Bluetooth module. | ||
| Line 265: | Line 265: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WaitForStringValue''' | ||
|- | |- | ||
| colspan="2" | Allows us to wait and check for an incoming value. Returns 1 if the string value is found otherwise returns 0. | | colspan="2" | Allows us to wait and check for an incoming value. Returns 1 if the string value is found otherwise returns 0. | ||
| Line 290: | Line 290: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Bluetooth Settings | ||
|- | |- | ||
|- | |- | ||
| Line 323: | Line 323: | ||
| colspan="2" | Amount of RAM memory to dedicate to receiving responses and incoming data from the BT module. Default 40 | | colspan="2" | Amount of RAM memory to dedicate to receiving responses and incoming data from the BT module. Default 40 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Connections | ||
|- | |- | ||
|- | |- | ||
| Line 362: | Line 362: | ||
| colspan="2" | Allows the hardware receive pin to be configured from a list of available pins based on your target device, | | colspan="2" | Allows the hardware receive pin to be configured from a list of available pins based on your target device, | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
| Line 371: | Line 371: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:36, 13 July 2026
| Author | Matrix Ltd. |
| Version | 1.3 |
| Category | E-blocks 2 |
Bluetooth component
Low level routines for controlling a Microchip RN4677 Bluetooth Module. Also available in the form of the BL0170 Bluetooth E-block. Uses an interrupt to receive characters from the UART and improve reliability, Must be used with a hardware UART channel.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EBlocks2_Bluetooth_RN4677_BL0170.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EBlocks2_Bluetooth_RN4677_BL0170.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ConnectToMAC
| ConnectToMAC | |
| Connects to a specific Bluetooth MAC address. Waits up to 5 seconds for connection to be established. Returns 1 if connection was successful. | |
| MACAddress | |
| Return | |
EnterCommandMode
| EnterCommandMode | |
| Enters command mode allowing commands to be sent using the SendCommand macro. Returns: 0 = No Reply / 1 = Command Mode OK | |
| Return | |
GetMACAddress
| GetMACAddress | |
| Gets the local Bluetooth device MAC address. | |
| Return | |
Initialise
| Initialise | |
| Sets up the Bluetooth module including: - Enabling the UART - Configuring the module (Name / Key / etc) Returns 1 for OK and 0 for no reply. | |
| Return | |
LeaveCommandMode
| LeaveCommandMode | |
| Leaves command mode allowing data to be passed back and forth, | |
| Return | |
ReadString
| ReadString | |
| Copies the incoming data from the data string array to a local string variable. | |
| NumBytes | |
| Maximum number of bytes to try and read | |
| Return | |
ReceiveByte
ReceiveCount
| ReceiveCount | |
| Returns the number of bytes currently sat waiting in the receive buffer. | |
| Return | |
SendByte
| SendByte | |
| Sends a single data byte out to the Bluetooth module. | |
| Data | |
| Return | |
SendCommand
SendString
| SendString | |
| Sends a string to the Bluetooth module. | |
| Command | |
| SendCR | |
| Return | |
WaitForStringValue