Feasycom FSC-Blueware User manual

1
Bluetooth portable stack user guide
Version 2.8

2
Copyright © 2013-2018 Feasycom Technology Co., Ltd. All Rights Reserved.
Revision History
Version
Data
Notes
Author
Contact Us:
Shenzhen Feasycom Technology Co., Ltd
Web: www.feasycom.com
Email:support@feasycom.com
Tel: +86-755-27924639,+86-755-23062695
Address: Room 2004-2005,20th Floor, Huichao Technology Building,
Jinhai Road, Xixiang, Baoan District, Shenzhen,518100, China.

3
Contents
1. Introduction.................................................................................................................................................... 6
1.1. Context............................................................................................................................................ 6
1.2. Terms............................................................................................................................................... 6
1.3. Supported Bluetooth Profile ................................................................................................ 7
1.4. Command Format...................................................................................................................... 7
1.5. Indication Format...................................................................................................................... 8
1.6. Default Settings .......................................................................................................................... 8
2. Command Table............................................................................................................................................. 9
2.1. General Commands .................................................................................................................. 9
2.1.1. AT Command Test............................................................................................................ 9
2.1.2. Bluetooth Profile Selection <configurable> .................................................................... 9
2.1.3. Read Firmware Version.............................................................................................. 10
2.1.4. Read BR/EDR MAC Address .................................................................................... 10
2.1.5. Read BLE MAC Address.............................................................................................. 11
2.1.6. Read/Write BR/EDR Local Name <configurable>.................................................... 11
2.1.7. Read/Write BLE Local Name <configurable> ............................................................. 12
2.1.8. Read/Write Pin Code <configurable>............................................................................. 12
2.1.9. Read/Write Pairing Mode <configurable> ................................................................... 12
2.1.10. Accept/Reject Remote Pairing Request ............................................................. 13
2.1.11. Read/Write Class of Device...................................................................................... 13
2.1.12. Read/Clear Paired Record........................................................................................ 13
2.1.13. Read/Write Trust Device List Size <configurable> .................................................. 14
2.1.14. Scan Nearby Devices ................................................................................................... 14
2.1.15. Release All Connections............................................................................................. 14
2.1.16. Soft Reboot....................................................................................................................... 15
2.1.17. Restore Factory Settings............................................................................................ 15
2.1.18. Mute/Unmute Microphone...................................................................................... 15
2.1.19. Read/Write Music Volume Level........................................................................... 15
2.2. HFP Commands....................................................................................................................... 15
2.2.1. Read/Write HFP Configuration.............................................................................. 15
2.2.2. Read HFP State............................................................................................................... 16
2.2.3. Establish HFP Connection......................................................................................... 16
2.2.4. Release HFP Connection............................................................................................ 17
2.2.5. Dial/Redial Phone Number...................................................................................... 17
2.2.6. Send DTMF code............................................................................................................ 17
2.2.7. Pick Up Incoming Call................................................................................................. 18
2.2.8. Reject/Hung up Call..................................................................................................... 18
2.2.9. Three way calling control.......................................................................................... 18
2.2.10. Transfer Voice Audio ................................................................................................... 18
2.3. A2DP/AVRCP Commands................................................................................................... 19
2.3.1. Read A2DP State............................................................................................................ 19
2.3.2. Establish A2DP Connection ..................................................................................... 19

4
2.3.3. Release A2DP Connection......................................................................................... 19
2.3.4. Read/Write AVRCP Configuration ........................................................................ 20
2.3.5. Track Play/Pause .......................................................................................................... 20
2.3.6. Track Play ......................................................................................................................... 20
2.3.7. Track Pause...................................................................................................................... 20
2.3.8. Track Stop......................................................................................................................... 21
2.3.9. Track Forward................................................................................................................ 21
2.3.10. Track Backward............................................................................................................. 21
2.3.11. Get Media Player ........................................................................................................... 21
2.3.12. Select Media Player...................................................................................................... 21
2.3.13. Get Folder/Media Item............................................................................................... 22
2.3.14. Select Folder/Media Item ......................................................................................... 22
2.4. Phonebook Access Commands ........................................................................................ 22
2.4.1. Download Phonebook ................................................................................................ 22
2.5. SPP Commands........................................................................................................................ 23
2.5.1. Read SPP State................................................................................................................ 23
2.5.2. Establish SPP Connection ......................................................................................... 23
2.5.3. Release SPP Connection............................................................................................. 23
2.5.4. Send Data Via SPP......................................................................................................... 23
2.6. GATT Commands.................................................................................................................... 24
2.6.1. Read GATT State............................................................................................................ 24
2.6.2. Release GATT Connection......................................................................................... 24
2.6.3. Send Data Via GATT..................................................................................................... 24
3. Indication Table.......................................................................................................................................... 25
3.1. General Indications................................................................................................................ 25
3.1.1. Device State ..................................................................................................................... 25
3.1.2. Scan Result....................................................................................................................... 25
3.1.3. Pair Request .................................................................................................................... 26
3.1.4. Pair Result ........................................................................................................................ 26
3.1.5. Microphone Mute State.............................................................................................. 26
3.2. HFP Indications....................................................................................................................... 26
3.2.1. HFP State........................................................................................................................... 26
3.2.2. HFP Device Information ............................................................................................ 27
3.2.3. HFP Voice Audio State................................................................................................. 27
3.2.4. HFP Device Network Signal Strength.................................................................. 27
3.2.5. HFP Device Network Operator Selection .......................................................... 28
3.2.6. HFP Device Roaming State ....................................................................................... 28
3.2.7. HFP Device Battery Level.......................................................................................... 28
3.2.8. HFP Device Manufacture........................................................................................... 28
3.2.9. HFP Phone Subscriber Number ............................................................................. 28
3.2.10. HFP Ringing..................................................................................................................... 28
3.3. A2DP/AVRCP Indications................................................................................................... 29
3.3.1. A2DP State........................................................................................................................ 29
3.3.2. A2DP Device Information ......................................................................................... 29

5
3.3.3. AVRCP State..................................................................................................................... 29
3.3.4. Media Player State........................................................................................................ 29
3.3.5. Media Player Play Progress...................................................................................... 30
3.3.6. Media Track Information .......................................................................................... 30
3.4. Phonebook Access Indications......................................................................................... 30
3.4.1. PB State.............................................................................................................................. 30
3.4.2. PB Entries of Remote Devices................................................................................. 31
3.4.3. Received Phonebook Data ........................................................................................ 31
3.5. SPP Indications........................................................................................................................ 32
3.5.1. SPP State ........................................................................................................................... 32
3.5.2. SPP Received Data ........................................................................................................ 32
3.6. GATT Indications .................................................................................................................... 33
3.6.1. GATT State........................................................................................................................ 33
3.6.2. GATT Received Data..................................................................................................... 33

6
1.Introduction
The FSC-Blueware is a portable implementation of Bluetooth stack. With FSC-Blueware
running on a host, designers can easily customize their applications to support multiple
Bluetooth profiles, such as HFP/HSP, A2DP, AVRCP, PBAP, HID, SPP, iAP, BLE-GATT and
etc.
The FSC-Blueware is written in C/C++ language, which makes it easily to be integrated
with various posix system, such as Linux, Android, QNX, WinCE and so on.
1.1.Context
1.2.Terms
Throughout this specification:
Content between { } is optional
Content behind << represents a COMMAND from Host
Content behind >> represents a RESPONSE to Host
Content with tag <configurable> can be overridden by external configuration file

7
1.3.Supported Bluetooth Profile
SPP (Serial Port Profile)
GATT Server (Generic Attribute Profile)
GATT Client (Generic Attribute Profile)
HFP Sink (Hands-Free Profile)
HFP Source (Hands-Free Profile)
A2DP Sink (Advanced Audio Distribution Profile)
A2DP Source (Advanced Audio Distribution Profile)
AVRCP Controller (Audio/Video remote controller Profile)
AVRCP Target (Audio/Video remote controller Profile)
HID Keyboard (Human Interface Profile)
PBAP Server (Phonebook Access Profile)
iAP2 (For iOS devices)
1.4.Command Format
AT+ Command {=Param1{, Param2{, Param3...}}} <CR><LF>
All commands start with “AT”, end with <CR><LF>
<CR> stands for "carriage return", corresponding hex is 0x0D
<LF> stands for "line feed", corresponding hex is 0x0A
If command has parameter, parameter keep behind “=”
If command has multiple parameters, parameter must be separated by “,”
If command has response, response start with <CR><LF>, end with <CR><LF>
Module will always report command’s execution result using “OK” for success or
“ERR<code>” for failure
Error Code
Meaning
001
Failed
002
Invalid Parameter
003
Invalid State
004
Command Mismatch
005
Busy
006
Not Supported
007
No Memory
Others
Reserved for Future Use
e.g.
1. Read module’s BR/EDR local name
<< AT+NAME
>> +NAME=Feasycom

8
OK
2. Pick up an incoming call when no call incoming actually
<< AT+HFPANSW
>> ERR003
1.5.Indication Format
<CR><LF>+ Indication {=Param1{, Param2{, Param3...}}} <CR><LF>
All indications start with <CR><LF>, end with <CR><LF>
If indication has parameter, parameter keep behind “=”
If indication has multiple parameters, parameter must be separated by “,”
Hex value <FF> will be used instead of “,” in some special indications
e.g.
1. Received “1234567890” from mobile phone via SPP profile
>> +SPPDATA=10,1234567890
2. Dial number “10086” use a mobile phone when HFP connected
>> +HFPSTAT=4,10086
+HFPAUDIO=1
+HFPSTAT=6,10086
1.6.Default Settings
Local Name (BR/EDR)
FSC-XXX
Local Name (LE)
FSC-XXX-LE
Pin Code
0000
Secure Simple Pairing Mode
ON
UART Interface
/dev/bw_serial
UART Format
115200bps/8/N/1
Profiles Selection
1192

9
2.Command Table
2.1.General Commands
2.1.1.AT Command Test
Format: AT
Response: OK
Description: Test the communication between HOST and Module after power on, UART
baudrate changed and etc.
Example: AT command test
<<
AT
>>
OK
2.1.2.Bluetooth Profile Selection <configurable>
Format: AT+PROFILE{=Param}
Param: A base-10 representation of a bit field, default:1192, for each bit:
BIT[0]
SPP (Serial Port Profile)
BIT[1]
GATT Server (Generic Attribute Profile)
BIT[2]
GATT Client (Generic Attribute Profile)
BIT[3]
HFP Sink (Hands-Free Profile)
BIT[4]
HFP Source (Hands-Free Profile)
BIT[5]
A2DP Sink (Advanced Audio Distribution Profile)
BIT[6]
A2DP Source (Advanced Audio Distribution Profile)
BIT[7]
AVRCP Controller (Audio/Video remote controller Profile)
BIT[8]
AVRCP Target (Audio/Video remote controller Profile)
BIT[9]
HID Keyboard (Human Interface Profile)
BIT[10]
PBAP Server (Phonebook Access Profile)
BIT[15]
iAP2 (For iOS devices)
Response: +PROFILE=Param
Description: GATT Server and Client, HFP Sink and Source, A2DP Sink and Source, AVRCP

10
Controller and Target cannot be enabled both because of mutual exclusion.
Module will soft reboot if profile selection changed
Example: Read current profile selection
<<
AT+PROFILE
>>
+PROFILE=1195
Example: Enable SPP, GATT Server, HFP Source, A2DP Source profile, disable the others
<<
AT+PROFILE=83
>>
OK
2.1.3.Read Firmware Version
Format: AT+VER
Response: +VER=Param
Param: Firmware version
Example: Read module’s firmware version
<<
AT+VER
>>
+VER=FSC-BT805B, V1.0.0,20160120
>>
OK
2.1.4.Read BR/EDR MAC Address
Format: AT+ADDR
Response: +ADDR=Param
Param: Module’s BR/EDR MAC address (12 Bytes ASCII)
Example: Read Module’s BR/EDR MAC address
<<
AT+ADDR
>>
+ADDR=DC0D30123456
>>
OK

11
2.1.5.Read BLE MAC Address
Format: AT+LEADDR
Response: +LEADDR=Param
Param: Module's LE MAC address (12 Bytes ASCII)
2.1.6.Read/Write BR/EDR Local Name <configurable>
Format: AT+NAME {=Param1{, Param2}}
Param1: BR/EDR local name (1~31 Bytes ASCII, default: FSC-BT90X)
Param2: MAC address suffix (0/1, default:0)
(0)
Disable suffix
(1)
Enable suffix “-XXXX” (lower 4 bytes of MAC address) after local name
Response: +NAME=Param
Description: Write local name if parameter existence, otherwise read current local name
Example: Read current BR/EDR local name
<<
AT+NAME
>>
+NAME=Feasycom
>>
OK
Example: Change module’s BR/EDR local name to “ABC”
<<
AT+NAME=ABC
>>
OK
Example: Change module’s BR/EDR local name to “ABC” and enable suffix
<<
AT+NAME=ABC,1
>>
OK

12
2.1.7.Read/Write BLE Local Name <configurable>
Format: AT+LENAME {=Param1{, Param2}}
Param1: BLE local name (1~25 Bytes ASCII, default: FSC-BT90X-LE)
Param2: MAC address suffix (0/1, default:0)
(0)
Disable suffix
(1)
Enable suffix “-XXXX” (lower 4 bytes of MAC address) after local name
Response: +LENAME=Param
2.1.8.Read/Write Pin Code <configurable>
Format: AT+PIN{=Param}
Param: Pin code (4~15 Bytes ASCII, default:0000)
Response: +PIN=Param
Example: Read module’s pin code
<<
AT+PIN
>>
+PIN=0000
>>
OK
Example: Change module’s pin code to “12345678”
<<
AT+PIN=12345678
>>
OK
Description: Pin code only work in legacy pairing mode, see AT+SSP
2.1.9.Read/Write Pairing Mode <configurable>
Format: AT+SSP{=Param}
Param: Pairing mode (0~3, default:2)
(0)
Legacy pairing, use pin code for pairing
(1)
Secure simple pairing, auto pairing
(2)
Secure simple pairing, display yes/no in pairing
(3)
Secure simple pairing, passkey compare, user need to accept/reject pair request

13
Response: +SSP=Param
2.1.10. Accept/Reject Remote Pairing Request
Format: AT+CFM=Param1, Param2
Param1: 12 Bytes MAC address of remote device
Param2: 0/1
(0)
Reject remote pairing request
(1)
Accept remote pairing request
Description: Only used for pairing request in pairing mode 3, see AT+SSP
2.1.11. Read/Write Class of Device
Format: AT+COD{=Param}
Param: Class of device (6 bytes ASCII, default:240404 Handsfree device)
Response: +COD=Param
2.1.12. Read/Clear Paired Record
Format: AT+PLIST{=Param}
Param:(0/1~8/12 Bytes MAC address)
(0)
Clear all paired record
(1~8)
Clear specific paired record with index
(MAC)
Clear specific paired record with MAC address
Response1: +PLIST=Param1, Param2, Param3{, Param4}
Param1: (1~8) Paired device’s index
Param2: (MAC) Paired device’s MAC address
Param3: A base-10 representation of a bit field, support profiles of device, see AT+PROFILE
Param4: (UTF8) Paired device’s name
Response2: +PLIST=E: End of the paired record
Example: Read module’s paired record
<<
AT+PLIST

14
>>
+PLIST=1,32808,1C5CF226D773, iPhone
+PLIST=2,40, A0BC30075421, Samsung S8
+PLIST=E
>>
OK
Example: Clear module’s paired record
<<
AT+PLIST=0
>>
OK
2.1.13. Read/Write Trust Device List Size <configurable>
Format: AT+TDL{=Param}
Param:(0~8, default:0)
(0)
Auto mode: Latest paired record will replace the oldest one if paired list full
(1~8)
Limit mode: Device will not enter discoverable mode if paired list full
Response: +TDL=Param
2.1.14. Scan Nearby Devices
Format: AT+SCAN=Param1{, Param2{, Param3}}
Param1:(0~3)
(0)
Stop scan
(1)
Scan nearby BR/EDR devices
(2)
Scan nearby BLE devices
(3)
Scan nearby BR/EDR/BLE devices
Param2:(1~48) Scan period. unit:1.28s, default:12.8s
Param3:(1~25 Bytes ASCII) Name filter. Filter scan results with name if set
Description: Refer to Chapter 3 for format description of scan result
2.1.15. Release All Connections
Format: AT+DSCA
Description: Module release all Bluetooth connections with remote device

15
2.1.16. Soft Reboot
Format: AT+REBOOT
Description: Module release all Bluetooth connections with remote device then reboot
2.1.17. Restore Factory Settings
Format: AT+RESTORE
Description: Module restore all factory settings then reboot
2.1.18. Mute/Unmute Microphone
Format: AT+MICMUTE{=Param}
Param: Mute (0/1, default:0)
(0)
Unmute microphone
(1)
Mute microphone
Description: Only used for temporary mute/unmute microphone while call active
2.1.19. Read/Write Music Volume Level
Format: AT+SPKVOL{=Param}
Param: Volume (0~15, default:14)
Description: Set a2dp streaming volume level
2.2.HFP Commands
2.2.1.Read/Write HFP Configuration
Format: AT+HFPCFG{=Param}

16
Param: A base-10 representation of a bit field, default:3, for each bit:
BIT[0]
Auto reconnect to last device after power on
BIT[1]
NREC (Noise reduction and echo cancelling) function enable
BIT[2]
HFP 3-way-calling function enable
Example: Read HFP configuration
<<
AT+HFPCFG
>>
+HFPCFG=1
OK
2.2.2.Read HFP State
Format: AT+HFPSTAT
Response: +HFPSTAT=Param
Param:(0~6)
(0)
Unsupported
(1)
Standby
(2)
Connecting
(3)
Connected
(4)
Outgoing call
(5)
Incoming call
(6)
Active call
(7)
Active held (3-way-calling)
(8)
First call active, second call waiting (3-way-calling)
(9)
First call active, second call held (3-way-calling)
(10)
First call outgoing, second call held (3-way-calling)
2.2.3.Establish HFP Connection
Format: AT+HFPCONN{=Param}
Param: MAC address of target device (12 Bytes ASCII)
Description: Reconnect to last HFP device if parameter not exist

17
Example: Connect to last HFP device
<<
AT+HFPCONN
>>
OK
Example2: Connect to specific HFP device with MAC address
<<
AT+HFPCONN=1C5CF226D773
>>
OK
2.2.4.Release HFP Connection
Format: AT+HFPDISC
Description: Release current HFP connection with remote device
2.2.5.Dial/Redial Phone Number
Format: AT+HFPDIAL{=Param}
Param: Phone number (1~25 Bytes ASCII)
Description: Dial specific number if parameter existence, otherwise redial
Example: Redial
<<
AT+HFPDIAL
>>
OK
Example: Dial number “075527924639”
<<
AT+HFPDIAL=075527924639
>>
OK
2.2.6.Send DTMF code
Format: AT+HFPDTMF=Param
Param: DTMF code (0~9/#/*)
Example: Send DTMF code “#” while talking
<<
AT+HFPDTMF=#
>>
OK

18
2.2.7.Pick Up Incoming Call
Format: AT+HFPANSW
Description: Pick up an incoming call
2.2.8.Reject/Hung up Call
Format: AT+HFPCHUP
Description: Reject incoming call or hung up outgoing/active call
2.2.9.Three way calling control
Format: AT+ HFPMCAL=Param
Param: Control (0~2)
(0)
Release held call or reject waiting call
(1)
Release active call and accept another call
(2)
Hold active call and accept another call
Description: User need to turn on 3-way-calling function use command AT+HFPCFG
2.2.10. Transfer Voice Audio
Format: AT+HFPADTS{=Param}
Param: Transfer direction (1/2)
(1)
Transfer voice audio from module to remote device
(2)
Transfer voice audio from remote device to module
Description: Transfer voice audio between module and remote device by default if no
parameter set

19
2.3.A2DP/AVRCP Commands
2.3.1.Read A2DP State
Format: AT+A2DPSTAT
Response: +A2DPSTAT=Param
Param:(0~5)
(0)
Unsupported
(1)
Standby
(2)
Connecting
(3)
Connected
(4)
Paused
(5)
Streaming
2.3.2.Establish A2DP Connection
Format: AT+A2DPCONN{=Param}
Param: MAC address of target device (12 Bytes ASCII)
Description: Module will reconnect to last A2DP device if no parameter exist
Example: Connect to last A2DP device
<<
AT+A2DPCONN
>>
OK
Example2: Connect to specific A2DP device with MAC address
<<
AT+A2DPCONN=1C5CF226D773
>>
OK
2.3.3.Release A2DP Connection
Format: AT+A2DPDISC
Description: Release current A2DP connection with remote device

20
2.3.4.Read/Write AVRCP Configuration
Format: AT+AVRCPCFG{=Param}
Param: A base-10 representation of a bit field, default:3, for each bit:
BIT[0]
Auto get track ID3 information (title, artist, album) on track changed.default:1
BIT[1-3]
Auto get track state (play progress) if value > 0. default:1 second
BIT[4]
Browsing function enable/disable
Example: Read AVRCP configuration
<<
AT+ AVRCPCFG
>>
+ AVRCPCFG =1
OK
Example: Get track play progress every 1 second
<<
AT+ AVRCPCFG =3
>>
OK
Description: Refer to Chapter 3 for indication format of track information and track state
2.3.5.Track Play/Pause
Format: AT+PLAYPAUSE
Description: Send play or pause command to remote media player according to current
play status
2.3.6.Track Play
Format: AT+PLAY
Description: Send play command to remote media player
2.3.7.Track Pause
Format: AT+PAUSE
Table of contents
Other Feasycom Adapter manuals