BLEDK3 Command Set IS187x BLEDK3 Command Set (v1.15) page 1 BLEDK3 Command Set Contents 1 General description ............................................................................................................ 7 2 MCU interface..................................................................................................................... 7 3 2.1 PIN definition ....................................................................................................... 7 2.2 UART Protocol .................................................................................................... 7 2.3 UART configuration ............................................................................................. 8 2.4 UART data exchange for low power mode .......................................................... 8 2.5 UART flow control ............................................................................................... 9 2.6 UART packet error handle ................................................................................. 10 Command opcode definition ............................................................................................. 11 3.1 Rules of MCU Command Assign ....................................................................... 13 3.2 Common_1 commands ..................................................................................... 14 3.3 3.2.1 Read_Local_Information (0x01)................................................................. 14 3.2.2 Reset (0x02) .............................................................................................. 15 3.2.3 Read_BLEDK3_Status (0x03) ................................................................... 15 3.2.4 Read_ADC_Value (0x04) .......................................................................... 16 3.2.5 Into_Shutdown_Mode (0x05) ..................................................................... 17 3.2.6 Debug_Command (0x06) .......................................................................... 18 3.2.7 Read_Device_Name (0x07) ...................................................................... 19 3.2.8 Write_Device_Name (0x08) ....................................................................... 20 3.2.9 Erase_All_Paired_Device_Information (0x09) ........................................... 21 3.2.10 Read_Pairing_Mode_Setting (0x0A).......................................................... 22 3.2.11 Write_Pairing_Mode_Setting (0x0B) .......................................................... 23 3.2.12 Read_All_Paired_Device_Information (0x0C) ............................................ 24 3.2.13 Delete_Paired_Device (0x0D) ................................................................... 25 3.2.14 DIO_Control (0x0E) ................................................................................... 26 3.2.15 PWM_Control (0x0F) ................................................................................. 28 GAP Commands ............................................................................................... 30 page 2 BLEDK3 Command Set 3.3.1 Read_RSSI_Value (0x10) ..........................................................................30 3.3.2 Write_Adv_Data (0x11) ..............................................................................31 3.3.3 Write_Scan_Res_Data (0x12) ....................................................................32 3.3.4 Set_Advertising_Parameter (0x13).............................................................33 3.3.5 Set_Scan_Parameter (0x15) ......................................................................34 3.3.6 Set_Scan_Enable (0x16) ...........................................................................35 3.3.7 LE_Create_Connection (0x17) ...................................................................36 3.3.8 LE_Create_Connection_Cancel (0x18) ......................................................37 3.3.9 Connection_Parameter_Update_Req (0x19) ..............................................37 3.3.10 Disconnect (0x1B) ......................................................................................38 3.3.11 Invisible_Setting (0x1C) .............................................................................39 3.3.12 Read_Remote_Device_Name (0x1F) .........................................................40 3.4 GATT Client Commands ....................................................................................40 3.4.1 Discover_All_Primary_Services (0x30).......................................................41 3.4.2 Discovre_Specific_Primary_Service_Characteristics (0x31).......................41 3.4.3 Read_Characteristic_Value (0x32) .............................................................42 3.4.4 Read_Using_Characteristic_UUID (0x33) ..................................................42 3.4.5 Write_Characteristic_Value (0x34) .............................................................43 3.4.6 Enable_Transparent (0x35) ........................................................................44 3.5 GATT Server Commands...................................................................................44 3.5.1 Send_Characteristic_Value (0x38) .............................................................44 3.5.2 Update_Characteristic_Value (0x39) ..........................................................45 3.5.3 Read_Local_Characteristic_Value (0x3A) ..................................................46 3.5.4 Read_Local_All_Primary_Service (0x3B) ...................................................46 3.5.5 Read_Local_Specific_Primary_Service (0x3C) ..........................................47 3.5.6 Send_Write_Response (0x3D) ...................................................................47 3.6 GATT Transparent Command ............................................................................48 3.6.1 Send_Transparent_Data (0x3F) .................................................................48 page 3 BLEDK3 Command Set 3.7 Pairing Commands ............................................................................................ 49 3.7.1 Passkey_Entry_Res (0x40) ....................................................................... 49 3.7.2 User_Confirm_Res (0x41) ......................................................................... 51 3.7.3 Pairing_Request (0x42) ............................................................................. 52 3.8 Common_2_Command ..................................................................................... 53 3.8.1 4 Leave_Configure_Mode (0x52) ................................................................. 53 Event OP code definition .................................................................................................. 55 4.1 Pairing Event ..................................................................................................... 55 4.1.1 Passkey_Entry_Req (0x60) ....................................................................... 55 4.1.2 Pairing_Complete (0x61) ........................................................................... 55 4.1.3 Passkey_Confirm_Req (0x62) ................................................................... 56 4.2 GAP Event ........................................................................................................ 56 4.2.1 Advertising_Report (0x70) ......................................................................... 56 4.2.2 LE_Connection_Complete (0x71) .............................................................. 57 4.2.3 Disconnection_Complete (0x72) ................................................................ 59 4.2.4 Connection_Parameter_Update_Notify (0x73) .......................................... 59 4.3 Common Event ................................................................................................. 60 4.3.1 Command_Complete (0x80) ...................................................................... 60 4.3.2 BLEDK3_Status_Report (0x81) ................................................................. 60 4.3.3 Configure_Mode_Status (0x8F) ................................................................. 60 4.4 GATT Client Event ............................................................................................ 61 4.4.1 Discover_All_Primary_Services_Res (0x90) .............................................. 61 4.4.2 Discover_Specific_Primary_Service_Characteristic_Res (0x91) ............... 61 4.4.3 Discover_All_Characteristic_Descriptors_Res (0x92) ................................ 62 4.4.4 Characteristic_Value_Received (0x93) ...................................................... 63 4.5 GATT Server Event ........................................................................................... 64 4.5.1 4.6 Client_Write_Characteristic_Value (0x98) ................................................. 64 GATT Transparent Event .................................................................................. 64 page 4 BLEDK3 Command Set 4.6.1 5 Operation Definition...........................................................................................................65 5.1 Application Pattern Configuration .......................................................................65 5.1.1 Auto Pattern ...............................................................................................65 5.1.2 Manual Pattern ...........................................................................................65 5.2 6 7 Received_Transparent_Data (0x9a) ...........................................................64 Mode..................................................................................................................65 5.2.1 Scanning Mode ..........................................................................................65 5.2.2 Connecting Mode .......................................................................................65 5.2.3 Standby Mode ............................................................................................66 5.2.4 Broadcast Mode .........................................................................................66 5.2.5 Transparent Service Enabled Mode ...........................................................66 5.2.6 Idle Mode ...................................................................................................66 5.2.7 Shutdown Mode .........................................................................................66 5.2.8 Configure Mode..........................................................................................66 5.2.9 BLE Connected Mode ................................................................................67 5.3 Data Pipe ...........................................................................................................67 5.4 BLEDK3 State Indication in Auto Pattern ...........................................................67 State machine charts.........................................................................................................68 6.1 Power on Flow ...................................................................................................68 6.2 Auto Pattern .......................................................................................................69 6.3 Manual Pattern ..................................................................................................70 Message sequence charts.................................................................................................71 7.1 Standby Mode ....................................................................................................71 7.2 LE Connected Mode ..........................................................................................72 7.2.1 Manual Pattern Send Data .........................................................................72 7.2.2 Auto Pattern Send Data .............................................................................73 7.2.3 Manual Pattern Receive Data.....................................................................74 7.2.4 Auto Pattern Receive Data .........................................................................75 page 5 BLEDK3 Command Set 7.3 LE Pairing Method: Passkey Entry .................................................................... 76 7.4 LE Pairing Method: Passkey Confirm ................................................................ 77 8 Listing of command status error code ............................................................................... 78 9 Listing of bledk3 status ..................................................................................................... 79 10 Revision history ................................................................................................................ 79 page 6 BLEDK3 Command Set 1 GENERAL DESCRIPTION BLEDK3 provides UART communication interface with MCU. This document describes how MCU communicates with BLEDK3 and the behavior of BLEDK3. 2 MCU INTERFACE 2.1 PIN definition Name Type UART_TXD BM70 Description Define Output HCI_TXD Input HCI_RXD (Mandatory) UART_RXD (Mandatory) UART_TX_IND Output BLEDK3 inform Host MCU that UART data (Optional) P2_7 will be transmitted out after few us (Setting by UI Tool, default 5ms) UART_RX_IND Input Host MCU inform BLEDK3 that UART (Optional) Configurable data will be transmitted out after few us UART_RTS Output UART Flow Control (Optional) P3_6 High: UART flow stop Low: UART flow Go UART_CTS Input UART Flow Control (Optional) P0_0 High: UART flow stop Low: UART flow Go 2.2 UART Protocol The UART protocol is shown as below diagram HEAD MID DATA CRC START LENGTH OP Code PARAMETER CHKSUM BYTE NO 0 1~2 3 4 ~ XX Length + 3 SIZE (BYTE) 1 2 1 0~ 1 0xAA 1~ Command/Event VALUE SINC WORD Command/Event parameter Check sum Check sum to be calculated TARGET LENGTH page 7 BLEDK3 Command Set Check sum rule: Summation of every byte after START WORD(LENGTH, COM.ID, COM PARAM, CHK SUM) is 0xXX00 e.g. BYTE NO VALUE START LENGTH(H) LENGTH(L) OP CODE PARAMETER CHKSUM 0 1 2 3 4 5 0xAA 0x00 0x02 0x01 0x00 0xFD 2.3 UART configuration Baud Rate Setting: 2400bps~921600bps Flow Control Setting: Enabled/Disabled 2.4 UART data exchange for low power mode Signal of UART_TX_IND and UART_RX_IND are required to guarantee the correction of UART data. UART_RX Start UART_RX End UART_RX_IND Tuart_rx_ind RXD *Tuart_rx_ind: >2ms Fig 2.4.1 Host MCU indicate BLEDK3 UART data diagram page 8 BLEDK3 Command Set UART_TX Start UART_TX End UART_TX_IND TWakeup_External_MCU_Wait_Time UART_TXDUART_ *TWakeup_External_MCU_Wait_Time: The time before UART TXD send (set by UI) Fig 2.4.2 BLEDK3 indicate Host MCU UART data timing diagram 2.5 UART flow control CTS/RTS signal flow control scheme UART flow control scheme can be configured by UI setting If UART_CTS sets flow stop while data transmitting, BLEDK3 will stop transmit. And it won’t transmit more than two bytes after flow stop UART_TX Start Flow Stop Flow Go UART_TX End UART_CTS UART_TXD Fig 2.5.1 Host MCU indicate BLEDK3 UART flow control timing diagram page 9 BLEDK3 Command Set Open Data Session Flow Stop Flow Go Close Data Session UART_RTS UART_RXD Fig 2.5.2 BLEDK3 indicate Host MCU UART flow control timing diagram 2.6 UART packet error handle BLEDK3 will reply Command_Complete with UART_Check_Sum_Error (0xff) status if it receives UART packets with check sum error page 10 BLEDK3 Command Set 3 COMMAND OPCODE DEFINITION Command Type OP code Command Return event Auto Manua patter l n patter n Common_1 0x01 Read_Local_Information Command_Complete 0x02 Reset BLEDK3_Status_Report N/A 0x03 Read_BLEDK3_Status BLEDK3_Status_Report N/A 0x04 Read_ADC_Value Command_Complete N/A 0x05 Into_Shutdown_Mode Command_Complete N/A 0x06 Debug_Command Command_Complete N/A 0x07 Read_Device_Name Command_Complete F 0x08 Write_Device_Name Command_Complete F I Command_Complete F I 0x09 Erase_All_Paired_Device_Info rmation 0x0A Read_Pairing_Mode_Setting Command_Complete F 0x0B Write_Pairing_Mode_Setting Command_Complete F Command_Complete F Delete_Paired_Device Command_Complete F 0x0E DIO_Control Command_Complete N/A 0x0F PWM_Control Command_Complete N/A 0x10 Read_RSSI_Value Command_Complete N/A CM 0x11 Write_Adv_Data Command_Complete F I 0x12 Write_Scan_Res_Data Command_Complete F I 0x13 Set_Advertising_Parameter Command_Complete F I 0x15 Set_Scan_Parameter Command_Complete N/A I 0x16 Set_Scan_Enable N/A I 0x17 LE_Create_Connection N/A I 0x0C 0x0 D GAP F 0x18 0x19 Read_All_Paired_Device_Infor mation LE_Create_Connection_Cance l Connection_Parameter_Upda te_Req Command_Complete I I Advertising_Report LE_Connection_Complet e Command_Complete LE_Connection_Complet N/A e Command_Complete Connection_Parameter_ N/A CM Update_Notify 0x1B Disconnect Disconnection_Complete N/A CM 0x1C Invisible_Setting Command_Complete N/A I 0x1F Read_Remote_Device_Name Command_Complete N/A CM page 11 BLEDK3 Command Set GATT Client 0x30 Discover_All_Primary_Service s Command_Complete N/A CM N/A CM Command_Complete N/A CM Command_Complete N/A CM Discover_All_Primary_Ser vices_Res Command_Complete Discover_Specific_Primar 0x31 Discovre_Specific_Primary_Se y_Service_Characteristic_ rvice_Characteristics Res Discover_All_Characterist ic_Descriptors_Res 0x32 0x33 GATT Server Read_Characteristic_Value Read_Using_Characteristic_U UID 0x34 Write_Characteristic_Value Command_Complete N/A CM 0x35 Enable_Transparent Command_Complete N/A CM 0x38 Send_Characteristic_Value Command_Complete N/A CM 0x39 Update_Characteristic_Value Command_Complete N/A Command_Complete N/A 0x3A 0x3B Read_Local_Characteristic_Va lue Read_Local_All_Primary_Servi ce Command_Complete Discover_All_Primary_Ser N/A vices_Res Command_Complete Discover_Specific_Primar 0x3C Read_Local_Specific_Primary y_Service_Characteristic_ _Service Res N/A Discover_All_Characterist ic_Descriptors_Res GATT Transparen 0x3F Send_Transparent_Data Command_Complete N/A CM 0x40 Passkey_Entry_Res Command_Complete CP CP 0x41 User_Confirm_Res Command_Complete CP CP 0x42 Pairing_Request Command_Complete N/A CM 0x52 Leave_Configure_Mode Command_Complete F N/A t Pairing Common_2 *I: Available in Idle Mode *CP: Available in Connected Mode with Pairing Procedure. *F: Available in Configure Mode *CM: Available in Physical Link Establish or Connected Mode with Manual Pattern page 12 BLEDK3 Command Set 3.1 Rules of MCU Command Assign Most of command request sending by MCU will be replied by Command_Complete event. Another new command request is allowed for MCU by receiving Command_Complete event. BLEDK3 MCU Ready to Receive Command Command Event . . . Event (Command_Complete) Allow New Command There are some exceptions that no Command_Complete event is sent by the BLEDK3 to indicate that this command has been completed. Following are the exception commands: Read_BLEDK3_Status: The BLEDK3_Status_Report event indicates that this command has been completed. LE_Create_Connection: The LE_Connection_Complete event indicates that this connection establishment has been completed. If BLEDK3 can’t achieve the connection establishment, then the LE_Connection_Complete event won’t be sent to MCU. MCU can send LE_Create_Connection_Cancel command to stop the action. Reset: MCU can know that the command has been completed by getting BLEDK3_Status_Report event. Disconnect: The Disconnect_Complete event indicates that this command has been completed. Besides some command request are allowed for MCU without waiting Command_Complete event after last command request was sending. Those commands are listed as below: LE_Create_Connection_Cancel Disconnect Reset page 13 BLEDK3 Command Set 3.2 Common_1 commands Common group commands are used to configure BLEDK3 or control of BLEDK3. BLEDK3 replies Command_Complete event to notify the command process result after dealing with the commands. 3.2.1 Read_Local_Information (0x01) Command Op Code Command Parameters Return Parameters Read_Local_Information 0x01 None Status, Version, BD_ADDR Description: This command is used to read local information of BLEDK3. Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Version: Length: 4 Bytes Value Parameter Description 0xXXXXXXXX Version information of BLEDK3 BD_ADDR: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Bluetooth address of BLEDK3 BLEDK3 MCU Ready to Receive Command Read Local Information Command Complete (status, version, address) Allow New Command [Return to Command Table] page 14 BLEDK3 Command Set 3.2.2 Reset (0x02) Command Op Code Command Parameters Reset 0x02 None Return Parameters Description: This command is used to reset BLEDK3. Command Parameters: None Return Parameters: None BLEDK3 MCU Ready to Receive Command Reset BLEDK3 Status Report (Idle Mode) Allow New Command [Return to Command Table] 3.2.3 Read_BLEDK3_Status (0x03) Command Op Code Command Parameters Read_BLEDK3_Status 0x03 None Return Parameters Description: This command is used to read status of BLEDK3. And the status of BLEDK3 will be informed by “BLEDK3_Status_Report” event. Command Parameters: None Return Parameters: None page 15 BLEDK3 Command Set BLEDK3 MCU Ready to Receive Command Read BLEDK3 Status BLEDK3 Status Report (Status) Allow New Command [Return to Command Table] 3.2.4 Read_ADC_Value (0x04) Command Op Code Command Parameters Return Parameters Read_ADC_Value 0x04 Channel Status, Unit, Value Description: This command is used to read SAR value from BLEDK3. Command Parameters: Channel: Length: 1 Byte Value Parameter Description 0x00 Channel 0 0x01 Channel 1 0x02 Channel 2 0x03 Channel 3 0x04 Channel 4 0x05 Channel 5 0x06 Channel 6 0x07 Channel 7 0x08 Channel 8 0x09 Channel 9 0x0a Channel 10 0x0b Channel 11 0x0c Channel 12 0x0d Channel 13 0x0e Channel 14 page 16 BLEDK3 Command Set 0x0f Channel 15 0x10 Battery voltage 0x11 Temperature value Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Unit: Length: 1 Byte Value Parameter Description 0x00 ADC Value 0x01 0.1V 0x02 0.05V 0x03 0.025V 0x04-0xFF Reserved Value: Length: 2 Byte Value Parameter Description 0xXXXX Voltage [Return to Command Table] 3.2.5 Into_Shutdown_Mode (0x05) Command Op Code Command Parameters Into_Shutdown_Mode 0x05 NONE Return Parameters Description: This command is used to drive BLEDK3 into shutdown mode directly. BLEDK3 will enter into shutdown mode after Command_Complete is replied. This command is valid while BLEDK3 is in Idle Mode only. Command Parameters: None Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 17 BLEDK3 Command Set BLEDK3 MCU Ready to Receive Command Into Power Down Mode Command Complete (status) BLEDKS Status Report (Shutdown Mode) Can Not Receive Command before Wakeup [Return to Command Table] 3.2.6 Debug_Command (0x06) Command Op Code Command Parameters Return Parameters Write_Device_Name 0x06 Debug_Op_Code, Status, Para_1, Para_2,…Para_N Debug_OP_Code, Data Description: This command is used to write device name of BLEDK3. Command Parameters: Debug_Op_Code: Length: 1 Byte Value Parameter Description 0xXX 0x01: Read_Memory 0x02: Write_Memory 0x03: Read_eFlash 0x04: Write_eFlash PARA_1: Length: 1 Byte Value Parameter Description 0xXX Read_Memory: Length of memory read. Write_Memory: Length of memory write. Read_ eFlash: Length of eFlash read. Write_ eFlash: Length of eFlash write. PARA_2: Length: 1 Byte Value Parameter Description 0xXX Read_Memory: High byte address of memory read. page 18 BLEDK3 Command Set Write_Memory: High byte address of memory write. Read_eFlash: High byte address of eFlash read. Write_eFlash: High byte address of eFlash write. PARA_3: Length: 1 Byte Value Parameter Description 0xXX Read_Memory: Low byte address of memory read. Write_Memory: Low byte address of memory write. Read_eFlash: Low byte address of eFlash read. Write_eFlash: Low byte address of eFlash write. PARA_4: Length: 1 Byte Value Parameter Description 0xXX Write_Memory: 1 data of memory write. st st Write_eFlash: 1 data of eFlash write. PARA_N: Length: 1 Byte Value Parameter Description 0xXX Write_Memory: Data of memory write. Write_eFlash: Data of eFlash write. Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Debug_OP_Code: Length: 1 Byte Value Parameter Description 0xXX 0x01: Read_Memory 0x02: Write_Memory 0x03: Read_eFlash 0x04: Write_eFlash Data: Length: N Byte Value Parameter Description 0xXXXX Returned read memory or eFlash data [Return to Command Table] 3.2.7 Read_Device_Name (0x07) Command Op Code Read_Device_Name 0x07 Command Parameters Return Parameters Status, Device_Name Description: This command is used to read device name of BLEDK3. Command Parameters: page 19 BLEDK3 Command Set None Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Device_Name: Length: XX Bytes Value Parameter Description 0xXX Device name of BLEDK3 BLEDK3 MCU Ready to Receive Command Read Device Name Command Complete (status, name) Allow New Command [Return to Command Table] 3.2.8 Write_Device_Name (0x08) Command Op Code Command Parameters Return Parameters Write_Device_Name 0x08 Reserved, Device_Name Status Description: This command is used to write device name of BLEDK3. Command Parameters: RESERVED: Length: 1 Byte Value Parameter Description 0x00 Reserved for future used Device_Name: Length: XX Bytes Value Parameter Description 0xXX Device name of BLEDK3 page 20 BLEDK3 Command Set Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BLEDK3 MCU Idle Mode Ready to Receive Command Write Device Name (store option, name) Command Complete (status) Allow New Command [Return to Command Table] 3.2.9 Erase_All_Paired_Device_Information (0x09) Command Op Code Erase_All_Paired_Device_Inf 0x09 Command Parameters Return Parameters Status ormation Description: This command is used to erase all of the paired device information saved in BLEDK3 and it is valid while BLEDK3 is in Idle Mode or Configure Mode Command Parameters: None Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 21 BLEDK3 Command Set BLEDK3 MCU Idle Mode Ready to Receive Command Erase All Paired Device Information Command Complete (status) Allow New Command [Return to Command Table] 3.2.10 Read_Pairing_Mode_Setting (0x0A) Command Op Code Read_Pairing_Mode_Settin 0x0A Command Parameters Return Parameters Status, IO_Capability g Description: This command is used to read pairing mode setting of BLEDK3. Command Parameters: None Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. IO_Capability: Length: 1 Byte Value Parameter Description 0x00 DisplayOnly 0x01 DisplayYesNo 0x02 KeyboardOnly 0x03 NoInputNoOutput 0x04 KeyboardDisplay page 22 BLEDK3 Command Set BLEDK3 MCU Ready to Receive Command Read Pairing Mode Setting Command Complete (status, IO_Capability) Allow New Command [Return to Command Table] 3.2.11 Write_Pairing_Mode_Setting (0x0B) Command Op Code Command Parameters Return Parameters Write_Pairing_Mode_Settin 0x0B Reserved, IO_Capability Status g Description: This command is used to write pairing mode setting of BLEDK3 and it is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: Reserved: Length: 1 Byte Value Parameter Description 0x00 Reserved for future used IO_Capability: Length: 1 Byte Value Parameter Description 0x00 DisplayOnly 0x01 DisplayYesNo 0x02 KeyboardOnly 0x03 NoInputNoOutput 0x04 KeyboardDisplay Return Parameters: Status: Value Length: 1 Byte Parameter Description page 23 BLEDK3 Command Set 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BLEDK3 MCU Idle Mode Ready to Receive Command Write Pairing Mode Setting (Reserved, IO_Capability) Command Complete (status) Allow New Command [Return to Command Table] 3.2.12 Read_All_Paired_Device_Information (0x0C) Command Op Code Read_All_Paired_Device_Inf 0x0C Command Parameters ormation Return Parameters Status, Num_Of_Paired_Device, Device_List Description: This command is used to read all paired devices information of BLEDK3 and it is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: None Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Num_Of_Paired_Device: Length: 1 Byte Value Parameter Description 0xXX Number of paired devices Device_List: Max to 8 sets Device_Index: Length: 1 Byte page 24 BLEDK3 Command Set Value Parameter Description 0xXX Paired device index Prioroty: Length: 1 Byte Value Parameter Description 0xXX Link priority(0x01: Latest linked device) Device_Address: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Paired device Bluetooth address BLEDK3 MCU Ready to Receive Command Read All Paired Device Information Command Complete (status, number of paired device, device list(index/ priority/ address)) Allow New Command [Return to Command Table] 3.2.13 Delete_Paired_Device (0x0D) Command Op Code Command Parameters Return Parameters Delete_Paired_Device 0x0D Device_Index Status Description: This command is used to delete paired device from BLEDK3 and it is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: Device_Index: Length: 1 Byte Value Parameter Description 0xXX The range of device index is from 0 to 7. Return Parameters: Status: Value Length: 1 Byte Parameter Description page 25 BLEDK3 Command Set 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BEDK3 MCU Idle Mode Ready to Receive Command Delete Paired Device (device index) Command Complete (status) Allow New Command [Return to Command Table] 3.2.14 DIO_Control (0x0E) Command Op Code Command Parameters Return Parameters DIO_Control 0x0E P0_Ctrl_Enable, Status, P1_Ctrl_Enable, P0_Valid_Ctrl_DIO, P2_Ctrl_Enable, P1_Valid_Ctrl_DIO, P3_Ctrl_Enable P2_Valid_Ctrl_DIO, P0OE_Value, P3_Valid_Ctrl_DIO, P1OE_Value, P0_Read_Value, P2OE_Value, P1_Read_Value, P3OE_Value, P2_Read_Value, P0_Output_Value, P3_Read_Value, P1_Output_Value, P2_Output_Value, P3_Output_Value Description: This command is used to control digital IOs of BLEDK3. The controlled DIOs should not be configured as other function used. BLEDK3 would ignore the invalid control on functional DIOs. For example, P2_0 used for system configuration and it cannot be controlled by this command. Or P0_2 is configured as LED display and it also cannot be controlled by this command. Parameter Px_Ctrl_Enable means pins that MCU wants to control. EX: P3_Control_Enable = 0x01 means that MCU want to control P3_0 only. page 26 BLEDK3 Command Set Command Parameters: P0_CTRL_ENABLE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Disable DIO pin control 1: Enable DIO pin control P1_CTRL_ENABLE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Disable DIO pin control 1: Enable DIO pin control P2_CTRL_ENABLE Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Disable DIO pin control 1: Enable DIO pin control P3_CTRL_ENABLE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Disable DIO pin control 1: Enable DIO pin control P0OE_VALUE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Set DIO to be input 1: Set DIO to be output P1OE_VALUE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Set DIO to be input 1: Set DIO to be output P2OE_VALUE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Set DIO to be input 1: Set DIO to be output P3OE_VALUE: Length: 1 Byte Value Parameter Description 0bXXXXXXXX 0: Set DIO to be input 1: Set DIO to be output P0_OUTPUT_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 0 output value. This parameter is available when P0OE set to output enable P1_OUTPUT_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 1 output value. This parameter is available when P1OE set to output enable P2_OUTPUT_VALUE: Length: 1 Byte page 27 BLEDK3 Command Set Value Parameter Description 0xXX Port 2 output value. This parameter is available when P2OE set to output enable P3_OUTPUT_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 3 output value. This parameter is available when P3OE set to output enable Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. P0_VALID_CTRL_DIO: Length: 1 Byte Value Parameter Description 0xXX Port 0 valid control pins value P1_VALID_CTRL_DIO: Length: 1 Byte Value Parameter Description 0xXX Port 1 valid control pins value P2_VALID_CTRL_DIO: Length: 1 Byte Value Parameter Description 0xXX Port 2 valid control pins value P3_VALID_CTRL_DIO: Length: 1 Byte Value Parameter Description 0xXX Port 3 valid control pins value P0_READ_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 0 value P1_READ_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 1 value P2_READ_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 2 value P3_READ_VALUE: Length: 1 Byte Value Parameter Description 0xXX Port 3 value [Return to Command Table] 3.2.15 PWM_Control (0x0F) Command Op Code Command Parameters Return Parameters page 28 BLEDK3 Command Set PWM_Control 0x0F Channel, PWM_Enable, Status Clock_Source, Top_Value, Compare_Value, Output_Inverse Description: This command is used to control PWM of BLEDK3. The minimum Top_value is 0x0001 and the maximum Top_value is 0xFFFF. The Compare_value range is 0x0000 to 0xFFFF and Compare_value must smaller than Top_value. Command Parameters: Channel: Length: 1 Byte Value Parameter Description 0x00 Channel 1 0x01 Channel 2 0x02 Channel 3 0x03 Channel 4 PWM_Enable: Length: 1 Byte Value Parameter Description 0x00 PWM disable 0x01 PWM enable Clock_Source: Length: 1 Byte Value Parameter Description 0x00 32 KHz 0x01 1024 KHz 0x02 16 MHz Top_Value: Length: 2 Byte Value Parameter Description 0xXXXX Top value Compare_Value: Length: 2 Byte Value Parameter Description 0xXXXX Compare value Output_Inverse: Length: 1 Byte Value Parameter Description 0x00 Normal output 0x01 Inverse output Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded page 29 BLEDK3 Command Set 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.3 GAP Commands The GAP group commands are used to manage BLEDK3 Bluetooth connection related capability. For most commands, BLEDK3 replies the Command_Complete event to notify the result of command process. 3.3.1 Read_RSSI_Value (0x10) Command Op Code Command Parameters Return Parameters Read_RSSI_Value 0x10 Connection_Handle Status, RSSI_Value Description: This command is used to read RSSI value for peer connection. This command is valid while Bluetooth link is successfully established between BLEDK3 and remote host. Command Parameters: Connection_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX Connection Handle Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. RSSI_Value: Length: 1 Byte Value Parameter Description 0xXX RSSI Value page 30 BLEDK3 Command Set BLEDK3 MCU Connected Mode Ready to Receive Command Read RSSI Value Command Complete (status, rssi value) Allow New Command [Return to Command Table] 3.3.2 Write_Adv_Data (0x11) Command Op Code Command Parameters Return Parameters Write_Adv_Data 0x11 Store_Option, Advertising_Data Status Description: This command is used to update the advertise data. This command is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: Store_Option: Length: 1 Byte Value Parameter Description 0x00 Advertising Data won’t be stored 0x80 Beacon Data won’t be stored Advertising_Data Length: 1 to 31 Bytes Value Parameter Description 0xXX Advertising Data/Beacon Data Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 31 BLEDK3 Command Set BLEDK3 MCU Idle Mode Ready to Receive Command Write ADV Data (store option, ADV data) Command Complete (status) Allow New Command [Return to Command Table] 3.3.3 Write_Scan_Res_Data (0x12) Command Op Code Command Parameters Return Parameters Write_Scan_Res_Data 0x12 Reserved, Scan_Res_Data Status Description: This command is used to update the Scan_Res data. This command is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: Reserved: Length: 1 Byte Value Parameter Description 0x00 Reserved for future used Scan_Res_Data Length: 1 to 31 Bytes Value Parameter Description 0xXX Scan Response Data Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 32 BLEDK3 Command Set BLEDK3 MCU Idle Mode Ready to Receive Command Write Scan Res Data (store option, scan response data) Command Complete (status) Allow New Command [Return to Command Table] 3.3.4 Set_Advertising_Parameter (0x13) Command Op Code Command Parameters Return Parameters Advertising_Mode_Setting 0x13 Advertising_Interval Status Advertising_Type, Direct_Address_Type, Direct_Address, Description: This command is used to set advertising parameters and it is valid while BLEDK3 is in Idle Mode or Configure Mode. Command Parameters: Advertising_Interval: Length: 2 Bytes Value Parameter Description 0xXXXX Advertising interval for non-directed advertising. Range: 0x0020 to 0x4000 Default: N = 0x0800 (1.28 second) Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec Advertising_Type: Length: 1 Byte Value Parameter Description 0x00 Connectable undirected advertising. It is used to make BLEDK3 into standby mode. 0x01 Connectable directed advertising. It is used to make BLEDK3 into link back mode. page 33 BLEDK3 Command Set 0x02 Scannable undirected advertising. It is used to make BLEDK3 into broadcast mode. And it will reply advertising packet only for the observer passive scanning or active scanning to receive advertising events. 0x03 Non connectable undirected advertising. It is used to make BLEDK3 into broadcast mode. 0x04 Proprietary Beacon Setting Direct_Address_Type: Length: 1 Byte Value Parameter Description 0x00 Public Device Address 0x01 Random Device Address Direct_Address: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Public Device Address or Random Device Address of the device to be connected Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BLEDK3 MCU Idle Mode Ready to Receive Command SetAdvertisingParameter (ADV interval, ADV type, Addr type, Addr) Command Complete (status) Allow New Command [Return to Command Table] 3.3.5 Set_Scan_Parameter (0x15) Command Set_Scan_Parameters Op Code 0x15 Command Parameters Scan_Interval, Scan_Window Scan_Type Return Parameters Status page 34 BLEDK3 Command Set Description: This command is used to set scan parameters, start scanning and whether BLEDK3 shall filter duplicate advertising reports to MCU. It is valid while BLEDK3 is in Idle Mode only. Command Parameters: Scan_Interval Length: 2 Byte Value Parameter Description 0xXXXX This is defined as the time interval from when the Controller started its last BLEDK3 scan until it begins the subsequent BLEDK3 scan. Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms) Time = N * 0.625 msec Time Range: 2.5 msec to 10.24 seconds Scan_Window Length: 2 Byte Value Parameter Description 0xXXXX The duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms) Time = N * 0.625 msec Time Range: 2.5 msec to 10240 msec Scan_Type Length: 1 Byte Value Parameter Description 0x00 Passive Scanning. No SCAN_REQ packets shall be sent. (default) 0x01 Active scanning. SCAN_REQ packets may be sent. Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.3.6 Set_Scan_Enable (0x16) Command Op Code Command Parameters Return Parameters Discover_Peripheral 0x16 Scan_Enable, Filter_Duplicates Status Description: This command is used to cancel discover peripheral and it is valid while BLEDK3 is in Idle Mode only. Command Parameters: page 35 BLEDK3 Command Set Scan_Enable: Length: 1 Byte Value Parameter Description 0x00 Scanning disabled 0x01 Scanning enabled Filter_Duplicate: Length: 1 Byte Value Parameter Description 0x00 Duplicate filtering disabled. 0x01 Duplicate filtering enabled. Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.3.7 LE_Create_Connection (0x17) Command Op Code Command Parameters Create_Connection 0x17 Filter_Policy, Peer_Address_Type, Return Parameters Peer_Address, Description: This command is used to create a connection to a connectable advertiser and it is valid while BLEDK3 is in Idle Mode only. Command Parameters: Filter_Policy: Length: 1 Byte Value Parameter Description 0x00 White list is not used to determine which advertiser to connect to. Peer_Address_Type and Peer_Address shall be used. 0x01 White list is used to determine which advertiser to connect to. Peer_Address_Type and Peer_Address shall be ignored. Peer_Address_Type: Length: 1 Byte Value Parameter Description 0x00 Public Device Address 0x01 Random Device Address Peer_Address: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Public Device Address or Random Device Address of the device to be connected Return Parameters: None page 36 BLEDK3 Command Set Note: No Command_Complete event is sent by the BLEDK3 to indicate that this command has been completed. Instead, the LE_Connection_Complete event indicates that this command has been completed. [Return to Command Table] 3.3.8 LE_Create_Connection_Cancel (0x18) Command Op Code Command Parameters Return Parameters LE_Create_Connection_Can 0x18 NONE Status cel Description: This command is used to cancel the LE_Create_Connection command. This command shall only be issued after the LE_Create_Connection command has been issued (Under Connecting Mode). Command Parameters: None Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.3.9 Connection_Parameter_Update_Req (0x19) Command Op Code Command Parameters Return Parameters Connection_Parameter_Up 0x19 Connection_Handle Status date_Req Conn_Interval, Conn_Latency, Supervision_Timeout Description: This command is used to change connection parameters of a connection. This command is valid while Bluetooth link is successfully established between BLEDK3 and remote host. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Conn_Interval: Length: 2 Bytes Value Parameter Description 0xXXXX Minimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max. page 37 BLEDK3 Command Set Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. Conn_Latency: Length: 2 Bytes Value Parameter Description 0xXXXX Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F4 Supervision_Timeout: Length: 2 Bytes Value Parameter Description 0xXXXX Supervision timeout for the LE Link Range: 0x000A to 0x0C80 Time = N * 10 msec Time Range: 100 msec to 32 seconds Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.3.10 Disconnect (0x1B) Command Op Code Command Parameters Disconnect 0x1B Reserved Return Parameters Description: This command is used to terminate a connection. This command is valid while Bluetooth link is successfully established between BLEDK3 and remote host. Command Parameters: Reserved: Length: 1 Byte Value Parameter Description 0x00 Always set this byte to 0 Return Parameters: None Note: No Command_Complete event is sent by the BLEDK3 to indicate that this command has been completed. Instead, the Disconnection_Complete event indicates that this command has been completed. page 38 BLEDK3 Command Set BLEDK3 MCU Connected Mode Ready to Receive Command Disconnect Disconnection Complete (connection handle, reason) BM70 Status Report (Idle) Allow New Command [Return to Command Table] 3.3.11 Invisible_Setting (0x1C) Command Op Code Command Parameters Return Parameters Invisible_Setting 0x1C Mode Status Description: This command is used to configure invisible setting of BLEDK3 and it is valid while BLEDK3 is in Idle Mode only. Command Parameters: Mode: Length: 1 Byte Value Parameter Description 0x00 Leave Standby Mode 0x01 Enter Standby Mode 0x02 Enter Standby Mode and only connectable for trust device 0x81 Enter Standby Mode with Beacon Enabled 0x82 Enter Standby Mode with Beacon Enabled and only connectable for trust device Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 39 BLEDK3 Command Set BLEDK3 MCU BLEDK3 MCU Idle Mode Standby Mode Ready to Receive Command Ready to Receive Command Invisible Setting (enter standby mode) Invisible Setting (Leave standby mode) Command Complete (status) Command Complete (status) BM70 Status Report (Standby Mode) BM77 Status Report (Idle Mode) Allow New Command Allow New Command [Return to Command Table] 3.3.12 Read_Remote_Device_Name (0x1F) Command Op Code Command Parameters Return Parameters Read_Remote_Device_Nam 0x1F Connection_Handle Status, Device_Name e Description: This command is used to read remote device name. This command is valid while Bluetooth link is successfully established between BLEDK3 and remote host. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Device_Name: Length: XX Bytes Value Parameter Description 0xXX Remote Device Name [Return to Command Table] 3.4 GATT Client Commands GATT client group commands are used for GATT client procedure page 40 BLEDK3 Command Set 3.4.1 Discover_All_Primary_Services (0x30) Command Op Code Command Parameters Return Parameters Discover_All_Primary_Servic 0x30 Connection_Handle Status es Description: This command is used to discovery all primary services on a server. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.4.2 Discovre_Specific_Primary_Service_Characteristics (0x31) Command Op Code Command Parameters Return Parameters Discover_Specific_Primary_ 0x31 Connection_Handle, Status Service_Characteristics Service_UUID Description: This command is used to find all the characteristic declarations and characteristic descriptor’s Attribute handles and Attribute Types within a service definition on a server when only the service handle range is known. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Service_UUID: Length: 2 or 16 Bytes Value Parameter Description 0xXX 16-bit Bluetooth UUID or 128-bit UUID Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 41 BLEDK3 Command Set [Return to Command Table] 3.4.3 Read_Characteristic_Value (0x32) Command Op Code Command Parameters Return Parameters Read_Characteristic_Value 0x32 Connection_Handle, Status, Characteristic_Value_Handle Characteristic_Value Description: This command is used to read a Characteristic Value from a server. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Characteristic_Value_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX Characteristic Value Handle Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Characteristic_Value: Length: 1 to 20 Bytes Value Parameter Description 0xXX Characteristic Value [Return to Command Table] 3.4.4 Read_Using_Characteristic_UUID (0x33) Command Op Code Command Parameters Return Parameters Read_Using_Characteristic 0x33 Connection_Handle, Status, Characteristic_UUID Characteristic_Value_Ha _UUID ndle, Characteristic_Value Description: This command is used to read a Characteristic Value from a server when the client only knows the characteristic UUID and does not know the handle of the characteristic. Command Parameters: Connection_Handle: Value Length: 1 Byte Parameter Description page 42 BLEDK3 Command Set 0xXX Connection Handle Characteristic_UUID: Length: 2 or16 Bytes Value Parameter Description 0xXXXX.. Characteristic UUID Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Characteristic_Value_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX Characteristic Value Handle Characteristic_Value: Length: 1 to 20 Bytes Value Parameter Description 0xXX Characteristic Value [Return to Command Table] 3.4.5 Write_Characteristic_Value (0x34) Command Op Code Command Parameters Return Parameters Write_Characteristic_Value 0x34 Connection_Handle, Status Write_Type, Characteristic_Value_Handle, Characteristic_Value Description: This command is used to write a Characteristic Value to a server. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Write_Type: Length: 1 Byte Value Parameter Description 0x00 With Response 0x01 Without Response Characteristic_Value_Handle: Value Parameter Description 0xXXXX Characteristic Value Handle Characteristic_Value: Length: 2 Bytes Length: 1 to 20 Bytes page 43 BLEDK3 Command Set Value Parameter Description 0xXX Characteristic Value Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.4.6 Enable_Transparent (0x35) Command Op Code Command Parameters Return Parameters Enable_Transparent 0x35 Connection_Handle, Status Server_Transparent_Ctrl, Client_Transparent_Mode Description: This command is used to enable ISSC_TRANS_TX service of BLEDK3. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Server_Transparent_Ctrl: Length: 1 Byte Value Parameter Description 0x00 Disable transparent data transmit of server. (Default) 0x01 Enable transparent data transmit of server. Client_Transparent_Mode: Length: 1 Byte Value Parameter Description 0x00 Client send transparent data by Write_Req. (Default) 0x01 Client send transparent data by Write_Cmd. Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.5 GATT Server Commands 3.5.1 Send_Characteristic_Value (0x38) Command Op Code Command Parameters Return Parameters page 44 BLEDK3 Command Set Send_Characteristic_Value 0x38 Conn_Handle, Status Characteristic_Value_Handle, Characteristic_Value Description: This command is used to send characteristic value to GATT client. Command Parameters: Conn_Handle: Length: 1 Bytes Value Parameter Description 0xXX Connection Handle Characteristic_Value_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX Characteristic Value Handle Characteristic_Value: Length: 1 to 20 Bytes Value Parameter Description 0xXX Characteristic Value Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.5.2 Update_Characteristic_Value (0x39) Command Op Code Command Parameters Return Parameters Update_Characteristic_Valu 0x39 Characteristic_Value_Handle, Status e Characteristic_Value Description: This command is used to update existing characteristic value of BLEDK3. Command Parameters: Characteristic_Value_Handle: Value Parameter Description 0xXXXX characteristic value handle Characteristic_Value: Length: 2 Bytes Length: 1 to 20 Bytes Value Parameter Description 0xXX characteristic value Return Parameters: Status: Length: 1 Byte page 45 BLEDK3 Command Set Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.5.3 Read_Local_Characteristic_Value (0x3A) Command Op Code Command Parameters Return Parameters Read_Local_Characteristic_ 0x3A Characteristic_Value_Handle Status, Value Characteristic_Value Description: This command is used to read existing characteristic value of BLEDK3. Command Parameters: Characteristic_Value_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX characteristic value handle Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. Characteristic_Value: Length: XX Bytes Value Parameter Description 0xXX characteristic value [Return to Command Table] 3.5.4 Read_Local_All_Primary_Service (0x3B) Command Op Code Read_Local_All_Primary_Ser 0x3B Command Parameters Return Parameters Status vice Description: This command is used to read all primary service of BLEDK3. Command Parameters: None Return Parameters: Status: Length: 1 Byte page 46 BLEDK3 Command Set Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.5.5 Read_Local_Specific_Primary_Service (0x3C) Command Op Code Command Parameters Return Parameters Read_Local_Specific_Primar 0x3C Service_UUID Status y_Service Description: This command is used to read specific primary service of BLEDK3. Command Parameters: Service_UUID: Length: 2 or 16 Bytes Value Parameter Description 0xXX 16-bit Bluetooth UUID or 128-bit UUID Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.5.6 Send_Write_Response (0x3D) Command Op Code Command Parameters Return Parameters Send_Write_Response 0x3D Connection_Handle, Status Request_Opcode, Attribute_Handle, Error_Code Description: This command is used to manually respond write request to the GATT client. BLEDK3 will send “Write Response” with error code 0x00. Otherwise, “Error Response” with corresponding error code is sent. This command should only be sent after receiving write request and the manually sending “Write Response” option is on. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Request_Opcode: Length: 1 Byte page 47 BLEDK3 Command Set Value Parameter Description 0x12 Write Request. The opcode of the request to respond. Attribute_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX The handle of the attribute which the request perform Error_Code: Length: 1 Byte Value Parameter Description 0x00 No error. Send Write Response 0x01 Invalid Handle 0x02 Read Not Permitted 0x03 Write Not Permitted 0x04 Invalid PDU 0x05 Insufficient Authentication 0x06 Request Not Supported 0x07 Invalid Offset 0x08 Insufficient Authorization 0x09 Prepare Queue Full 0x0A Attribute Not Found 0x0B Attribute Not Long 0x0C Insufficient Encryption Key Size 0x0D Invalid Attribute Value Length 0x0E Unlikely Error 0x0F Insufficient Encryption 0x10 Unsupported Group Type 0x11 Insufficient Resources 0x12 – 0x7F Reserved 0x80 – 0x9F Application defined errors 0xA0 – 0xDF Reserved 0xE0 – 0xFF Common Profile and Service Error Codes Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.6 GATT Transparent Command 3.6.1 Send_Transparent_Data (0x3F) Command Op Code Command Parameters Return Parameters Send_Transparent_Data 0x3F Connection_Handle, Status Transparent_Data page 48 BLEDK3 Command Set Description: This command is used to send transparent data by ISSC_TRANS_TX service. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0x00 Connection Handle Transparent_Data: Length: N Bytes Value Parameter Description 0xXX Transparent_Data. Maximum length of transparent data is 640 bytes Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BLEDK3 MCU Connected Mode Ready to Receive Command Send Transparent Data (data) Command Complete (status) Send Transparent Data (data) Command Complete (status) Received Transparent data (data) Allow New Command [Return to Command Table] 3.7 Pairing Commands 3.7.1 Passkey_Entry_Res (0x40) Command Op Code Command Parameters Return Parameters Passkey_Entry_Res 0x40 Connection_Handle Status Notification_Type, Entered_Passkey page 49 BLEDK3 Command Set Description: This command is used to response passkey entry request from BLEDK3. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Notification_Type: Length: 1 Byte Value Parameter Description 0x01 Passkey digit entered 0x02 Passkey digit erased 0x03 Passkey cleared 0x04 Passkey entry completed Entered_Passkey: Length: 1 Byte Value Parameter Description 0xXX Entered Digital Passkey character. It is valid only while the Notification_type is 0x01. 0x30~0x39: "0" ~"9" Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 50 BLEDK3 Command Set BLEDK3 MCU Standby Mode Ready to Receive Command LE Connection Complete (connection handle, address) Passkey Entry Req Repeat 6 times Passkey Entry Res (Passkey digit entered) Passkey Entry Res (Passkey entry completed) Pairing Complete BLEDK3 Status Report (LE connected) Allow New Command [Return to Command Table] 3.7.2 User_Confirm_Res (0x41) Command Op Code Command Parameters Return Parameters User_Confirm_Res 0x41 Connection_Handle Status option Description: This command is used to response passkey entry request from BLEDK3. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Notification_Type: Length: 1 Byte Value Parameter Description 0x00 Entered information is Yes page 51 BLEDK3 Command Set 0x01 Entered information is No Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. BLEDK3 MCU Standby Mode Ready to Receive Command LE Connection Complete (connection handle, role, address type, address, connection interval, latency, supervision timeout) Passkey Display Yes/No Req(Passkey) User Conform Res (Yes) Pairing Complete BLEDK3 Status Report (LE connected) Allow New Command [Return to Command Table] 3.7.3 Pairing_Request (0x42) Command Op Code Command Parameters Return Parameters Pairing_Request 0x42 Connection_Handle Status Description: This command is used to initiate pairing procedure. Command Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Return Parameters: page 52 BLEDK3 Command Set Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. [Return to Command Table] 3.8 Common_2_Command MCU sends the Common Command to BLEDK3 for specific purpose. BLEDK3 will reply the Command Complete event to notify the command process result. 3.8.1 Leave_Configure_Mode (0x52) Command Op Code Command Parameters Return Parameters Leave_Configure_Mode 0x52 Option Status Description: BLEDK3 will leave configure mode if “Leave_Configure_Mode” command is received. Command Parameters: Option: Length: 1 Byte Value Parameter Description 0x00 None 0x01 Disable configure mode forever Return Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Command succeeded 0x01 – 0xFF Command failed. See listing of Error Codes. page 53 BLEDK3 Command Set BLEDK3 MCU Power On Mode Configure Mode Status (Configure Mode is Enable) Configure Mode Timeout Ready to Receive Command Any Valid Command Configure Mode (Disable Timeout) . . . Leave Configure Mode Configure Mode Status (Configure Mode is Disable) Auto Pattern (No more Command) [Return to Command Table] page 54 BLEDK3 Command Set 4 EVENT OP CODE DEFINITION Event Type OP code Event Pairing 0x60 Passkey_Entry_Req 0x61 Pairing_Complete 0x62 Passkey_Confirm_Req 0x70 Advertising_Report 0x71 LE_Connection_Complete 0x72 Disconnection_Complete 0x73 Connection_Parameter_Update_Notify 0x80 Command_Complete 0x81 BLEDK3_Status_Report 0x8F Configure_Mode_Status 0x90 Discover_All_Primary_Services_Res 0x91 Discover_Specific_Primary_Service_Characteristic_Res 0x92 Discover_All_Characteristic_Descriptors_Res 0x93 Characteristic_Value_Received 0x98 Client_Write_Characteristic_Value GAP Common GATT Client GATT Server GATT Transparent Received_Transparent_Data 0x9A 4.1 Pairing Event 4.1.1 Passkey_Entry_Req (0x60) Event OpCode Event Parameters Passkey_Entry_Req 0x60 Connection_Handle Description: This event is used to inform MCU that BLEDK3 has received Passkey Request. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection_Handle to be used to identify a connection between two Bluetooth devices [Return to Event Table] 4.1.2 Pairing_Complete (0x61) Event OpCode Event Parameters Pairing_Complete 0x61 Connection_Handle Result Description: This event is used to inform MCU that BLEDK3 pairing process has been finished. page 55 BLEDK3 Command Set Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection_Handle to be used to identify a connection between two Bluetooth devices Result: Length: 1 Byte Value Parameter Description 0x00 Pairing Complete 0x01 Pairing Fail 0x02 Pairing Timeout [Return to Event Table] 4.1.3 Passkey_Confirm_Req (0x62) Event OpCode Event Parameters Passkey_Confirm_Req 0x62 Connection_Handle Displayed_Passkey Description: This event is used to inform MCU that BLEDK3 has received user confirm request. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection_Handle to be used to identify a connection between two Bluetooth devices Displayed_Passkey: Length: 1 Byte Value Parameter Description 0xXX Numeric for MCU to display [Return to Event Table] 4.2 GAP Event 4.2.1 Advertising_Report (0x70) Event OpCode Event Parameters Advertising_Report 0x70 Event_Type, Address_Type, Address, Length, Data, RSSI Description: This event indicates that a Bluetooth device or multiple Bluetooth devices have responded to page 56 BLEDK3 Command Set an active Scan or received some information during a passive scan. Event Parameters: Event_Type: Length: 1 Byte Value Parameter Description 0x00 Connectable undirected advertising (ADV_IND). 0x01 Connectable directed advertising (ADV_DIRECT_IND) 0x02 Scannable undirected advertising (ADV_SCAN_IND) 0x03 Non connectable undirected advertising (ADV_NONCONN_IND) 0x04 Scan Response (SCAN_RSP) Address_Type: Length: 1 Byte Value Parameter Description 0x00 Public Device Address 0x01 Random Device Address Address: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Public Device Address or Random Device Address for each device which responded. Length_Data: Length: 1 Byte Value Parameter Description 0x00~0x1F Length of the Data[i] field for each device which responded Data: Length: Length_Data[i] Bytes Value Parameter Description 0x00~0x1F Length_Data[i] octets of advertising or scan response data RSSI: Length: 1 Byte Value Parameter Description N Size: 1 Octet (signed integer) Range: -127 ≤ N ≤ +20 Units: dBm 127 RSSI is not available [Return to Event Table] 4.2.2 LE_Connection_Complete (0x71) Event OpCode Event Parameters LE_Connection _Complete 0x71 Status, Connection_Handle, Role, Peer_Address_Type, Peer_Address, Conn_Interval, Conn_Latency, Supervision_Timeout, Description: This event is used to inform MCU that a LE connection has been created. Event Parameters: page 57 BLEDK3 Command Set Status: Length: 1 Byte Value Parameter Description 0x00 Connection successfully completed. 0x01~0xff Connection failed to complete. Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection_Handle to be used to identify a connection between two Bluetooth devices Role: Length: 1 Byte Value Parameter Description 0x00 Connection is master 0x01 Connection is slave Peer_Address_Type: Length: 1 Byte Value Parameter Description 0x00 Peer is using a Public Device Address 0x01 Peer is using a Random Device Address 0x02 Peer is paired device Peer_Address: Length: 6 Bytes Value Parameter Description 0xXXXXXXXXXXXX Public Device Address or Random Device Address of the peer device Conn_Interval: Length: 2 Bytes Value Parameter Description 0xXXXX Connection interval used on this connection. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4000 msec. Conn_Latency: Length: 2 Bytes Value Parameter Description 0xXXXX Connection latency for this connection. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4000 msec. SuperVision_Timeout: Length: 2 Bytes Value Parameter Description 0xXXXX Connection supervision timeout. Range: 0x000A to 0x0C80 Time = N * 10 msec Time Range: 100 msec to 32 seconds [Return to Event Table] page 58 BLEDK3 Command Set 4.2.3 Disconnection_Complete (0x72) Event OpCode Event Parameters Disonnection_Complete 0x72 Connection_Handle, Reason Description: This event is used to inform that the connection has been terminated. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection_Handle to be used to identify a connection between two Bluetooth devices Reason: Length: 1 Byte Value Parameter Description 0xXX Disconnection reason. See listing of Error Codes. [Return to Event Table] 4.2.4 Connection_Parameter_Update_Notify (0x73) Event OpCode Event Parameters Connection_Parameter_Upd 0x73 Connection_Handle, Conn_Interval, Conn_Latency, ate_Notify Suprevision_Timeou Description: This event is used to inform that the connection parameter has been updated. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Conn_Interval: Length: 2 Byte Value Parameter Description 0xXXXX Minimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. Conn_Latency: Length: 2 Bytes Value Parameter Description 0xXXXX Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F4 Supervision_Timeout: Value Length: 2 Bytes Parameter Description page 59 BLEDK3 Command Set 0xXXXX Supervision timeout for the LE Link Range: 0x000A to 0x0C80 Time = N * 10 msec Time Range: 100 msec to 32 seconds [Return to Event Table] 4.3 Common Event 4.3.1 Command_Complete (0x80) Event OpCode Event Parameters Command_Complete 0x80 Command_OpCode, Return_Parameters Description: This event is used to response of commands. Event Parameters: Command_OpCode: Length: 1 Byte Value Parameter Description 0xXX Opcode of the command which caused this event. Return_Parameters Length: Depends on Command Value Parameter Description 0xXX Opcode of the command which caused this event. [Return to Event Table] 4.3.2 BLEDK3_Status_Report (0x81) Event OpCode Event Parameters BLEDK3_Status_Report 0x81 Status Description: This event is used to inform MCU status of BLEDK3 while status is changed and response of “Read_BLEDK3_Status” command. Event Parameters: Status: Length: 1 Byte Value Parameter Description 0xXX See listing of BLEDK3 Status. [Return to Event Table] 4.3.3 Configure_Mode_Status (0x8F) Event OpCode Event Parameters Configure_Mode_Status 0x8f Status Description: This event is used to inform MCU Configure Mode status of BLEDK3. page 60 BLEDK3 Command Set Event Parameters: Status: Length: 1 Byte Value Parameter Description 0x00 Configure Mode is Disabled. 0x01 Configure Mode is Enabled [Return to Event Table] 4.4 GATT Client Event 4.4.1 Discover_All_Primary_Services_Res (0x90) Event OpCode Event Parameters Discover_All_Primary_Servic 0x90 Connection_Handle, Length, Attribute_Data es_Res Description: This event is used to response of “Discover_All_Primary_Services” command. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Length: Length: 1 Byte Value Parameter Description 0xXX The size of each attribute data Attribute_Data: Length: 6 to 20 Bytes The Attribute Data field is comprised of a list of attribute data. Start Group Handle End Group Handle Service UUID 2 Bytes (Length -4) Bytes 2 Bytes [Return to Event Table] 4.4.2 Discover_Specific_Primary_Service_Characteristic_Res (0x91) Event OpCode Event Parameters Discover_Specific_Primary_S 0x91 Connection_Handle, Length, Attribute_Data ervice_Characteristics_Res Description: This event is used to response of “Discover_Specific_Primary_Service_Characteristics” command. Event Parameters: Connection_Handle: Length: 1 Byte page 61 BLEDK3 Command Set Value Parameter Description 0xXX Connection Handle Length: Length: 1 Byte Value Parameter Description 0xXX The size of each attribute handle-value pair Attribute_Data: Length: 2 to 18 Bytes The Attribute Data field is comprised of a list of attribute handle and value pairs for characteristic declaration. Attribute Handle Attribute Value 2 Bytes (Length -2) Bytes Attribute Value of Characteristic Declaration: Attribute Value Characteristic Characteristic Value Characteristic UUID Properties Attribute Handle (2 or 16 Bytes) (1 Byte) (2 Bytes) Properties Value Broadcast 0x01 Read 0x02 Write Without Response 0x04 Write 0x08 Notify 0x10 Indicate 0x20 Authenticated Signed Writes 0x40 Extended Properties 0x80 [Return to Event Table] 4.4.3 Discover_All_Characteristic_Descriptors_Res (0x92) Event OpCode Event Parameters Discover_All_Characteristic_ 0x92 Connection_Handle, Format, Information_Data Descriptors_Res Description: This event is used to response of “Discover_All_Characteristic_Descriptors” command. Event Parameters: Connection_Handle: Length: 1 Byte page 62 BLEDK3 Command Set Value Parameter Description 0xXX Connection Handle Format: Length: 1 Byte Value Parameter Description 0x01 A list of 1 or more handles with their 16-bit Bluetooth UUIDs 0x02 A list of 1 or more handles with their 128-bit UUIDs Information_Data: Length: 4 to 20 Bytes The information data is comprised of a list of data defined in the tables below depending on the value chosen for the format. Handle 16-bit Bluetooth UUID 2 Bytes 2 Bytes Format 0x01-handle and 16-bit Bluetooth UUIDs Handle 128-bit Bluetooth UUID 2 Octets 16 Octets Format 0x02-handle and 128-bit UUIDs [Return to Event Table] 4.4.4 Characteristic_Value_Received (0x93) Event OpCode Event Parameters Characteristic_Value_Receiv 0x93 Connection_Handle, Characteristic_Value_Handle, ed Characteristic_Value Description: This event is used to inform MCU that BLEDK3 has received a characteristic value Notification or indication from GATT Server. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Characteristic_Value_Handle: Value Parameter Description 0xXXXX Characteristic Value Handle Characteristic_Value: Length: 2 Byte Length: 1 to 20 Bytes Value Parameter Description 0xXX Characteristic Value [Return to Event Table] page 63 BLEDK3 Command Set 4.5 GATT Server Event 4.5.1 Client_Write_Characteristic_Value (0x98) Event OpCode Event Parameters Client_Write_Characteristic_ 0x98 Connection_Handle, Characteristic_Value_Handle, Value Characteristic_Value Description: This event is used to inform MCU that GATT Client has written a Characteristic Value to BLEDK3 Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Characteristic_Value_Handle: Length: 2 Bytes Value Parameter Description 0xXXXX Characteristic Value Handle Characteristic_Value: Length: 1 to 20 Bytes Value Parameter Description 0xXX Characteristic Value [Return to Event Table] 4.6 GATT Transparent Event 4.6.1 Received_Transparent_Data (0x9a) Event OpCode Event Parameters Received_Transparent_Data 0x9a Connection_Handle, Transparent_Data Description: This event is used to inform MCU that BLEDK3 has received transparent data by ISSC_TRANS_RX service. Event Parameters: Connection_Handle: Length: 1 Byte Value Parameter Description 0xXX Connection Handle Transparent_Data: Length: n Bytes Value Parameter Description 0xXX Transparent data [Return to Event Table] page 64 BLEDK3 Command Set 5 OPERATION DEFINITION 5.1 Application Pattern Configuration Power ON Auto_Pattern_Set ting Enabled Disabled Configure Mode Auto Pattern Manual Pattern 5.1.1 Auto Pattern BLEDK3 will be executed base on internal state machine that can be configured by UI tool. BLEDK3 may into “Configure Mode” by UI tool setting and MCU command assigned. Some commands are available at “Configure Mode” and “Connected Mode with pairing procedure” only. The data pipe is “Transparent Pipe”. 5.1.2 Manual Pattern BLEDK3 will be executed base on MCU command totally. MCU must handle BLEDK3 state by correct commands. The data pipe is “Protocol Pipe”. 5.2 Mode 5.2.1 Scanning Mode BLEDK3 tries to find advertising devices in the area. BLEDK3 would receive advertising packets from peer device and report these to MCU. 5.2.2 Connecting Mode BLEDK3 tries to initiate a connection to an advertiser page 65 BLEDK3 Command Set 5.2.3 Standby Mode BLEDK3 is under Bluetooth discoverable and connectable mode. BLEDK3 enables the Undirected Advertising. It can also be paired by another device in this mode. 5.2.4 Broadcast Mode BLEDK3 is under Bluetooth discoverable mode. And BLEDK3 has no connection capacity in this mode. 5.2.5 Transparent Service Enabled Mode Bluetooth connection is established successfully, and GATT data session is opened. 5.2.6 Idle Mode There’s no any activity of BLEDK3 until MCU assign the new command. And Idle mode is only available in Manual Pattern. 5.2.7 Shutdown Mode BLEDK3 enters into shutdown mode situation. Auto Pattern: BLEDK3 Enter into shutdown mode automatically Wakeup Trigger: Wakeup pin or UART_RX_IND pin Manual Pattern: BLEDK3 Enter into shutdown mode by MCU command assign Wakeup Trigger: Wakeup pin or UART_RX_IND pin 5.2.8 Configure Mode It is used to configure relative setting before BLEDK3 enter into Auto Pattern page 66 BLEDK3 Command Set BLEDK3 MCU Power On Mode Configure Mode Status (Configure Mode is Enable) Configure Mode Timeout Ready to Receive Command Any Valid Command Configure Mode (Disable Timeout) . . . Leave Configure Mode Configure Mode Status (Configure Mode is Disable) Auto Pattern (No more Command) 5.2.9 BLE Connected Mode Bluetooth connection is established successfully and GATT data session is not been enabled. 5.3 Data Pipe Transparent Pipe: The exchange data between MCU and APP will be transferred directly. Protocol Pipe: MCU to APP: MCU use “Send_Transparent_Data” command to send data. APP to MCU: BLEDK3 use “Recieved _Transparent_Data” event to inform MCU. 5.4 BLEDK3 State Indication in Auto Pattern BLEDK3 status in Auto Pattern is composed of STATUS1_IND and STATUS2_IND. To get whole status information, both STATUS1_IND and STATUS2_IND should be assigned in configurable GPIOs by UI tool. Below table shows the definition of BLEDK3 status. STATUS1_IND / Status Description STATUS2_IND H/H Shutdown Mode BLEDK3 is shutdown H/L Standby Mode BLEDK3 sends advertising packets and wait for connection. BLEDK3 is under discoverable and connectable. page 67 BLEDK3 Command Set L/L BLE Connected Mode BLE link is established and CCCD of ISSC_Transparent_TX characteristic is disabled L/H Transparent Service Enabled Mode BLE link is established and CCCD of ISSC_Transparent_TX characteristic is enabled 6 STATE MACHINE CHARTS 6.1 Power on Flow Power Off Shutdown Mode Wakeup trigger Power on trigger Power On Power on procedure Auto_Pattern _Setting=1 No Manual Pattern Yes Idle Mode Configure_TO Yes Configure Mode: Specific Command Handle No Leave Configure Mode New Auto Pattern page 68 BLEDK3 Command Set 6.2 Auto Pattern Power On Standby State Standby Mode: Discoverable & Connectable mode Pairing_K ey 4 1 N Power-on & Normal Standby Time out Setting N Remote Disconnect Standby Time out Setting Y 3 Y Standby_TO N Connection Be-Paired Y N Pairing Enable Pairing Process Pairing OK Link State N BLE Connected: Pairing OK Pairing fail 1 Link Lost Disconnected Remote Drop 1 Host MCU Drop Shutdown State 3 Shutdown Mode: 4 Wakeup Power off Power off Configurable by Manufacture setting Mode page 69 BLEDK3 Command Set 6.3 Manual Pattern Manual Pattern Idle Mode Set_Advertising _Enable (Disable) Set_Advertising _Enable (NonConnectabl e) Set_Advertising _Enable (Connectable) Broadcast Mode Standby Mode Set_Advertising _Enable (Disable) Set_Scan _Enable (Enable) Set_Scan _Enable (Disable) Scanning Mode Create _Connection Create _connection _Cancel Connecting Mode Connected Pairing Enabled N Connected Y Pairing Process Pairing OK BLE Connected Pairing Fail Disconnected Idle Mode Into_Shutdown_M ode Shutdown Mode Wakeup Trigger Idle Mode Power off Power Off page 70 BLEDK3 Command Set 7 MESSAGE SEQUENCE CHARTS 7.1 Standby Mode Mobile Phone BLEDK3 MCU Power On Manu Pattern: Enter Standby Mode with BR/EDR/BLE Idle Mode Invisible_Setting(En) Standby Mode Invisible_Setting(Dis) Idle Mode page 71 BLEDK3 Command Set 7.2 LE Connected Mode 7.2.1 Manual Pattern Send Data Mobile Phone BLEDK3 MCU Connected Mode Manu Pattern: Send Data (Protocol Pipe) Data Session Opened AA 00 05 3A 31 32 33 34 35 C2 31 32 33 34 35 Send Transparent Data Command Complete page 72 BLEDK3 Command Set 7.2.2 Auto Pattern Send Data Mobile Phone BLEDK3 MCU Connected Mode Auto Pattern: Send Data (Transparent Pipe) Data Session Opened 31 32 33 34 35 31 32 33 34 35 page 73 BLEDK3 Command Set 7.2.3 Manual Pattern Receive Data Mobile Phone BLEDK3 MCU Connected Mode Manual Pattern: Receive Data (Protocol Pipe) Data Session Opened AA 00 05 9A 31 32 33 34 35 62 Received Transparent Data 31 32 33 34 35 page 74 BLEDK3 Command Set 7.2.4 Auto Pattern Receive Data Mobile Phone BLEDK3 MCU Connected Mode Auto Pattern: Receive Data (Transparent Pipe) Data Session Opened 31 32 33 34 35 31 32 33 34 35 page 75 BLEDK3 Command Set 7.3 LE Pairing Method: Passkey Entry Mobile Phone BLEDK3 MCU ATT/GATT Access Characteristic/Descriptor Insuffcient Authentication Pairing_Request Pairing_Response Display Passkey Passkey_Entry_Req Pairing_Confirm Notify User Scenario1: User Passkey Entry Repeat 6 times Passkey_Entry_Res User Digit Passkey Entry (Notification_type=0x01, Entered_Passkey= “0~9”) Pairing_Confirm Passkey_Entry_Res (Notification_type=0x04) User Press “Enter”Key Scenario1-1: Correct Passkey Entry SMP Procedure 30 second TO Pairing Complete: 0x00 (Pairing_Complete) Notify User Scenario1-2: Incorrect Passkey Entry Pairing_Random Pairing_Failed Pairing Complete: 0x01 (Pairing_Fail) Notify User Disconnect Scenario2: Cancel Passkey Entry User Press Cancel Pairing_Failed Pairing Complete: 0x01 (Pairing_Fail) Disconnect Notify User Scenario3: Passkey Entry Timeout Disconnect Pairing Complete: 0x01(Pairing_Fail) Notify User page 76 BLEDK3 Command Set 7.4 LE Pairing Method: Passkey Confirm Mobile Phone BLEDK3 MCU ATT/GATT Access Characteristic/Descriptor Insuffcient Authentication Pairing_Request Display Yes/No and Passkey Pairing_Response Passkey_Confirm_Req Notify User Scenario1: Correct Passkey Entry User Enter Passkey Pairing_Confirm Pairing_Confirm Passkey_Confirm_Res: (Option: 0x00) User Entered Yes SMP Procedure Passkey Confirm Authenticated Passkey_Confirm: 0x00 (Pairing_Complete) Notify User Scenario2: Incorrect Passkey Entry User Enter Wrong Passkey Pairing_Confirm 30 second TO Pairing_Confirm Pairing_Failed Passkey_Confirm_Res: (Option: 0x00) Pairing Complete: 0x01 (Pairing_Fail) Disconnect User Entered Yes Notify User Scenario3: MCU Cancel Passkey Entry Pairing_Failed Passkey_Confirm_Res: (Option: 0x01) Disconnect Pairing Complete: 0x01 (Pairing_Fail) User Entered No Notify User Scenario4: Mobile Phone Cancel Passkey Entry User Press Cancel Pairing_Failed Pairing Complete: 0x01 (Pairing_Fail) Disconnect Notify User Scenario5: Passkey Entry Timeout Pairing Complete: 0x01(Pairing_Fail) Disconnect Notify User page 77 BLEDK3 Command Set 8 LISTING OF COMMAND STATUS ERROR CODE Error Code Description 0x00 Command succeeded 0x01 Unknown Command 0x02 Unknown Connection Identifier 0x03 Hardware Failure 0x05 Authentication Failure 0x06 PIN or Key Missing 0x07 Memory Capacity Exceeded 0x08 Connection Timeout 0x09 Connection Limit Exceeded 0x0B ACL Connection Already Exists 0x0C Command Disallowed 0x0D Connection Rejected due to Limited Resources 0x0E Connection Rejected Due To Security Reasons 0x0F Connection Rejected due to Unacceptable BD_ADDR 0x10 Connection Accept Timeout Exceeded 0x11 Unsupported Feature or Parameter Value 0x12 Invalid Command Parameters 0x13 Remote User Terminated Connection 0x14 Remote Device Terminated Connection due to Low Resources 0x15 Remote Device Terminated Connection due to Power Off 0x16 Connection Terminated By Local Host 0x18 Pairing Not Allowed 0x1F Unspecified Error 0x28 Instant Passed 0x29 Pairing With Unit Key Not Supported 0x2F Insufficient Security 0x39 Connection Rejected due to No Suitable Channel Found 0x3A Controller Busy 0x3B Unacceptable Connection Interval 0x3C Directed Advertising Timeout 0x3D Connection Terminated due to MIC Failure 0x3E Connection Failed to be Established 0x81 Invalid Handle 0x82 Read Not Permitted 0x83 Write Not Permitted 0x84 Invalid PDU 0x85 Insufficient Authentication 0x86 Request Not Supported page 78 BLEDK3 Command Set 9 0x77 Invalid Offset 0x88 Insufficient Authorization 0x89 Prepare Queue Full 0x8A Attribute Not Found 0x8B Attribute Not Long 0x8C Insufficient Encryption Key Size 0x8D Invalid Attribute Value Length 0x8E Unlikely Error 0x8F Insufficient Encryption 0x90 Unsupported Grout Type 0x91 Insufficient Resources 0xF0 Application Defined Error 0xFF UART_Check_Sum_Error LISTING OF BLEDK3 STATUS BLEDK3 Status Description 0x01 Scanning Mode 0x02 Connecting Mode 0x03 Standby Mode 0x05 Broadcast Mode 0x08 Transparent Service Enabled Mode 0x09 Idle Mode 0x0a Shutdown Mode 0x0b Configure Mode 0x0c BLE Connected Mode 10 REVISION HISTORY Version Date History 1.00 2014/10/03 Preliminary Version 1.01 2014/10/06 Modify command parameters Read_Pairing_Mode_Setting Write_Pairing_Mode_Setting Write_Adv_Data Write_Scan_Res_Data Write_Device_Name Modify event parameters 1.02 2014/11/07 Client_Write_Characteristic_Value Add GATT Server commands Read_Local_Characteristic_Value Read_Local_All_Primary_Service page 79 BLEDK3 Command Set Read_Local_Specific_Primary_Service Modify command parameters Send_Transparent_Data Modify Event Parameters 1.03 2014/11/11 Modify command parameters 1.04 2014/11/26 2014/12/01 2014/12/08 2014/12/11 1.08 2015/01/09 DIO_Conrtol Modify UART CTS/RTS pin description 1.07 Read_Local_Information Modify command format description 1.06 Write_Adv_Data Modify command response parameters 1.05 Recieved _Transparent_Data Pin definition Modify command parameters, remove options Write_Adv_Data Revise state machine charts Revise UART exchange timing diagram 1.09 2015/01/14 Modify command parameters Read_ADC_Value Add common command 1.10 2015/01/15 Modify command parameters 1.11 2015/02/26 2015/03/17 Set_Scan_Parameters Add an error code: 0xF0 1.12 PWM_Control Listing of Command Status Error Code Modify BLEDK3 status definitions Listing of BLEDK3 Status Into_Shutdown_Mode Pin definition modified: TX_IND pin Pin definition UART data flow control diagram modified UART flow control Modify command name and its functionalities DIO_Conrtol 1.13 2015/03/31 Change Document Format to MCHP style 1.14 2015/05/11 Add two commands for sending response manually 1.15 2015/06/22 Send_Write_Response Modify parameters description error Send_Characteristic_Value page 80