Development Examples

[中文版]

Data Throughput Mode Application

What is Throughput Mode?

FSC-BT910x series dual-mode Bluetooth data transmission modules have two data transmission modes: Throughput Mode and Command Mode.

The generic data throughput firmware for the FSC-BT910x series modules default to throughput mode. To switch modes, refer to the FSC-BT910x General Dual-Mode Data AT Command Set and use the AT+TPMODE command.

The operation and differences between the two modes are as follows:

  • Throughput Mode:

    Bluetooth Not Connected: Data received via UART is parsed as AT commands.

    Bluetooth Connected: All data received via UART is sent as-is to the remote Bluetooth device. It does not contain any data headers or framing and does not require AT commands to send data.

  • Command Mode:

    Bluetooth Not Connected: Data received via UART is parsed as AT commands.

    Bluetooth Connected: Data received via UART is still parsed as AT commands. It will contain specific response indication headers and framing. Data must be sent to the remote device using AT commands, such as AT+SPPSEND or AT+LESEND .

Module to Phone Application

  1. Module : After power-on, the module will continuously send broadcast packet data.

  2. Phone : Open the FeasyBlue APP , scan for nearby Bluetooth device advertisements, find the target Bluetooth module, and establish a connection.

  3. Connection Success : After successful connection, the status pin of the module will pull up the level, indicating that the connection has been established.

  4. Data Transmission : After successful connection, in the througput mode, the module will automatically transmit the serial port data it receives to the remote end (mobile phone side) via air.

../_images/bt910x-dev-app-tp.png

Module to Module Application

Demonstration of SPP communication and data throughput transmission between an FSC-BT9101AI and an FSC-BT986 Bluetooth module, as follows:

1.Scan for nearby SPP devices

FSC-BT9101AI scans for nearby Bluetooth SPP devices, as follows:

 1Send:     <<AT+SCAN=1                // Scan for nearby Bluetooth SPP devices
 2Response: >>OK
 3Response: >>+SCAN={                   // Scan started
 4Response: >>+SCAN=1,2,DC0D3100015E,-58,10,FSC-BT986
 5Response: >>+SCAN=2,2,DC0D30000016,-80,20,FSC-BT1038C-AKM-0016
 6Response: >>+SCAN=3,2,DC0D300022C1,-84,10,FSC-BT826F
 7Response: >>+SCAN=4,2,AC198EAC5DFE,-78,2,FR
 8Response: >>+SCAN=5,2,DC0D3053FFEE,-90,16,iMin TF2-34 FFEE
 9Response: >>+SCAN=6,2,1418C3B28AC1,-76,15,DESKTOP-U13VRNN
10Response: >>+SCAN=7,2,DC0D3070F37A,-86,5,TT440
11Response: >>+SCAN=8,2,A0B339DB5208,-66,10,QUZHENGWEI
12Response: >>+SCAN=}                  // Scan ended

2.Establish SPP connection request

FSC-BT9101AI Establish an SPP protocol connection with the FSC-BT986 via the AT+SPPCONN command. The operation is as follows:

1Send:     <<AT+SPPCONN=DC0D3100015E    // Initiate an SPP connection request to the remote FSC-BT986
2Response: >>OK

3.SPP Connected

In throughput mode, after a successful Bluetooth connection, the UART will not receive event response indicators. The connection status can be determined by the level state of the status pin (e.g., Pin 33) on the FSC-BT9101AI, as follows:

  • High Level (H): Indicates Bluetooth is successfully connected.

  • Low Level (L): Indicates Bluetooth is not connected or the connection has been disconnected.

4.Send data

Throughput mode of the general data transmission firmware is enabled by default. After the SPP connection is successfully established, data transparent transmission communication can be performed, as shown in the following figure:

../_images/bt910x-dev-bt986-tp.png

Read/Write Module Default Parameters

When Bluetooth is not connected, the module parses UART data as AT commands. The host can query and modify the module’s default parameters. As follow:

  1. Write the device name to ABC

  2. Read the device name

  3. Read the Bluetooth address

@startuml
hide footbox
skinparam sequenceMessageAlign center

box "local" #LightBlue
participant Host as host
participant Module as bt
end box


rnote over host, bt: Write device name to ABC

host -> bt: AT+NAME=ABC\\r\\n
bt -> host: \\r\\nOK\\r\\n"

rnote over host, bt: Read device name

host -> bt: AT+NAME\\r\\n
bt -> host: \\r\\n+NAME=ABC\\r\\n\\r\\nOK\\r\\n"

rnote over host, bt: Read Bluetooth address

host -> bt: AT+ADDR\\r\\n
bt -> host: \\r\\n+ADDR=DC0D30010203\\r\\n\\r\\nOK\\r\\n

@enduml

Data Transmission Flow

Upon power-up, the module continuously transmits advertisement data. A remote Bluetooth device (e.g., phone) can discover these advertisement packets via scanning and initiate a connection request to the module.

Upon successful connection, the module pulls its connection status pin HIGH to notify the host of the successful Bluetooth connection.

The host can send data to the remote Bluetooth device via the Bluetooth module, and the remote Bluetooth device can also send data to the host.

@startuml
hide footbox
skinparam sequenceMessageAlign center

box "local" #LightBlue
participant Host as host
participant Module as bt
end box

box "remote" #LightBlue
participant "Remote BT" as remote
end box

rnote over host, remote: Establish Connection

        bt --> remote: Advertisement Packet
        bt <--  remote: Scan
        bt --> remote: Advertisement Packet
        bt <--  remote: Request Connection

rnote over host, remote: Connection Successful

host <- bt: Pull Connection Status Pin HIGH

rnote over host, remote: Send Data

host -> bt: UART Send: ABC
        bt -->  remote: BT Send: ABC
        bt <--  remote: BT Send: DEF
host <- bt: UART Output: DEF

        bt <--  remote: Disconnect BT

host <- bt: Connection Disconnected

host <- bt: Pull Connection Status Pin LOW
        bt --> remote: Advertisement Packet

@enduml

Module Acts as Master to Connect to Remote Device

The module can act as a master device to connect to a slave device. The host can send commands to control the module to perform scanning, connection, and disconnection.

@startuml

hide footbox
skinparam sequenceMessageAlign center

box "local" #LightBlue
participant Host as host
participant Module as bt
end box

box "remote" #LightBlue
participant "Remote BT" as remote
end box

host -> bt: AT+SCAN=2\\r\\n
host <- bt: \\r\\nOK\\r\\n
        bt -->  remote: Scan
        bt <-- remote: Advertisement Packet
host <- bt: \\r\\n+SCAN=0,1,DC0D30001ED4,-65,10,FSC-BT946\\r\\n
host -> bt: AT+LECCONN=DC0D30001ED41\\r\\n
host <- bt: \\r\\nOK\\r\\n
        bt -->  remote: Request Connection

rnote over host, remote: Connection Successful

host <- bt: Pull Connection Status Pin HIGH

rnote over host, remote: Send Data

host -> bt: UART Send: ABC
        bt -->  remote: BT Send: ABC
        bt <--  remote: BT Send: DEF
host <- bt: UART Output: DEF

host -> bt: AT+LEDISC\\r\\n
host <- bt: \\r\\nOK\\r\\n
        bt -->  remote: Disconnect BT

rnote over host, remote: Connection Disconnected

host <- bt: Pull Connection Status Pin LOW
        bt --> remote: Advertisement Packet

@enduml