QPP Programming Guide

Similar documents
QPP Proprietary Profile Guide

QN902x OTA Programming Guide

Using LPC11Axx EEPROM (with IAP)

UM NVT2008PW and NVT2010PW demo boards. Document information

UM NVT2001GM and NVT2002DP demo boards. Document information

AN NTAG I²C plus memory configuration options. Application note COMPANY PUBLIC. Rev June Document information

UM PR533 - PCSC Tool. User manual COMPANY PUBLIC. Rev November Document information

How to use the NTAG I²C plus for bidirectional communication. Rev June

UM NXP USB PD shield board user manual COMPANY PUBLIC. Document information

AN10942 MFRX852 Evaluation Board- Quick start up Guide

AN LPC82x Touch Solution Quick Start Guide. Document information. Keywords

UM PCAL6524 demonstration board OM Document information

UM EEPROM Management of PN746X and PN736X. User manual COMPANY PUBLIC. Rev February Document information

AN CBTL08GP053 Programmer's Guide. Document information. Keywords Abstract

STB-CE v Overview. 2 Features. Release notes for STB-CE v What's new in STB-CE v2.5

OM bit GPIO Daughter Card User Manual

UM OM bit GPIO Daughter Card User Manual. Document information. Keywords Abstract

AN Over-the-Air top-up with MIFARE DESFire EV2 and MIFARE Plus EV1. Document information

AN BGA301x Wideband Variable Gain Amplifier Application. Document information. Keywords

AN BGA GHz 18 db gain wideband amplifier MMIC. Document information. Keywords. BGA3018, Evaluation board, CATV, Drop amplifier.

AN10955 Full-duplex software UART for LPC111x and LPC13xx

AN MIFARE Type Identification Procedure. Application note COMPANY PUBLIC. Rev August Document information

UM10766 User manual for the I2C-bus RTC PCF85263A demo board OM13510

IoT Sensing SDK. Getting started with IoT Sensing SDK (ISSDK) v1.7 middleware. Document information. IoT Sensing SDK, ISSDK, MCUXpresso, middleware

LPC-Link2 Debug Probe Firmware Programming. Rev June, 2017 User Guide

UM User manual for the BGU MHz LNA evaluation board. Document information

UM LPC General Purpose Shield (OM13082) Rev November Document information. Keywords

UM NXP USB Type-C Shield 2 Demo Kit User Manual COMPANY PUBLIC. Document information

ES_LPC81xM. Errata sheet LPC81xM. Document information

ES_LPC5410x. Errata sheet LPC5410x. Document information

AN10917 Memory to DAC data transfers using the LPC1700's DMA

UM NTAG I²C plus Explorer Kit Peek and Poke. Rev September User manual COMPANY PUBLIC. Document information

SOD Package summary

Broadband system applications i.e. WCDMA, CATV, etc. General purpose Voltage Controlled Attenuators for high linearity applications

AN12120 A71CH for electronic anticounterfeit protection

CAUTION This device is sensitive to ElectroStatic Discharge (ESD). Therefore care should be taken during transport and handling.

NXP AN11528 sensor Application note

QN902x OTA Profile Guide

UM OM11057 quick start guide. Document information

AN12119 A71CH Quick start guide for OM3710A71CHARD and i.mx6ultralite

AN QN902x Quick Start Guide. Document information

74ABT General description. 2. Features and benefits. 3. Ordering information. Quad 2-input AND gate

NCR402T. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

QN908x. DK User s Guide. Document information. QN9080-DK, QN9080, QN9083, BLE, USB Dongle This document is an introduction to the QN908x DK V1.

UM10760 User manual for the I²C-bus RTC PCF8523 demo board OM13511

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

PNP 500 ma, 50 V resistor-equipped transistor; R1 = 2.2 kω, R2 = open

General-purpose Zener diodes in a SOD323F (SC-90) very small and flat lead Surface-Mounted Device (SMD) plastic package.

Release notes for ISSDK v1.7

End User License Agreement

OM13071 LPCXpresso824-MAX Development board

UM LPC54114 Audio and Voice Recognition Kit. Rev February Document information. Keywords

PESD18VV1BBSF. Very symmetrical bidirectional ESD protection diode

MMBZ16VAL. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

Bidirectional ESD protection diode

UM User Manual for LPC54018 IoT Module. Rev November Document information

UM Gaming suitcase demo system. Document information

SiGe:C Low Noise High Linearity Amplifier

PESD18VF1BL. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data. 5. Pinning information

UM LPC54018 IoT module. Document information. LPC54018, OM40007, Amazon FreeRTOS, AWS, GT1216 LPC54018 IoT module user manual

PESD5V0X2UM. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

300 V, 100 ma PNP high-voltage transistor

General-purpose Zener diodes in an SOD523 (SC-79) ultra small and flat lead Surface-Mounted Device (SMD) plastic package.

QSG DAC1x08D+ECP3 DB

UM OM13500 & OM13500A, PCA9620 & PCx8537 demo board. Document information. Keywords

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

AN How to design in and program the PCA9641 I 2 C arbiter. Document information

ESD protection for ultra high-speed interfaces

PESD24VF1BSF. Table 1. Quick reference data Symbol Parameter Conditions Min Typ Max Unit C d diode capacitance f = 1 MHz; V R = 0 V

PESD5V0C1USF. in portable electronics, communication, consumer and computing devices.

NWP2081T. 1. General description. 2. Features and benefits. 3. Applications. 4. Ordering information. Half-bridge driver IC

D (double) Package type descriptive code. SOD2 Package type industry code. DSN Package style descriptive code

PTVSxS1UR series. 1. Product profile. 400 W Transient Voltage Suppressor. 1.1 General description. 1.2 Features and benefits. 1.

AN Application Note for the BGA7130 EVB MHz. Document information

AN PN5180 Secure firmware update. Application note COMPANY PUBLIC. Rev December Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

PESD12VV1BL. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

S (single) Package type descriptive code. DPAK Package type industry code. DPAK Package style descriptive code

AN QN908x FFT Application. Document information

D (double) Package type descriptive code. SMT3; MPAK Package type industry code. SMT3; MPAK Package style descriptive code

AN10913 DSP library for LPC1700 and LPC1300

plastic surface-mounted package; 5 leads D (double) Package type descriptive code TSOP5 Package type industry code

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

AN MIFARE product and handling of UIDs. Rev July Application note COMPANY PUBLIC. Document information

SOT404-REFLOW REL Major version date Minor version date Security status

SOD123W. 1. Package summary. plastic, surface mounted package; 2 terminals; 2.6 mm x 1.7 mm x 1 mm body 9 April 2018 Package information

AN Automatic RS-485 address detection. Document information

PESD3V6Z1BCSF. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

AN10927 MIFARE and handling of UIDs

GreenChip synchronous rectifier controller. The TEA1792TS is fabricated in a Silicon-On-Insulator (SOI) process.

Unidirectional ESD protection diode

D (double) Package type descriptive code. TSSOP8 Package type industry code. TSSOP8 Package style descriptive code

LPC81x, LPC82x, LPC83x Errata Sheet and Datasheet Update for Vdd.1 Errata

B (bottom) Package type descriptive code. BGA658 Package type industry code. BGA658 Package style descriptive code

S (surface mount) Issue date

1. License Grant; Related Provisions.

SAM4 Reset Controller (RSTC)

Mile Terms of Use. Effective Date: February, Version 1.1 Feb 2018 [ Mile ] Mileico.com

UM LPCXpresso Rev th November Document information. LPCXpresso54102, LPC54100 LPCXpresso54102 User Manual

PTVSxP1UP series. 600 W Transient Voltage Suppressor

Transcription:

Document information Info Keywords Abstract Content QPP Server, QPP client in Android, QPP client in IOS This document demonstrates with example about how to create application working as QPP server in BLE peripherals device and application as QPP client role in BLE central device.

Revision history Rev Date Description 0.1 20140519 Initial release 1.0 20150330 Merged programing in BLE, ios client, Android client in one document; Migrated to NXP template. 1.1 20150925 Updated some description 1.2 20180404 Updated some description 2 of 21

Contact information For more information, please visit: http://www.nxp.com 3 of 21

Contents Contents... 3 1. Introduction... 4 2. QPP Server... 4 2.1 Project Example... 4 2.2 Software Description... 4 2.2.1 User Configuration... 4 2.2.2 Initialization... 4 2.2.3 Data Processing... 4 2.3 API and Handler... 5 2.3.1 qpps_init()... 5 2.3.2 qpps_set_service_uuid()... 5 2.3.3 app_qpps_create_db()... 5 2.3.4 app_qpps_enable_req()... 6 2.3.5 app_qpps_data_send()... 6 2.3.6 app_qpps_create_db_cfm_handler ()... 7 2.3.7 app_qpps_disable_ind_handler ()... 7 2.3.8 app_qpps_error_ind_handler ()... 8 2.3.9 app_qpps_data_send_cfm_handler ()... 8 2.3.10 app_qpps_cfg_indntf_ind_handler ()... 8 2.3.11 app_qpps_data_ind_handler ()... 9 3. QPP Client Overview... 10 3.1 Features... 10 3.2 Overview... 10 4. QPP Client Integration-Android... 11 4.1 Flowchart... 11 1.1 API and Callback Description... 12 4.1.1 Class QppApi... 13 4.1.2 Interface iqppcallback... 14 4.2 Integration Note... 15 4.2.1 Initialize... 15 4.2.2 Rx Data... 15 4.2.3 Tx Data... 16 4.3 Example code... 16 5. QPP Client Integration-IOS... 16 5.1 Flowchart... 16 5.2 API and Delegate Description... 17 5.2.1 qppreguuids()... 17 5.2.2 qppsenddata()... 18 5.2.3 didqppreceivedata()... 18 5.3 Integration Note... 18 5.4 Example code... 19 6. References... 19 7. Legal information... 20 7.1 Definitions... 20 7.2 Disclaimers... 20 7.3 Trademarks... 20 8. List of figures... 21 Contact information For more information, please visit: http://www.nxp.com 4 of 21

1. Introduction 2. QPP Server The QPP (Proprietary Profile) is used to transfer the raw data between BLE devices. This document demonstrates with example about how to create application working as QPP server in BLE peripherals device and application as QPP client role in BLE central device. 2.1 Project Example The project can be opened with the following IAR and KEIL workspace file: C:\QBlue\QN9020\QBlue-X.X.X\Projects\BLE\prj_qpps\iar\qpps.eww C:\QBlue\QN9020\QBlue-X.X.X\Projects\BLE\prj_qpps\keil\qpps.uvproj 2.2 Software Description The QPP application is implemented in the following files: app_qpps.c: Application QPPS API app_qpps_task.c: Task handling functions qpp.lib and qpps_task.h and qpp_common.h: QPP Profile 2.2.1 User Configuration The following macro shall be defined in the usr_config.h. #define CFG_PRF_QPPS #define CFG_TASK_QPPS TASK_PRF8 (Mandatory) #define QPPS_NOTIFY_NUM 7(Max : 7, Min :0) 2.2.2 Initialization The initialization of the application occurs in two phases: Firstly, the qpps_init() function is called by the profiles register function(prf_init_reg(prf_init)). This function register QPPS task into kernel. Secondly, the app_qpps_create_db(uint8_t char_num) function is called by the app_create_server_service_db() function. This function used to create server service database, the application can define the number of Characteristics used to send data to a client through notify. NOTE: char_num: Max=7 Min = 0. If char_num increases, transmission speed will be faster, but more and more space will be occupied. 2.2.3 Data Processing The application has three data processing functions, app_qpps_data_send(), app_qpps_data_send_cfm_handler() and app_qpps_data_ind_handler(). The app_qpps_data_send() function is used by the application to send raw data. The app_qpps_data_send_cfm_handler() function is used to report to the application a confirmation. The app_qpps_data_ind_handler() function is used to handle the data sent form peer device. 5 of 21

The diagrams below shows the relationships between APP and Profile: APP Profile app_qpps_data_send() app_qpps_data_send_cfm_handler() QPPS_DATA_SEND_REQ QPPS_DATA_SEND_CFM Figure 1 Data Sending APP Profile QPPS_DAVA_VAL_IND Figure 2 Data Receiving 2.3 API and Handler 2.3.1 qpps_init() void qpps_init(void); Description: This function performs all the initializations of the QPPS module. 2.3.2 qpps_set_service_uuid() void qpps_set_service_uuid(uint8_t param[att_uuid_128_len]); in param QPPS s UUID Description: This function should be called before adding QPP service into the database. 2.3.3 app_qpps_create_db() void app_qpps_create_db (uint8_t char_num); in char_num The number of Characteristic used to send data 6 of 21

Response: QPPS_CREATE_DB_CFM Description: This function shall be used to add an instance of the Proprietary Profile service into the database. This should be done during the initialization phase of the device. Note: Application can define the number of Characteristic used to send data to client through notify. 2.3.4 app_qpps_enable_req() void app_qpps_enable_req (uint16_t conhdl, uint8_t sec_lvl, uint8_t con_type, uint16_t ntf_en). in conhdl Connection handle in sec_lvl Security level required for protection of HRS attributes: Service Hide and Disable are not permitted. Possible values are: PERM_RIGHT_ENABLE PERM_RIGHT_UNAUTH PERM_RIGHT_AUTH in con_ty Connection type: configuration(0) or pe discovery(1) in ntf_en Notification configuration Response: None Description: This function is used for enabling the Server role of the Proprietary service. 2.3.5 app_qpps_data_send() void app_qpps_data_send (uint16_t conhdl, uint8_t index, uint8_t length, uint8_t * data). in conhdl Connection handle in index Index of Characteristic to be sent in length Length of data to be sent in data Pointer to data to be sent 7 of 21

Response: QPPS_DATA_SEND_CFM Description: This function is used by the application to send a raw data. 2.3.6 app_qpps_create_db_cfm_handler () int app_qpps_create_db_cfm_handler (ke_msg_id_t const msgid, struct qpps_create_db_cfm * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_CREATE_DB_CFM in param struct qpps_create_db_cfm in dest_id TASK_APP in src_id TASK_QPPS As it is a message handler, the related handling result for the message will be saved in related struct qpps_create_db_cfm * param depending on the message was handled or not. Description: This handler will be triggered after a database creation. It contains status of database creation. 2.3.7 app_qpps_disable_ind_handler () int app_qpps_disable_ind_handler (ke_msg_id_t const msgid, struct qpps_disable_ind * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_DISABLE_IND in param Pointer to the struct qpps_disable_ind in dest_id TASK_APP in src_id TASK_QPPS As it is a message handler, the related handling result for the message will be saved in related struct qpps_disable_ind * param depending on whether the message was handled or not. Description: 8 of 21

This handler is used to inform the Application of a correct disable. The configuration that the client has set in ntf_en field must be conserved for bonded devices. 2.3.8 app_qpps_error_ind_handler () int app_qpps_error_ind_handler (ke_msg_id_t const msgid, struct qpps_error_ind * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_ERROR_IND in param Pointer to the struct qpps_error_ind in dest_id TASK_APP in src_id TASK_QPPS As a message handler, the result will be saved in the related struct qpps_error_ind * param depending on whether the message was handled or not. Description: This handler is used to inform the Application of an occurred error. 2.3.9 app_qpps_data_send_cfm_handler () int app_qpps_data_send_cfm_handler (ke_msg_id_t const msgid, struct qpps_data_send_cfm * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_DATA_SEND_CFM in param Pointer to the struct qpps_data_send_cfm in dest_id TASK_APP in src_id TASK_QPPS As a message handler, the result will be saved in the related struct qpps_error_ind * param depending on whether the message was handled or not. Description: This handler is used to report to the application a confirmation or error status of a notification request being sent by application. 2.3.10 app_qpps_cfg_indntf_ind_handler () 9 of 21

int app_qpps_cfg_indntf_ind_handler (ke_msg_id_t const msgid, struct qpps_cfg_indntf_ind * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_CFG_INDNTF_IND in param Pointer to the struct qpps_cfg_indntf_ind in dest_id TASK_APP in src_id TASK_QPPS As it is a message handler, the related handling result for the message will be saved in related struct qpps_cfg_indntf_ind * param depending on the message was handled or not. Description: This handler is used to inform application that peer device has changed notification configuration. 2.3.11 app_qpps_data_ind_handler () int app_qpps_data_ind_handler (ke_msg_id_t const msgid, struct qpps_data_val_ind * param, ke_task_id_t const dest_id, ke_task_id_t const src_id) in msgid QPPS_DAVA_VAL_IND in param Pointer to the struct qpps_data_val_ind in dest_id TASK_APP in src_id TASK_QPPS As it is a message handler, the related handling result for the message will be saved in related struct qpps_data_val_ind * param depending on the message was handled or not. Description: This handler is used to handle the data sent form peer device. 9 of 21

3. QPP Client Overview The QPP (Proprietary Profile) is used to transfer the raw data between BLE devices. The libqblueqpp library acts as QPP client role, which is used by application to transfer and receive the raw data between BLE devices. 3.1 Features Transmit free raw data between BLE devices. Single free raw data package maximum length is 20bytes, minimal is 1byte. 3.2 Overview The QPP client diagram consists of three parts: App Layer: Send connection requests to BluetoothGatt, and configure API layer. Send data to API layer. Receive data from API layer. API Layer: Receive data from App layer and deliver the data received to BluetoothGatt. Receive data from BluetoothGatt and deliver the data received to App layer. BluetoothGatt Layer: Receive request from API layer. Update value to API layer. The QPP client diagram for Android is shown in Figure 1 10 of 21

Down Data Up Data API Down Data Up Data Figure 3 QPP Client Diagram for Android The QPP client diagram for ios is shown in App Down Data Up Data Connection Request Connection Delegate QPP Profile Down Data Up Data 4. QPP Client Integration-Android CoreBluetooth Figure 4 QPP Client Diagram for ios 4.1 Flowchart The QPP client general flowchart is the following: Scan BLE devices around. 11 of 21

Establish a connection with the device which is built-in QPP profile server. Discover services and characteristics. Register user s special UUIDs (including QPP service UUID and write characteristic UUID), here you d call the method: qppenable. User receives data in the onqppreceivedata function, or sends data by the QppSendData function. QPP TX flowchart is shown in Figure 5: App QPP Profile BluetoothGatt QppSendData Send Data QppSendData Send Data Figure 5 QPP Client TX flowchart QPP RX flowchart is shown in Figure 6: App onqppreceivedata QPP Profile BluetoothGatt Notify value for Characteristic onqppreceivedata Notify value for Characteristic 1.1 API and Callback Description Figure 6 QPP Client RX flowcharts There are one public class QppApi and one interface iqppcallback in the libqblueqpp library. The class QppApi defines APIs. The interface iqppcallback declares callbacks. There are five functions relevant: three API functions and two callback functions. These API functions are responsible to enable register service s UUIDs, transfer data. These callback functions are used to receive data, get QPP service status. 12 of 21

4.1.1 Class QppApi 4.1.1.1 General Definition public class QppApi { public static boolean qppenable(bluetoothgatt bluetoothgatt, String qppserviceuuid, String writecharuuid); public static boolean qppsenddata(bluetoothgatt bluetoothgatt, byte[] qppdata); public static boolean setqppnextnotify(bluetoothgatt bluetoothgatt, boolean EnableNotifyChara); public static void updatevaluefornotification(bluetoothgatt bluetoothgatt, BluetoothGattCharacteristic characteristic); public static void setcallback(iqppcallback mcb); }; 4.1.1.2 API Description public static boolean qppenable() Function public static boolean qppenable(bluetoothgatt bluetoothgatt, String qppserviceuuid, String writecharuuid); Brief Register customer s UUIDs, in order to support customer s devices using customized QPP UUIDs. In bluetoothgatt Android BluetoothGatt client handler In qppserviceuuid UUID for QPP service in string In writecharuuid UUID for write Characteristic in string True The service is found and bluetoothgatt is not null. False The service is not found or bluetoothgatt is null. Note: The qppserviceuuid must match the QPP UUID on the device side. public static boolean qppsenddata() Function public static boolean qppsenddata(bluetoothgatt bluetoothgatt, byte[] qppdata); Brief Send raw data to QPP Profile. In bluetoothgatt Android BluetoothGatt client handler In qppdata Data to send, the length should not be larger than 20bytes True Argument is valid and sends data is successful. False Argument is invalid or sends data is failed. public static boolean setqppnextnotify () Function public static boolean setqppnextnotify(bluetoothgatt bluetoothgatt, 13 of 21

boolean EnableNotifyChara); Brief Enable characteristics notification. In bluetoothgatt Android BluetoothGatt client handler In EnableNotifyChara true to enable and false to disable True False set characteristics is successful. set characteristics is failed. public static boolean updatevaluefornotification () Function public static void updatevaluefornotification(bluetoothgatt bluetoothgatt, BluetoothGattCharacteristic characteristic); Brief Notify libqblueqpp that data have been received. In bluetoothgatt Android BluetoothGatt client handler In characteristic Notify characteristic None. Note: This function should be invoked in BluetoothGattCallback. oncharacteristicchanged. public void boolean setcallback () Function public static void setcallback(iqppcallback mcb); Brief Set callback function handler. In mcb iqppcallback object None. 4.1.2 Interface iqppcallback General Definition public interface iqppcallback { void onqppreceivedata(bluetoothgatt bluetoothgatt, String qppuuidfornotifychar, byte[] qppdata); } API Description void onqppreceivedata() Function void onqppreceivedata(bluetoothgatt bluetoothgatt, String qppuuidfornotifychar, byte[] qppdata); Brief Process the data that received from QPP Profile. In bluetoothgatt Android BluetoothGatt client handler 14 of 21

In qppuuidfornotifychar UUID for notify characteristics. Out qppdata The received data from the notify characteristics. None. 4.2 Integration Note 4.2.1 Initialize 4.2.1.1 Add QppApi.qppEnable method The method is used by the application to register user's UUIDs in order to support customer s devices using customized QPP UUIDs. The qppserviceuuid must match the QPP UUID on the device side. Then profile discovery the service, characteristic from bluetoothgatt and enable notification characteristics to bluetoothgatt. The parameter bluetoothgatt is a connected BluetoothGatt. Add this method in following function: private final BluetoothGattCallback mgattcallback = new BluetoothGattCallback(){ { public void onservicesdiscovered(bluetoothgatt bluetoothgatt, int status) { if(qppapi.qppenable(bluetoothgatt, uuidqppservice, uuidqppcharwrite)) isinitialize = true; } } 4.2.2 Rx Data 4.2.2.1 Add QppApi.setQppNotify() method This method is to enable the QPP notification characteristics. Add this method in following function: public void ondescriptorwrite(bluetoothgatt bluetoothgatt, BluetoothGattDescriptor descriptor, int status) { QppApi.setQppNextNotify(bluetoothGatt, true); /// user code } 4.2.2.2 Add QppApi.updateValueForNotification method This method is to update value for notification characteristic. Add this method in following function: 15 of 21

public void oncharacteristicchanged(bluetoothgatt bluetoothgatt, BluetoothGattCharacteristic characteristic) { QppApi.updateValueForNotification(bluetoothGatt, characteristic); /// user code } 4.2.2.3 Receive data Refer to chapter 4.2.2 onqppreceivedata(). 4.2.3 Tx Data Call QppApi.qppSendData() to write data public void oncharacteristicwrite(bluetoothgatt bluetoothgatt, BluetoothGattCharacteristic characteristic,int status) { handlersend.postdelayed(runnablesend,20); } private Handler handlersend = new Handler( ); final Runnable runnablesend = new Runnable( ) { public void run ( ) { QppApi.qppSendData(bluetoothGatt, qppdatasend); } }; 4.3 Example code There is one example named as QPP_Android_xxx.zip in Collabnet which shows how to use the lib libqblueqpp.jar Qpp\libQBlueQpp\bin to transfer raw data between QN902x device and QPP client. 5. QPP Client Integration-iOS 5.1 Flowchart The QPP general flowchart is the following: Register user s special UUIDs (including QPP service UUID and write characteristic UUID), here you d call the method: qppreguuids. Scan BLE peripherals around. Establish a connection with the device which is built-in QPP profile server. Discover services and characteristics. User receives data in the didqppreceivedata delegate function, or sends data by the qppsenddata function. 16 of 21

QPP TX flowchart is shown in Figure 7: App QPP Profile CoreBluetooth qppsenddata Send Data qppsenddata Send Data Figure 7 QPP TX flowchart QPP RX flowchart is shown in Figure 8: App QPP Profile CoreBluetooth didqppreceivedata Update value for Characteristic didqppreceivedata Update value for Characteristic Figure 8 QPP RX flowchart 5.2 API and Delegate Description These functions consist of two API functions and one delegate function. API functions implement to register user s UUIDs and to transfer data, delegate function used to receive data. 5.2.1 qppreguuids() (void)qppreguuids : (NSString *)qppserviceuuid withwrchar : (NSString *)writecharuuid in qppserviceuuid UUID for QPP service in string in writecharuuid UUID for write Characteristic in string None. Description: The method is used by the application to register user's UUIDs in order to support customer s devices using customized QPP UUIDs. The qppserviceuuid must match the QPP UUID on the device side. The method is called before discovery procedure. 17 of 21

5.2.2 qppsenddata() (void)qppsenddata : (CBPeripheral *)aperipheral withdata : (NSData*)qppData; in aperipheral The peripheral must be built-in QPP profile server in qppdata The raw data None. Description: The function is used by application to send raw data to QPP Profile. 5.2.3 didqppreceivedata() (void)didqppreceivedata : (CBPeripheral *)aperipheral withcharuuid : (CBUUID *)qppuuidfornotifychar withdata : (NSData *)qppdata; Out aperipheral The data received is from the peripheral. Out qppuuidfornotifychar The UUID for notify characteristics. Out qppdata The data received is from the notify characteristics. None. Description: The function is used by application to process the data received from QPP Profile. 5.3 Integration Note a) Please insert the bledidupdatecharforqppservice delegate method in the diddiscovercharacteristicsforservice delegate. The delegate is to update write characteristic and notify characteristic for QPP service. - (void) peripheral : (CBPeripheral *)aperipheral diddiscovercharacteristicsforservice : (CBService *)service error : (NSError *)error { /// for QPP profile delegate [bleupdateforqppdelegate bledidupdatecharforqppservice : aperipheral 18 of 21

withservice : aservice error : error]; } /// user code b) Please insert the bledidupdatevalueforqppchar delegate method in the didupdatevalueforcharacteristic delegate. The delegate is to update value for notification characteristic. - (void) peripheral:(cbperipheral *)aperipheral didupdatevalueforcharacteristic:(cbcharacteristic *)characteristic error:(nserror *)error { for (CBService *aservice in aperipheral.services) { [bleupdateforqppdelegate bledidupdatevalueforqppchar : (CBPeripheral*)aPeripheral withservice : (CBService *)aservice withchar : (CBCharacteristic *)characteristic error : (NSError *)error]; /// user code } } 5.4 Example code There is an example ios project named QPP_IOS_xxx.zip in Collabnet. It shows how to use the libqblueqpp library to implement transfer raw data between QN902x device and QppDemo. 6. References Included with QBlue-X.X.X Release. The QBlue-X.X.X software has been installed to the default path C:\QBlue\QBlue-X.X.X : [1] C:\QBlue\QN9020\QBlue-X.X.X\ Documents\ QN9020 Device Database for IDE User Manual v1.0.pdf [2] C:\QBlue\QN9020\QBlue-X.X.X\ Documents\QN9020 API Programming Guide v1.0.pdf [3] QN9020 Software Developer's Guide v1.5.pdf 19 of 21

7. Legal information 7.1 Definitions Draft The document is a draft version only. The content is still under internal review and subject to formal approval, which may result in modifications or additions. NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. 7.2 Disclaimers Limited warranty and liability Information in this document is believed to be accurate and reliable. However, NXP Semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. NXP Semiconductors takes no responsibility for the content in this document if provided by an information source outside of NXP Semiconductors. In no event shall NXP Semiconductors be liable for any indirect, incidental, punitive, special or consequential damages (including - without limitation - lost profits, lost savings, business interruption, costs related to the removal or replacement of any products or rework charges) whether or not such damages are based on tort (including negligence), warranty, breach of contract or any other legal theory. Notwithstanding any damages that customer might incur for any reason whatsoever, NXP Semiconductors aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms and conditions of commercial sale of NXP Semiconductors. Right to make changes NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof. Suitability for use NXP Semiconductors products are not designed, authorized or warranted to be suitable for use in life support, life-critical or safety-critical systems or equipment, nor in applications where failure or malfunction of an NXP Semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. NXP Semiconductors and its suppliers accept no liability for inclusion and/or use of NXP Semiconductors products in such equipment or applications and therefore such inclusion and/or use is at the customer s own risk. Applications Applications that are described herein for any of these products are for illustrative purposes only. NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. Customers are responsible for the design and operation of their applications and products using NXP Semiconductors products, and NXP Semiconductors accepts no liability for any assistance with applications or customer product design. It is customer s sole responsibility to determine whether the NXP Semiconductors product is suitable and fit for the customer s applications and products planned, as well as for the planned application and use of customer s third party customer(s). Customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. NXP Semiconductors does not accept any liability related to any default, damage, costs or problem which is based on any weakness or default in the customer s applications or products, or the application or use by customer s third party customer(s). Customer is responsible for doing all necessary testing for the customer s applications and products using NXP Semiconductors products in order to avoid a default of the applications and the products or of the application or use by customer s third party customer(s). NXP does not accept any liability in this respect. Export control This document as well as the item(s) described herein may be subject to export control regulations. Export might require a prior authorization from competent authorities. Translations A non-english (translated) version of a document is for reference only. The English version shall prevail in case of any discrepancy between the translated and English versions. Evaluation products This product is provided on an as is and with all faults basis for evaluation purposes only. NXP Semiconductors, its affiliates and their suppliers expressly disclaim all warranties, whether express, implied or statutory, including but not limited to the implied warranties of noninfringement, merchantability and fitness for a particular purpose. The entire risk as to the quality, or arising out of the use or performance, of this product remains with customer. In no event shall NXP Semiconductors, its affiliates or their suppliers be liable to customer for any special, indirect, consequential, punitive or incidental damages (including without limitation damages for loss of business, business interruption, loss of use, loss of data or information, and the like) arising out the use of or inability to use the product, whether or not based on tort (including negligence), strict liability, breach of contract, breach of warranty or any other theory, even if advised of the possibility of such damages. Notwithstanding any damages that customer might incur for any reason whatsoever (including without limitation, all damages referenced above and all direct or general damages), the entire liability of NXP Semiconductors, its affiliates and their suppliers and customer s exclusive remedy for all of the foregoing shall be limited to actual damages incurred by customer based on reasonable reliance up to the greater of the amount actually paid by customer for the product or five dollars (US$5.00). The foregoing limitations, exclusions and disclaimers shall apply to the maximum extent permitted by applicable law, even if any remedy fails of its essential purpose. 7.3 Trademarks Notice: All referenced brands, product names, service names and trademarks are property of their respective owners. 20 of 21

8. List of figures Figure 1 Data Sending... 5 Figure 2 Data Receiving... 5 Figure 3 QPP Client Diagram for Android... 11 Figure 4 QPP Client Diagram for ios... 11 Figure 5 QPP Client TX flowchart... 12 Figure 6 QPP Client RX flowcharts... 12 Figure 7 QPP TX flowchart... 17 Figure 8 QPP RX flowchart... 17 21 of 21