Home
BlueNRG profile application interface
Contents
1. 40 6 8 5 TimeClient_Get_Time_Accuracy_Info_Of_Server 40 6 8 6 TimeClient Get Next DST Change 40 6 8 7 TimeClient Get Server Time Update State 41 6 8 8 TimeClient Update Reference Time On Server 41 6 8 9 TimeClient StateMachine 41 DoclD026385 Rev 2 Ky UM1770 Contents Time profile 41 6 8 10 TimeServer_Init 0 0 eee ee eee 41 6 8 11 TimeServer_Make_Discoverable 42 6 8 12 TimeServer_Update_Current_Time_Value 42 6 8 13 TimeServer Update Local Time Information 42 6 8 14 TimeServer Update Reference Time Information 43 6 8 15 5 43 6 8 16 TimeServer StateMachine 43 6 9 Device information service profile 43 6 9 1 BLE Profile Update DIS SystemID 44 6 9 2 BLE Profile Update DIS ModelNum 44 6 9 3 BLE Profile Update DIS 44 6 9 4 BLE Profile Update DIS FirmwareRew 44 6 9 5 BLE Profile Update DIS HardwareRew
2. 18 5 11 Blood pressure sensor events 19 5 12 Health thermometer events 19 5 13 Alert notification server events 20 5 14 Alert notification client events 20 5 15 Glucose 20 6 Profile application interface functions 21 6 1 Heart rate 21 6 1 1 HRProfile 0 21 6 1 2 HR Sensor Make Discoverable 21 6 1 3 HRProfile Send Value 22 6 1 4 HRProfile Set Sensor Contact Support Bit 22 6 1 5 HRProfile Set Body Sensor Location 22 6 1 6 HRProfile StateMachine 23 2 56 DoclD026385 Rev 2 Ly UM1770 Contents 6 2 Find me profile 23 Find me teeth poate a d rin a aaa ee 23 6 2 1 FindMeTarget_Init 23 6 2 2 FMT_Advertize 23 6 2 3 FMT Add Device To 24 6 2 4 FMLProfile StateMachine
3. 52 Ky DoclD026385 Rev 2 5 56 Contents UM1770 7 List of references 54 8 Revision history 55 6 56 DocID026385 Rev 2 Ly UM1770 Architecture 1 Architecture Figure 1 describes the BlueNRG profile framework architecture Figure 1 BlueNRG profile framework architecture APPLICATION PROFILES MAIN BLE PROFILE ACI FRAMEWORK SPI LAYER The following is a description of each profile layer GAMS1011141054EC e Application Uuser test application using Bluetooth low energy BLE profiles framework e Profiles specific profile implementation alert notification find me etc e Main BLE profile BLE profile framework for all BLE profiles file profile c it provides functions for main profile initialization profile registration event handlers and notifies events to specific profiles ACI framework _ it exposes functions to the upper layers to send the various commands supported by the BlueNRG standard and vendor specific ones all the commands are sent to the controller via the ACI framework bluenrg gap aci c bluenrg aci c bluenrg 2 bluenrg hal aci c 2 DoclD026385 Rev 2 7 56 Architecture UM1770 Note A specific profile may only require a subset of these commands automatically stripped by the li
4. 0 1770 yf i life augmented User manual BlueNRG profile application interface Introduction This document describes the API interfaces and related events of the Bluetooth low energy BLE profiles These APIs allow the management of communication between a user application and the available Bluetooth low energy profiles December 2014 DoclD026385 Rev 2 1 56 www st com Contents UM1770 Contents 1 Architecture Se 7 2 AGI framework 9 3 Execution context 10 4 BlueNRG profile framework 12 5 Application profile interface 14 5 1 Generic events 14 5 2 Heart rate profile events 15 5 3 Proximity reporter events 15 5 4 Proximity monitor events 16 5 5 HID events 16 5 6 Find me target 16 5 7 Find me locator events 17 5 8 Phone alert client events 17 5 9 Time server events 18 5 10 Time client events
5. 44 6 9 6 BLE Profile Update DIS SoftwareRev 45 6 9 7 BLE Profile Update DIS 45 6 9 8 BLE_Profile_Update_DIS_IEEECertification 45 6 9 9 BLE Profile Update DIS 45 6 10 Proximity profile 46 Proximity TOMO rm 46 6 10 1 ProximityMonitor 46 6 10 2 ProximityMonitor Make Discoverable 46 6 10 3 ProximityMonitorProfile StateMachine 46 Proximity 46 6 10 4 ProximityReporter 46 6 10 5 ProximityReporter Make Discoverable 47 6 10 6 ProximityReporterProfile_StateMachine 47 6 11 Glucose sensor profile 47 6 11 1 AGLI curd oe aes 47 6 11 2 Advertize 22222222 544 14424244 Pd 48 6 11 3 ResetFlags 1 48 6 11 4 GL Send Glucose Measurement 48 6 11 5 Send Glucose Measurement Context 50 6 11 6 Set Glucose Feature 52 6 11 7 StateMachine
6. 24 Find 24 6 2 5 FindMeLocator_Init 24 6 2 6 FML Advertize 24 6 2 7 Add Device To Whitelist 25 6 2 8 Alert Target user mer ertet eri e RET a t a ped 25 6 2 9 FMTProfile StateMachine 25 6 3 Health thermometer 25 6 3 1 uM CRT 25 6 3 2 HT 26 6 3 3 HT Send Temperature Measurement 26 6 3 4 HT Send Intermediate 27 6 3 5 HT Update Measurement Interval 27 6 3 6 HT Update Temperature Type 28 6 3 7 HT StateMachine 28 6 4 Alert Notification profile 28 Alert Notification 28 6 4 1 ANC Client 28 6 4 2 ANC Advertize ai essere APTE PETAT uq pt de yd 29 6 4 3 ANC Write Control 0 29 6 4 4 ANC Enable Disable New Alert Notification 30 6 4 5 ANC Enable Disable Unread Alert Status Notification
7. the index of the input report to be updated 3 ftrReportValLength length of the input report 4 ftrReportValue value of the input report HidDevice Update Boot Keyboard Input Report Description This is called by the application to update the boot keyboard input report characteristic with the value specified in bootKbdlpReportValue On successful update of the characteristic the application is notified through the event EVT HID UPDATE CMPLT Parameters 1 hidServicelndex the index of the HID service whose report characteristic must be updated 2 BootKbdlpReportValLength length of the boot keyboard input report 3 bootKbdlpReportValue value of the boot keyboard input report HidDevice Update Boot Mouse Input Report Description This is called by the application to update the boot mouse input report characteristic with the value specified in bootMouselpReportValue On successful update of the characteristic the application is notified through the event EVT HID UPDATE CMPLT Parameters 1 hidServicelndex the index of the HID service whose report characteristic must be updated 2 BootMouselpReportValLength length of the boot mouse input report 3 bootMouselpReportValue value of the boot mouse input report 3 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 6 7 HidDevice_Update_Battery_Level Description This is called by the application to start the
8. 30 6 4 6 ANCProfile 30 Alert notification 30 6 4 7 ANS dub E 30 6 4 8 ANS Advertize 31 6 4 9 ANS_Update_New_Alert_Category 31 6 4 10 ANS Update Unread Alert Category 32 6 4 11 ANS Update 32 6 4 12 ANS Update Unread Alert Status 32 6 4 13 ANSProfile 33 Ky DoclD026385 Rev 2 3 56 Contents UM1770 4 56 6 5 Blood pressure profile 33 6 5 1 BPS lhit sasian tered daadaa ia debe 33 6 5 2 BPS Advertize 33 6 5 3 BPS Send Intermediate Cuff Pressure 34 6 5 4 BPS Send Blood Pressure 34 6 5 5 BPS StateMachine 34 6 6 Human interface device 35 6 6 1 HidDevice 400 35 6 6 2 HidDevice Make Discoverable 35 6 6 3 HidDevice Update Input Report 35 6 6 4 HidDevice Upd
9. UM1770 Profile application interface functions 6 6 1 6 1 2 2 Profile application interface functions Heart rate profile HRProfile Init Description The application calls this function to initialize the heart rate profile The initialization procedure returns BLE STATUS SUCCESS if started successfully or BLE STATUS FAILED if not On successful initialization of the profile the application is notified through the event EVT HRS INITIALIZED through the registered callback Parameters Feature support flag the characteristic feature mask supported by the heart rate profile during initialization The various characteristics mask supported by the profile are 1 BODY SENSOR LOCATION SUPPORT MASK 0x01 2 ENERGY EXTENDED INFO SUPPORT MASK 0x02 BLE CALLBACK FUNCTION TYPE the callback function to be registered by the heart rate profile for notification communication to the main BLE profile e Sensor location value the Value for the body sensor location HR_Sensor_Make_Discoverable Description This command puts the device into discoverable mode BLE_STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters useBoundedDeviceList set this flag to TRUE 1 if Profile needs to advertise to devices already bonded otherwise set it to FALSE 0 DoclD026385 Rev 2 21 56 Profile application interface functions UM1770 6 1 3
10. 6 8 8 6 8 9 6 8 10 d TimeClient Get Server Time Update State Description The application should call this function to read the time update state characteristic on the server Once the read is complete the read value is sent to the application through an event called EVT TC READ TIME UPDATE STATE CHAR TimeClient Update Reference Time On Server Description The application calls this function to write the time update control point characteristic on the server Parameters 1 ctlValue writing a value of 1 starts the update procedure a value of 0 cancels the update procedure TimeClient StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Time profile Server TimeServer_Init Description Initializes the time profile in server role On successful initialization the application is notified through the event EVT_TS_INITIALIZED Parameters 1 BLE CALLBACK FUNCTION TYPE callback function to be called by the profile to notify the application of the events 2 ServicesToBeSupported the bit mask of the optional services to be supported Below are the bitmask values a NEXT DST CHANGE SERVICE BITMASK 0x01 b REFERENCE TIME UPDATE SERVICE BITMASK 0x02 DoclD026385 Rev 2 41 56 Profile application interface functions UM1770 6 8
11. 0x1 GLUCOSE_MEASUREMENT_CONTEXT_MEAL_POSTPRANDIAL 0x2 GLUCOSE_MEASUREMENT_CONTEXT_MEAL_FASTING 0x3 GLUCOSE_MEASUREMENT_CONTEXT_MEAL_CASUAL 0x4 GLUCOSE_MEASUREMENT_CONTEXT_MEAL_BEDTIME 0 5 testerHealth field tester nibble a b d GLUCOSE MEASUREMENT CONTEXT TESTER SELF 0x1 GLUCOSE MEASUREMENT CONTEXT TESTER HEALTH CARE PROFESSI ONAL 0x2 GLUCOSE MEASUREMENT CONTEXT TESTER LAB TEST 0x3 GLUCOSE MEASUREMENT CONTEXT TESTER NOT AVAILABLE 0xF health nibble a b GLUCOSE MEASUREMENT CONTEXT HEALTH MINOR ISSUES 0x10 GLUCOSE MEASUREMENT CONTEXT HEALTH MAJOR ISSUES 0x20 DoclD026385 Rev 2 51 56 Profile application interface functions UM1770 6 11 6 6 11 7 52 56 11 12 GLUCOSE_MEASUREMENT_CONTEXT_HEALTH_DURING_MENSES 0x30 GLUCOSE_MEASUREMENT_CONTEXT_HEALTH_UNDER_STRESS 0x40 GLUCOSE_MEASUREMENT_CONTEXT_HEALTH_NO_ISSUE 0x50 GLUCOSE_MEASUREMENT_CONTEXT_HEALTH_VALUE_NOT_AVAILABLE OxFO exerciseDuration field exercise duration in seconds exerciselntensity field intensity of exercise medicationld field GLUCOSE MEASUREMENT CONTEXT MEDICATION ID RAPID ACTING INS ULIN 0x1 GLUCOSE MEASUREMENT CONTEXT MEDICATION SHORT ACTING INSU LIN 0x2 GLUCOSE MEASUREMENT CONTEXT MEDICATION INTERMEDIATE ACTIN G INSULIN 0x3 GLUCOSE MEASUREMENT CONTEXT MEDICATION LONG ACTING INSULI N 0x4 GLUCOSE MEASUREMENT CONTEXT MEDICATION PRE MIXED INSULIN 0x5 medicationUnits fi
12. 2 29 56 Profile application interface functions UM1770 6 4 4 6 4 5 6 4 6 6 4 7 30 56 ANC_Enable_Disable_New_Alert_Notification Description Enables the notifications for the new alert characteristic After enabling this the control point characteristic must also be written with the command and category to receive alerts from the peer Parameters 1 enable if set to TRUE it enables the notifications for the new alert characteristic ANC_Enable_Disable_Unread_Alert_Status_Notification Description Enables the notifications for the unread alert status characteristic After enabling this the control point characteristic must also be written with the command and category to receive alerts from the peer Parameters 1 enable if set to TRUE it enables the notifications for the unread alert status characteristic ANCProfile_StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Alert notification Server ANS Init Description Initializes the Alert Notification Profile in the server role It returns BLE STATUS SUCCESS if the procedure is started successfully Notification of successful initialization of the profile is sent to the application through the event EVT ANS INITIALIZED Parameters e BLE CALLBACK FUNCTION TYPE callbac
13. IDLE CONNECTION TIMEOUT this event is sent to the application when there is no measurements to be sent to the collector for more than five seconds 5 12 Health thermometer events 1 d EVT HT INITIALIZED this event is sent by the thermometer to the application when the initialization sequence is completed and the device is ready to start advertising EVT HT TEMPERATURE CHAR UPDATE CMPLT this event is sent to the application when an update to the temperature measurement characteristic previously started by the application completes The status indicates whether the update was successful or it failed EVT HT INTERMEDIATE TEMP CHAR UPDATE CMPLT this event is sent to the application when an update to the intermediate temperature measurement characteristic previously started by the application completes The status indicates whether the update was successful or it failed EVT HT MEASUREMENT INTERVAL RECEIVED this event is sent to the application when the collector writes to the measurement interval characteristic EVT HT MEASUREMENT INTERVAL UPDATE CMPLT this event is sent to the application when an update to the measurement interval characteristic previously started by the application completes The status indicates whether the update was successful or it failed EVT BPS IDLE CONNECTION TIMEOUT this event is sent to the application when there are no measurements to be sent to the collector for more than five seconds DoclD02638
14. UM1770 Application profile interface 5 7 Find me locator events 1 EVT FML INITIALIZED this event is sent by the find me locator to the application when the initialization sequence is completed and the device is ready to start advertising 2 EVT DISCOVERY this event is sent by the find me locator after a connection is established The evtData contains the error code 0x00 all the mandatory services characteristics and descriptors as specified in the profile specification were discovered successfully 0x01 alert characteristic not found 0x02 immediate alert service not found 5 8 Phone alert client events d 1 EVT PAC INITIALIZED this event is sent by the phone alert client to the application when the initialization sequence is completed and the device is ready to start advertising EVT DISCOVERY CMPLT this event is sent by the phone alert client after connection is established The evtData contains the error code 0x00 all the mandatory services characteristics and descriptors as specified in the profile specification were discovered successfully 0x01 PHONE ALERT SERVICE NOT FOUND 0x02 PHONE ALERT STATUS NOT FOUND 0x03 RINGER CNTRL POINT FOUND 0x04 RINGER SETTING CHARAC NOT FOUND 0x05 PHONE ALERT STATUS DESC NOT FOUND 0x06 RINGER CNTRL POINT DESC NOT FOUND 0x07 RINGER SETTING DESC FOUND EVT PAC AL
15. UM1770 Profile application interface functions Parameters 1 length the Length of the characteristic to be updated 2 hardwareRev the Characteristic value 6 9 6 BLE Profile Update DIS SoftwareRev Description The application calls this to update the Software Revision characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 SsoftwareRev the Characteristic value 6 9 7 BLE Profile Update DIS manufacturerName Description The application calls this to update the Manufacture Name characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 name the Characteristic value to be written or updated 6 9 8 BLE Profile Update DIS IEEECertification Description The application calls this to update the IEEE Certification characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 ieeeCert the Characteristic value 6 9 9 BLE Profile Update DIS pnpld d Description The application calls this to update the pnplD characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 pnpld the Characteristic value to be written or updated DoclD026385 Rev 2 45 56 Profile application interface functions UM1770 6 10 6 10 1 6 10 2 6 10 3 Proximity profile Proxim
16. its connected peer The alert should continue until another event with alert level 0 is issued DoclD026385 Rev 2 15 56 Application profile interface UM1770 5 4 5 5 5 6 16 56 Proximity monitor events 1 EVT_PM_INITIALIZED this event is sent by the proximity monitor to the application when the initialization sequence is completed and the device is ready to start advertising EVT PM DISCOVERY CMPLT this event is sent by the proximity monitor after a connection is established The evtData contains the error code 0x00 all the mandatory services characteristics and descriptors as specified in the profile specification were discovered successfully 0x01 link loss service not found EVT PM LINK LOSS ALERT this event is sent to the application when a link loss is detected The evtData contains the alert level The application must start an alert for the level specified The type of alert is decided by the application the alert can continue for an application specific duration or until another connection is established The application must re enable advertising to establish a new connection EVT PM PATH LOSS ALERT this event is sent to the application by the proximity monitor when a path loss is detected The evtData contains the alert level When a path loss is detected the application can start an alert of any type for the alert level specified HID events 1 EVT HID INITIALIZED
17. static and updates are not allowed On successful update the event HT TEMP TYPE CHAR UPDATE CMPLT is sent to the application Parameters 1 Type the type denotes the part of the body where the temperature is measured below is the list of the type fields TEMP MEASURED AT ARMPIT 0x01 TEMP MEASURED FOR BODY 0x02 TEMP MEASURED AT EAR 0x03 TEMP MEASURED AT FINGER 0x04 TEMP MEASURED AT GASTRO INTESTINAL TRACT 0x05 TEMP MEASURED AT MOUTH 0x06 TEMP MEASURED AT RECTUM 0x07 TEMP MEASURED AT 0x08 TEMP MEASURED AT TYMPANUM 0x09 HT StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Alert Notification profile Alert Notification Client ANC Client Init Description Initializes the Alert Notification Profile It returne BLE STATUS SUCCESS if the procedure is started successfully Notification of successful initialization of the profile is sent to the application through the event EVT ANC INITIALIZED 2 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 4 2 6 4 3 d Parameters e BLE CALLBACK FUNCTION TYPE callback function called by the profile to notify the application of the events ANC Advertize Description The function puts the device into discov
18. this event is sent to the application when the HID has completed its initialization sequence and is ready to enable advertising or the initialization sequence failed The evtData parameter contains the error code 0 00 means the initialization was successful EVT HID UPDATE CMPLT this event is sent to the application when an update previously started by the application completes The status indicates whether the update was successful or it failed The evtData also contains the service handle and the characteristic handle EVT LEVEL READ this event is sent to the application when the client requests a battery level reading On receiving this event the application can update the battery level characteristic and then call the function Allow BatteryLevel Char Read If the process takes more than 30 minutes the GATT channel is closed Find me target events 1 EVT FMT INITIALIZED this event is sent to the application when the find me target has completed its initialization sequence and is ready to enable advertising or the initialization sequence failed The evtData parameter contains the error code 0 00 means the initialization was successful EVT FMT ALERT this event is sent to the application when the client writes to the alert level characteristic with a valid alert level The application must start alerting if the alert level is 0x01 or 0x02 and stop when the alert level is 0x00 d DoclD026385 Rev 2
19. update for the battery level characteristic On successful update the application is notified through the event EVT BATTERY LEVEL UPDATE CMPLT Parameters 1 batteryServicelndex the battery service whose characteristic must be updated 2 BatteryLevel value of the battery level characteristic 6 6 8 HidDevice Update Scan Refresh Char Description This is called by the application to start the update for the scan refresh characteristic On successful update the application is notified through the event EVT SCAN REFRESH UPDATE CMPLT Parameters 1 scanRefresh the value of the scan refresh characteristic 6 6 9 Allow BatteryLevel Char Read Description This is called by the application when it receives an event EVT BATT LEVEL READ REQ from the profile When LEVEL READ REQ is received the application should first update the battery level characteristic if required and then call this function The stack blocks the read response until this function is called by the application For more details see the event description for EVT BATT LEVEL READ REQ Parameters 1 batteryServicelndex the battery service whose characteristic must be updated 6 6 10 HIDProfile StateMachine d Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None DoclD026385 Rev 2 37 56 Profile application in
20. was issued successfully Parameters 1 useBoundedDeviceList if this is set to 1 advertising is performed on the devices already bonded using whitelist HidDevice Update Input Report Description This is called by the application to update the input report characteristic with the value specified in ipReportValue It returns BLE STATUS SUCCESS if the update was successfully started otherwise it returns error codes On successful update of the characteristic the application is notified through the event HID UPDATE CMPLT Parameters 1 hidServicelndex the index of the HID service whose report characteristic has to be updated 2 lpReportindex the index of the input report to be updated ipReportValLength length of the input report 4 ipReportValue value of the input report e DoclD026385 Rev 2 35 56 Profile application interface functions UM1770 6 6 4 6 6 5 6 6 6 36 56 HidDevice Update Feature Report Description This is called by the application to update the feature report characteristic with the value specified in ftrReportValue It returns BLE STATUS SUCCESS if the update was successfully started otherwise it returns error codes On successful update of the characteristic the application is notified through the event EVT HID UPDATE CMPLT Parameters 1 hidServicelndex the index of the HID service whose report characteristic has to be updated 2 ftrReportlIndex
21. 0x0001 GLUCOSE SENSOR STATUS ANNUNCIATION SENSOR MALFUNCTION 0x0002 GLUCOSE SENSOR STATUS ANNUNCIATION SAMPLE SIZE 0x0004 GLUCOSE SENSOR STATUS ANNUNCIATION STRIP INSERTION ERROR 0x0008 GLUCOSE SENSOR STATUS ANNUNCIATION STRIP TYPE INCORRECT 0x0010 GLUCOSE SENSOR STATUS ANNUNCIATION SENSOR RESULT TOO HIGH 0x0020 GLUCOSE SENSOR STATUS ANNUNCIATION SENSOR RESULT TOO LOW DoclD026385 Rev 2 49 56 Profile application interface functions UM1770 6 11 5 50 56 0x0040 h GLUCOSE_SENSOR_STATUS_ANNUNCIATION_SENSOR_TEMPERATURE_TO O_HIGH 0x0080 i GLUCOSE_SENSOR_STATUS_ANNUNCIATION_SENSOR_TEMPERATURE_TO O_LOW 0x0100 j GLUCOSE SENSOR STATUS ANNUNCIATION SENSOR READ INTERRUPTE D 0x0200 GLUCOSE SENSOR STATUS ANNUNCIATION GENERAL DEVICE FAULT 0x0400 GLUCOSE SENSOR STATUS ANNUNCIATION TIME FAULT 0x0800 GL Send Glucose Measurement Context Description This function is used to update the glucose measurement context characteristic value The function is only called as consequence of the reception of a record access control point command requesting the notification of one or more glucose measurement based on the glucose sensor database stored measurements if the associated glucose measurement characteristic includes contextual information Parameters e glucoseMeasurementContextVal the glucose measurement context value structure containing the following members d DoclD02638
22. 11 6 8 12 6 8 13 42 56 TimeServer_Make_Discoverable Description The command puts the device into discoverable mode BLE_STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters 1 useBoundedDeviceList this is set to 1 if advertising is to be done to the devices already bonded TimeServer_Update_Current_Time_Value Description This is called by the application to update the current time characteristic with the timeValue On completion of the update the application is notified through the event EVT TS CHAR UPDATE CMPLT Parameters timeValue current time structure containing the following structure members year month date hours minutes seconds day of week fractions256 adjustReason the adjust reason parameter can take any of the below values a ADJUST REASON NO REASON 0x00 b ADJUST REASON MANUAL TIME UPDATE 0x01 c ADJUST REASON EXTERNAL REFERENCE TIME UPDATE 0x02 d ADJUST REASON CHANGE OF TIME ZONE 0x04 e ADJUST REASON CHANGE OF DST 0x08 TimeServer Update Local Time Information Description This is called by the application to update the localTimelnfo characteristic with the value specified and notifies the application with the EVT TS CHAR UPDATE CMPLT event on successful update Parameters e localTimelnfo local time structure containing the following structure members ti
23. 5 Rev 2 UM1770 Profile application interface functions 2 flags field these flags define which data fields are present in the Characteristic value h GLUCOSE MEASUREMENT CONTEXT FLAG CARBOHYDRATE IS PRESEN T 0x01 GLUCOSE MEASUREMENT CONTEXT FLAG MEAL IS PRESENT 0x02 GLUCOSE MEASUREMENT CONTEXT FLAG TESTER HEALTH IS PRESEN T 0x04 GLUCOSE MEASUREMENT CONTEXT FLAG EXERCISE DURATION IS PR ESENT 0x08 GLUCOSE MEASUREMENT CONTEXT FLAG MEDICATION ID 15 PRESENT 0x10 GLUCOSE MEASUREMENT CONTEXT FLAG MEDICATION LITER UNITS 0x20 GLUCOSE MEASUREMENT CONTEXT FLAG HB1A1C IS PRESENT 0x40 GLUCOSE MEASUREMENT CONTEXT FLAG EXTENDED IS PRESENT 0x80 sequenceNumber field sequence number of the glucose measurement context value same as the associated glucose measurement value extendedFlags field optional field carbohydrateld field a b a Oo f 9 GLUCOSE_MEASUREMENT_CONTEXT_CARBOHYDRATE_BREAKFAST 0x01 GLUCOSE MEASUREMENT CONTEXT CARBOHYDRATE LUNCH 0x02 GLUCOSE MEASUREMENT CONTEXT CARBOHYDRATE DINNER 0x03 GLUCOSE MEASUREMENT CONTEXT CARBOHYDRATE SNACK 0x04 GLUCOSE MEASUREMENT CONTEXT CARBOHYDRATE DRINK 0x05 GLUCOSE MEASUREMENT CONTEXT CARBOHYDRATE SUPPER 0x06 GLUCOSE MEASUREMENT CONTEXT CARBHYDRATEO BRUNCH 0x07 carbohydrateUnits field units of carbohydrate meal field a b Oo GLUCOSE_MEASUREMENT_CONTEXT_MEAL_PREPRANDIAL
24. 5 Rev 2 19 56 Application profile interface UM1770 5 13 5 14 5 15 20 56 Alert notification server events 1 EVT_ANS_INITIALIZED this event is sent by the alert notification server to the application when the initialization sequence has completed and the device is ready to start advertising Alert notification client events 1 EVT_ANC_INITIALIZED this event is sent by the alert notification client to the application when the initialization sequence has completed and the device is ready to start advertising EVT ANC DISCOVERY CMPLT this event is sent by the alert notification client after a connection is established and all the mandatory services characteristics and descriptors as specified in the profile specification were discovered successfully EVT ANC NEW ALERT RECEIVED this event is sent to the application when a notification for the new alert is received by the alert notification client EVT ANC UNREAD ALERT STATUS RECEIVED this event is sent to the application when a notification for an unread alert is received by the alert notification client Glucose sensor events 1 EVT GL INITIALIZED this event is sent by the glucose sensor to the application when the initialization sequence has completed and the device is ready to start advertising EVT GL IDLE CONNECTION TIMEOUT this event is sent to the application when the connection is idle for more than five seconds 2 DoclD026385 Rev 2
25. 6 1 4 22 56 HRProfile_Send_HRM_Value Description This function or command is called by the application to send the heart rate measurement value to the collector The procedure to send a heart rate measurement value returns BLE STATUS SUCCESS if started successfully or BLE STATUS FAILED if not When the measurement value is sent successfully the application is notified through the event EVT HRS CHAR UPDATE CMPLT Parameters e heartRateVal The heart rate measurement structure with the following members 1 valueformat indicates the format of the heart measurement value 0 if UINT8 1 if UINT16 2 sensorContact this field indicates whether the sensor is in contact with the body 0 is no or poor contact 1 contact o k 3 energyExpendedStatus indicates whether the EE field is present in the current characteristic value 0 not present 1 present 4 rrlntervalStatus indicates whether RR interval values are present in the current characteristic value 0 not present 1 present 5 heartRateValue the heart rate measurement value 6 energyExpended the energy expended value 7 numOfRRIntervalvalues the maximum length of RR interval values allowed is nine If the maximum is exceeded then only the last nine will be considered assuming they correspond to the most recent collected data 8 rrintervalValues 9 the buffer to hold the nine 9 most recent RR interval values provided by the applic
26. AILED if not The application is notified of successful initialization of the profile by the event EVT_FML_INITIALIZED through the registered callback Parameters bleSecReq pointer to the structure denoting the security requirements of the profile e BLE CALLBACK FUNCTION TYPE the Callback function to be called to notify the application of the events FML_Advertize Description The command puts the device into discoverable mode BLE_STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully d DoclD026385 Rev 2 UM1770 Profile application interface functions 6 2 7 6 2 8 6 2 9 6 3 6 3 1 2 FML_Add_Device_To_WhiteList Description This function or command is called by the application to add devices to the whitelist Parameters e addrType address type of the bdAddr to be added to the whitelist 0x00 PUBLIC ADDRESS 0x01 RANDOM ADDRESS e bdAddr address of the peer device that must be added to the whitelist FML_Alert_Target Description The function is called by the application to start a write to the alert level on the find me target It returns BLE STATUS SUCCESS if the procedure is started successfully otherwise it returns an error Parameters alertLevel the alert level for the target must be configured according to the following alert levels NO ALERT 0x00 MILD ALERT 0x01 HIGH ALERT 0x02 FMTPr
27. Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None 3 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 6 6 6 1 6 6 2 6 6 3 d Human interface device profile HidDevice Init Description Initializes the Hid profile It returns BLE STATUS SUCCESS if the procedure is started successfully or BLE STATUS FAILED if not The application is notified through the event EVT HID INITIALIZED on successful initialization Parameters 1 numoOfHlDServices number of HID services to be exposed in the profile 2 HidServiceData pointer to the structure tApplDataForHidServ containing the configuration parameters provided by the application at the time of Initialization 3 NumoOfBatteryServices number of battery services to be exposed in the profile 4 SscanParamServiceSupport adds the scan parameters service during hid initialization if set to 1 5 scanRefreshCharSupport adds the scan parameters refresh characteristics if set to 1 6 BLE CALLBACK FUNCTION TYPE callback function type to be called by the profile to notify the application of the events HidDevice Make Discoverable Description The function puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode
28. ERT STATUS the application can start a procedure to read the alert status characteristic on the peer server using the function PAC Read AlertStatus The response to this function call is returned in this event The evtData contains the response received from the server EVT PAC RINGER SETTING the application can read the ringer setting on the server by using the function Read RingerSetting The response to this function call is returned in this event The evtData contains the response received from the server DoclD026385 Rev 2 17 56 Application profile interface UM1770 5 9 5 10 18 56 Time server events 1 EVT_TS_INITIALIZED this event is sent by the time server to the application when the initialization sequence has completed and the device is ready to start advertising EVT TS CHAR UPDATE CMPLT this event is sent to the application when update previously started by the application completes The status indicates whether the update was successful or it failed The evtData also contains the service handle and the characteristic handle EVT TS START REFTIME UPDATE this event is sent to the application when the GET REFERENCE UPDATE 0x01 command is written to the updateState characteristic by the time client EVT TS STOP REFTIME UPDATE this event is sent to the application when the CANCEL REFERENCE UPDATE 0x02 command is written to the updateState characteristic by the time client Time c
29. Low Energy Bluetooth Specification specification Specification of the Bluetooth system V4 0 UM1755 BlueNRG Bluetooth LE stack application command interface ACI User Manual UM1686 BlueNRG Development Kits User Manual USB Universal serial bus 54 56 DoclD026385 Rev 2 Ly UM1770 Revision history 8 Revision history Table 3 Document revision history Date Revision Changes 26 Aug 2014 1 Initial release Ported profiles to simplified ACI framework the one 04 Dec 2014 provided within the BlueNRG DK SW package Ly DoclD026385 Rev 2 55 56 UM1770 IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections enhancements modifications and improvements to ST products and or to this document at any time without notice Purchasers should obtain the latest relevant information on ST products before placing orders ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement Purchasers are solely responsible for the choice selection and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST products with provisions different from the information set forth herein shall void any war
30. PPL MESG DBG profiledbgfile Initialized Heart Rate Profile n e Heart rate profile callback function HRProfile Rx Event Handler This function allows Heart Rate profile to properly handling the BlueNRG events according to the profile state DoclD026385 Rev 2 11 56 BlueNRG profile framework UM1770 4 BlueNRG profile framework The BlueNRG profile framework consists of the following main components 1 Profile library Profile Library Release a file release version Profile Library Debug a file debug version with debug messages This library provides supports for each of the following profiles GAP peripheral role Alert Notification Client Alert Notification Server Blood Pressure Sensor Find Me Locator Find Me Target Glucose Sensor Health Thermometer Hearth Rate Phone Alert Proximity Monitor Proximity Reporter Time Client Time Server Main profile file it provides the common profile framework to all the profiles and it implements the BlueNRG events callback HCl Event CB void pckt Generic profile interface header files a ble events h it defines the generic and profiles specific events b ble profile h main profile header file ble status h profile status and error codes a Oo debug h function for specific profile debug messages host config h define values for selecting each specific supported profile through the BLE CURRENT PROFILE ROLES defi
31. TATUS FAILED if not The application is notified through the event EVT BPS INITIALIZED on completion of the initialization procedure Parameters 1 intermediateCuffPressureChar indicates whether the blood pressure service should support the intermediate cuff pressure characteristic 2 Feature a bitmask representing the features supported by the device Below is the list of the features supported by the device BODY MOVEMENT DETECTION FLAG 0x01 CUFF FIT DETECTION FLAG 0x02 RREGULAR PULSE DETECTION FLAG 0x04 PULSE RATE RANGE EXCEEDS UPPER LIMIT 0x08 PULSE RATE RANGE BELOW LOWER LIMIT 0x10 MEASUREMENT POSITION DETECTION FLAG 0x20 3 BLE CALLBACK FUNCTION TYPE callback function type to be called by the profile to notify the application of the profile specific events BPS Advertize Description The function puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters useWhitelist if useWhiteList is set to TRUE the device is configured to use the whitelist which is configured with bonded devices at the time of initialization otherwise the device enters limited discoverable mode to connect to any of the available devices DoclD026385 Rev 2 33 56 Profile application interface functions UM1770 6 5 3 6 5 4 6 5 5 34 56 BPS Send Intermediate Cuff Pressure Descrip
32. alue The value read is returned via the event EVT PAC ALERT STATUS to the application through the callback DoclD026385 Rev 2 Ly UM1770 Profile application interface functions 6 7 6 6 7 7 6 8 6 8 1 6 8 2 d Read RingerSetting Description When this function is called by the application the profile starts a GATT procedure to read the characteristic value The value read is returned via the event EVT PAC RINGER SETTING to the application PACProfile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Time profile Time profile Client TimeClient Init Description Initializes the time profile in client role The application is notified through the event EVT TC INITIALIZED on successful initialization Parameters 1 BLE CALLBACK FUNCTION TYPE callback function to be called by the profile to notify the application of the events TimeClient Make Discoverable Description The command puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully DoclD026385 Rev 2 39 56 Profile application interface functions UM1770 Parameters 1 useBoundedDeviceList set this to 1 if advertising is to be performed on the devices alr
33. application DoclD026385 Rev 2 43 56 Profile application interface functions UM1770 6 9 1 6 9 2 6 9 3 6 9 4 6 9 5 44 56 BLE_Profile_Update_DIS_SystemID Description The application calls this to update the System ID characteristic of the device information service Parameters 1 length the Length of the characteristic to be updated 2 the Characteristic value BLE Profile Update DIS ModelNum Description The application calls this to update the Model Number characteristic of device information service Parameters 1 length The Length of the characteristic to be updated 2 modelNum The Characteristic value BLE Profile Update DIS SerialNum Description The application calls this to update the Serial Number characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 SserialNum the Characteristic value BLE Profile Update DIS FirmwareRev Description The application calls this to update the Firmware Revision characteristic of device information service Parameters 1 length the Length of the characteristic to be updated 2 firmwareRev the Characteristic value to be written or updated BLE Profile Update DIS HardwareRev Description The application calls this to update the Hardware Revision characteristic of device information service DoclD026385 Rev 2 Ly
34. ate Feature 36 6 6 5 HidDevice Update Boot Keyboard Input Report 36 6 6 6 HidDevice Update Boot Mouse Input Report 36 6 6 7 HidDevice Update Battery Level 37 6 6 8 HidDevice Update Scan Refresh Char 37 6 6 9 Allow BatteryLevel Char Read 37 6 6 10 HIDProfile StateMachine 37 6 7 Phone alert profile 38 6 7 1 Seva pete ea dee or E ede ied eda 38 6 7 2 Add Device To WhiteList 38 6 7 3 Advertize 38 6 7 4 Configure 38 6 7 5 PAC Read AlertStatus 38 6 7 6 Read 0 39 6 7 7 PACProfile StateMachine 39 6 8 Time 39 Time profile 39 6 8 1 TimeClient 39 6 8 2 TimeClient Make Discoverable 39 6 8 3 TimeClient Get Current Time 40 6 8 4 TimeClient Get Local Time Information
35. ation HRProfile Set Sensor Contact Support Bit Description The application should call this function before sending any data to the device in order to enable the sensor contact bit BODY SENSOR LOCATION SUPPORT MASK to include sensor contact information value in the heart rate measurement It returns BLE STATUS SUCCESS when successfully set and BLE STATUS FAILED when not set HRProfile Set Body Sensor Location Description Updates the body sensor location characteristic with the value provided This should be called by the application when not in a connection it returns BLE STATUS SUCCESS if successful DoclD026385 Rev 2 Ly UM1770 Profile application interface functions Parameters bdsValue The position of the body sensor location The valid sensor location values BODY SENSOR LOCATION OTHER 0x00 BODY SENSOR LOCATION CHEST 0x01 BODY SENSOR LOCATION WRIST 0x02 BODY SENSOR LOCATION FINGER 0x03 BODY SENSOR LOCATION HAND 0x04 BODY SENSOR LOCATION EAR LOBE 0 05 BODY SENSOR LOCATION FOOT 0x06 6 1 6 HRProfile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None 6 2 Find me profile Find me Target 6 2 1 FindMeTarget Init Description The application calls this function to initialize the find me target profile The initialization procedure retur
36. ction Event Handler through the profile Init function Following are more details about the main profile framework profile c key functions e BLE Profile Init It initializes the main profile e BLE Profiles Evt Notify Cb it is the main profile callback function which is called by each profile to notify the profile specific events to the main profile application Based on such events main profile application can decide which actions to take in order to handle the specific profile events This function is provided to each profile when the related Init API is called e BLE Profile Register Profile it allows registration of each profile callback it is called within the profile initialization function named Init function Profile specific example heart rate profile Heart rate profile header file heart_rate h file e Heart rate profile initialization function HRProfile_Init This function performs the following operations e Set the main profile callback function for notifying profile specific events to the main profile application e Set the heart rate profile HRProfile Rx Event Handler callback function e Register the heart rate with BLE main Profile DoclD026385 Rev 2 Ly UM1770 Execution context d The HRProfile Init function is called on the profile main application as follow if HRProfile Init uint8 t OxFF BLE Profiles Evt Notify Cb 0x04 BLE STATUS SUCCESS A
37. e since the application is not aware of the handles EVT HRS RESET ENERGY this event is sent to the application when the peer writes a value of 0x01 to the control point characteristic This event has no parameters The application must restart accumulating the energy expended values from 0 Proximity reporter events The events under this category are those which are sent by the proximity profile in the reporter role to the application 1 EVT PR INITIALIZED this event is sent to the application when the proximity reporter has completed its initialization sequence and is ready to enable advertising or the initialization sequence failed The evtData parameter contains the error code 0 00 means the initialization was successful EVT PR LINK LOSS ALERT this event is sent to the application when a link loss is detected The evtData contains the alert level The application must start an alert for the level specified The type of alert is decided by the application the alert can continue for an application specific duration or until another connection is established The application must re enable advertising to establish a new connection EVT PR PATH LOSS ALERT this event is sent to the application by the proximity reporter when a path loss is detected The evtData contains the alert level When a path loss is detected an alert of any type must be started the desired user action would be to move the device closer to
38. e to notify the application of the profile specific events 2 immAlertTxPowerSupport set this to a non zero value if the TX power level and immediate alert services are to be exposed by the profile otherwise set it to 0 ProximityReporter Make Discoverable Description The command puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters 1 useBoundedDeviceList set this to 1 if advertising is to be performed on the devices already bonded ProximityReporterProfile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Glucose sensor profile GL Init Description Initializes the Glucose Sensor Profile It returns BLE STATUS SUCCESS if the procedure is started successfully and then notifies the application of successful initialization of the profile through the event EVT GL INITIALIZED Parameters sequenceNumber initial sequence number value number of stored records on glucose measurement database e gl measurement db records pointer to user glucose measurement database e gl measurement context db records pointer to user glucose measurement context database e BLE CALLBACK FUNCTION TYPE callback function to be called by the profile to notify t
39. eady bonded 6 8 3 TimeClient_Get_Current_Time Description The application calls this function to read the current time characteristic Once the read is complete the read value is sent to the application through an event EVT_TC_READ_CUR_TIME_CHAR The event data contains the following fields 1 byte 0 and 1 year 2 byte2 month 3 byte3 date 4 byte4 hours 5 byte5 minutes 6 byte6 seconds 7 byte 7 of week 8 byte8 fractions256 9 byte9 adjust reason 6 8 4 TimeClient Get Local Time Information Description The application calls this function to read the local time information characteristic Once the read is complete the read value is sent to the application through an event called EVT TC READ LOCAL TIME INFO CHAR 6 8 5 TimeClient Get Time Accuracy Info Of Server Description The application calls this function to read the reference time information characteristic Once the read is complete the read value is sent to the application through an event called EVT TC READ REF TIME INFO CHAR 6 8 6 TimeClient Get Next DST Change Description The application calls this function to read the time with DST information characteristic on the server Once the read is complete the read value is sent to the application through an event called EVT TC READ TIME WITH DST CHAR d 40 56 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 8 7
40. ediate Temperature Description The application calls this function to update the intermediate temperature measurement characteristic The application is notified through the event EVT HT INTERMEDIATE TEMP CHAR UPDATE CMPLT when the update completes Parameters 1 flags bitmask of the fields supported in the characteristic Refer to Section 6 3 3 HT Send Temperature Measurement for valid values 2 Temperature temperature measurement value timestamp timestamp of the measurement 4 temperatureType temperature type Refer to Section 6 3 3 HT Send Temperature Measurement for valid values pa HT Update Measurement Interval Description The application calls this to update the measurement interval value characteristic This is the interval between the temperature updates sent to the collector On completion of the update the application is notified through the event EVT HT MEASUREMENT INTERVAL UPDATE CMPLT Parameters Interval the gap interval after which the update of the measurement value is to be performed DoclD026385 Rev 2 27 56 Profile application interface functions UM1770 6 3 6 6 3 7 6 4 6 4 1 28 56 HT_Update_Temperature_Type Description The application calls this to update the temperature type characteristic The temperature type indicates the part of the body where the temperature is being measured During an active connection this setting must remain
41. eld units of kilograms or liters HbA1c field GL Set Glucose Feature Value Description This function is used to set the glucose feature characteristic value GL StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None d DoclD026385 Rev 2 UM1770 Profile application interface functions Parameters e value glucose feature value a GLUCOSE FEATURE LOW BATTERY DETECTION IS SUPPORTED 0x0001 b GLUCOSE FEATURE SENSOR MALFUNCTION DETECTION 15 SUPPORTE D 0x0002 c GLUCOSE FEATURE SAMPLE SIZE IS SUPPORTED 0 0004 d GLUCOSE FEATURE SENSOR STRIP INSERTION ERROR IS SUPPORTED 0x0008 e GLUCOSE FEATURE SENSOR STRIP TYPE ERROR IS SUPPORTED 0x0010 f GLUCOSE FEATURE SENSOR RESULT HIGH LOW DETECTION IS SUPPO RTED 0x0020 g GLUCOSE FEATURE SENSOR TEMPERATURE HIGH LOW DETECTION IS J SUPPORTED 0x0040 h GLUCOSE FEATURE SENSOR READ INTERRUPT DETECTION IS SUPPOR TED 0x0080 i GLUCOSE FEATURE GENERAL DEVICE FAULT IS SUPPORTED 0 0100 j GLUCOSE FEATURE TIME FAULT 15 SUPPORTED 0 0200 k GLUCOSE FEATURE MULTIPLE BOND IS SUPPORTED 0x0400 3 DoclD026385 Rev 2 53 56 List of references UM1770 7 List of references Table 2 References Name ACI Title Application Command Interface BLE Bluetooth
42. erable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters e useWhitelist if the useWhiteList is set to TRUE the device is configured to use the whitelist which is configured with bonded devices at the time of initialization otherwise the device enters limited discoverable mode to connect to any of the available devices ANC Write Control Point Description The application calls this to write or update the control point characteristic The application is notified through the event on successful update Parameters 1 Command ID of the command to be sent Below is the list of the different command IDs ENABLE NEW ALERT NOTIFICATION 0x00 ENABLE UNREAD ALERT STATUS NOTIFICATION 0x01 DISABLE NEW ALERT NOTIFICATION 0x02 DISABLE UNREAD ALERT STATUS NOTIFICATION 0x03 NOTIFY NEW ALERT IMMEDIATELY 0x04 NOTIFY UNREAD ALERT STATUS IMMEDIATELY 0x05 2 Category ID category which has to be affected by the command Below is the list of the category IDs CATEGORY ID SIMPLE ALERT 0x00 CATEGORY ID EMAIL 0x01 CATEGORY ID NEWS 0x02 CATEGORY ID CALL 0x03 CATEGORY ID MISSED CALL 0x04 CATEGORY ID SMS 0x05 CATEGORY ID VOICE 0x06 CATEGORY ID SCHEDULE 0x07 CATEGORY ID HIGH PRIORITIZED ALERT 0x08 CATEGORY ID INSTANT MESSAGE 0x09 DoclD026385 Rev
43. files Evt Notify Cb as one of the initialization parameters It defines the while 1 loop where the process Profile Process and profile specific state machine StateMachine functions are processed It allows to enter amp process specific user commands through serial I O in order to interact with each profile and performs specific actions i e ask to profile to notify indicate a characteristic Such user input commands are used during profile PTS validation tests The supported user input commands are defined within the profiles test application c file An EWARM project defining a workspace for each supported profile and including the profile library is available By selecting the specific profile workspace a profile test application supporting the selected profile is built This application can be used for validating the profile using the PTS USB dongle and related Bluetooth PTS SW tool d DoclD026385 Rev 2 13 56 Application profile interface UM1770 5 5 1 14 56 Application profile interface Function calls handle the communication between the application and profiles Any application using the profiles should first initialize the base profile by calling the BLE_Profile_Init function followed by a call to the profile specific initialization function For example HRProfile_Init function is called for the heart rate profile To enable execution the application requires a loop that calls
44. gs define which data fields are present in the Characteristic value GLUCOSE MEASUREMENT FLAGS TIME OFFSET IS PRESENT 0x01 GLUCOSE MEASUREMENT FLAGS CONCENTRATION 15 PRESENT 0x02 GLUCOSE MEAUREMENTS FLAG MMOL L UNITS 0x04 GLUCOSE MEASUREMENT FLAGS STATUS ANNUNCIATION IS PRESENT 0x08 sequenceNumber field sequence number of the glucose measurement value tBasetime baseTime time of the measurement timeOffset field time component used to define the overall user facing time glucoseConcentration glucose concentration field SFLOAT units of Kg or Liters typeSampleLocation Field measurement type and sample location information type nibble a oO sa gt gt j GLUCOSE_TYPE_CAPILLARY_WHOLE_BLOOD 0x1 GLUCOSE_TYPE_CAPILLARY_PLASMA 0x2 GLUCOSE_TYPE_VENOUS_WHOLE_BLOOD 0x3 GLUCOSE_TYPE_VENOUS_PLASMA 0x4 GLUCOSE_TYPE_ARTERIAL_WHOLE_BLOOD 0x5 GLUCOSE_TYPE_ARTERIAL_PLASMA 0x6 GLUCOSE_TYPE_UNDERTERMINED_WHOLE_BLOOD 0x7 GLUCOSE_TYPE_UNDERTERMINED_PLASMA 0x8 GLUCOSE_TYPE_INTERSISTIAL_FLUID 0x9 GLUCOSE_TYPE_CONTROL 0xA sampleLocation nibble a b d e GLUCOSE SAMPLE LOCATION FINGER 0x10 GLUCOSE SAMPLE LOCATION AST 0x20 GLUCOSE SAMPLE LOCATION EARLOBE 0x30 GLUCOSE SAMPLE LOCATION CONTROL SOLUTION 0x40 GLUCOSE SAMPLE LOCATION VALUE NOT AVAILABLE 0xF0 sensorStatusAnnunciation field GLUCOSE SENSOR STATUS ANNUNCIATION DEVICE BATTERY LOW
45. he application of the events DoclD026385 Rev 2 47 56 Profile application interface functions UM1770 6 11 2 6 11 3 6 11 4 48 56 GL_Advertize Description This command puts the device into discoverable mode BLE_STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters e useWhitelist If the useWhiteList is set to TRUE the device is configured to use the whitelist which is configured with bonded devices at the time of initialization otherwise the device enters limited discoverable mode to connect to any of the available devices GL_ResetFlags This function allows resetting of the initialization flags for the glucose sensor Parameters sequenceNumber last stored sequence number on database GL_Send_Glucose_Measurement Description This function is used to update the glucose measurement characteristic value The function is only called as consequence of the reception of a record access control point command requesting the notification of one or more glucose measurements based on the glucose sensor database stored measurements Parameters glucoseMeasurementVal the glucose measurement value structure containing the following members d DoclD026385 Rev 2 UM1770 Profile application interface functions 2 NO ak record_status_flag flag to identify the glucose database record status flags field these fla
46. imited discoverable mode to connect to any of the available devices ANS Update New Alert Category Description The application calls this to update the alert category characteristic with the new bitmask It returns BLE STATUS SUCCESS if the update is successfully started and BLE STATUS INVALID PARAMS if a bitmask for an invalid category is requested Parameters 1 Length length of the category field it must be 0 or 1 2 Category bitmask of the categories supported The bitmasks are split across two octets with the meanings described in the bluetooth assigned numbers documentation DoclD026385 Rev 2 31 56 Profile application interface functions UM1770 6 4 10 6 4 11 6 4 12 32 56 ANS Update Unread Alert Category Description The application calls this to update the unread alert category with the new bitmask It returns BLE STATUS SUCCESS if the update is successfully started and BLE STATUS INVALID PARAMS if a bitmask for an invalid category is set Parameters 1 Length length of the category field it must be 0 or 1 2 Category bitmask of the categories supported The bitmasks are split across two octets with the meanings described in the bluetooth assigned numbers documentation ANS Update New Alert Description The application calls this to update the number of new alerts for the category specified in the new alert characteristic If the category ID specified is not valid or the text inf
47. ity monitor ProximityMonitor Init Description Initializes the proximity profile in the monitor role It returns BLE STATUS SUCCESS if the procedure is started successfully and notifies the application through the event EVT PM INITIALIZED Parameters 1 BLE CALLBACK FUNCTION TYPE the callback function to be called by the profile to notify the application of the profile specific events ProximityMonitor Make Discoverable Description The command puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters 1 useBoundedDeviceList set this to 1 if advertising is to be performed on the devices already bonded ProximityMonitorProfile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Proximity reporter 6 10 4 46 56 ProximityReporter Init Description Initializes the proximity profile in reporter role Returns BLE STATUS SUCCESS if the procedure is started successfully and notifies the application through the event EVT PR INITIALIZED d DoclD026385 Rev 2 UM1770 Profile application interface functions 6 10 5 6 10 6 6 11 6 11 1 2 Parameters 1 BLE CALLBACK FUNCTION TYPE the callback function to be called by the profil
48. k function called by the profile to notify the application of the events e AlertCategory bitmask of the categories supported for the new alert characteristic CATEGORY ID SIMPLE ALERT 0x00 DoclD026385 Rev 2 Ly UM1770 Profile application interface functions 6 4 8 6 4 9 d CATEGORY ID EMAIL 0x01 CATEGORY ID NEWS 0x02 CATEGORY ID CALL 0x03 CATEGORY ID MISSED CALL 0x04 CATEGORY ID SMS 5 0x05 CATEGORY ID VOICE MAIL 0x06 CATEGORY ID SCHEDULE 0x07 CATEGORY ID HIGH PRIORITIZED ALERT 0x08 CATEGORY ID INSTANT MESSAGE 0x09 e unreadAlertCategory bitmask of the categories supported for the unread alert status characteristic CATEGORY ID SIMPLE ALERT 0x00 CATEGORY ID EMAIL 0x01 CATEGORY ID NEWS 0x02 CATEGORY ID CALL 0x03 CATEGORY ID MISSED CALL 0x04 CATEGORY ID SMS MMS 0x05 CATEGORY ID VOICE MAIL 0x06 CATEGORY ID SCHEDULE 0x07 CATEGORY ID HIGH PRIORITIZED ALERT 0x08 CATEGORY ID INSTANT MESSAGE 0x09 ANS Advertize Description The function puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully Parameters e useWhitelist if the useWhiteList is set to TRUE the device is configured to use the whitelist which is configured with bonded devices at the time of initialization otherwise the device enters l
49. lient events 1 EVT TC INITIALIZED this event is sent by the time client to the application when the initialization sequence is completed and the device is ready to start advertising EVT TC DISCOVERY CMPLT this event is sent by the time client after a connection is established and all the mandatory services characteristics and descriptors as specified in the profile specification were discovered successfully EVT TC CUR TIME VAL RECEIVED this event is sent to the application when a notification for the current time characteristic is received by the time client The event data contains all the fields of the current time characteristic EVT TC READ CUR TIME CHAR The application can read the current time characteristic on the server by using the function TimeClient Get Current Time The response to this function call is returned in this event The evtData contains the response received from the server EVT TC READ REF TIME INFO CHAR The application can read the reference time characteristic on the server by using the function TimeClient Get Time Accuracy Info Of Server The response to this function call is returned in this event The evtData contains the response received from the server EVT TC READ LOCAL TIME INFO CHAR The application can read the local time information characteristic on the server by using the function TimeClient Get Local Time Information The response to this function call is returned in this event The ev
50. meZone dstOffset d DoclD026385 Rev 2 UM1770 Profile application interface functions 6 8 14 6 8 15 6 8 16 6 9 d TimeServer Update Reference Time Information Description This is called by the application to update the reference time information characteristic with the value specified and the application is notified with the EVT TS START REFTIME UPDATE event on successful update Parameters e refTimelnfo the new reference time information This structure containing the following members source accuracy daysSinceUpdate hoursSinceUpdate TimeServer Update Next DST Change Description This is called by the application to update the next DST change characteristic with the value specified Parameters timeDST the new DST information This structure contains the following members year month date hours minutes seconds dstOffset TimeServer StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Device information service profile Different profiles have different requirements of the characteristics for the device information service The profiles specify the characteristics required during the initialization but the update to these characteristics must be performed by the
51. nition f uuid h profile service amp characteristics UUID as defined in the SIG specification https developer bluetooth org gatt profiles Pages ProfilesHome aspx 9 Profiles interfaces header files Table 1 Profiles interfaces header files Profile Header file Alert Notification Client alertNotification_Client h Alert Notification Server alertNotification_Server h Blood Pressure Sensor blood_pressure h Find Me Locator findme_locator h 12 56 d DoclD026385 Rev 2 UM1770 BlueNRG profile framework Table 1 Profiles interfaces header files Find Me Target Profile Header file findme_target h Glucose Sensor glucose_service h glucose_sensor h glucose_racp h glucose_database h Health Thermometer health_thermometer h Hearth Rate heart_rate h Phone Alert phone_alert_client h Proximity Monitor proximity_monitor h Proximity Reporter proximity_reporter h Time Client time_client h Time Server time_server h time_profile_types h 4 Profile test application for profile PTS validation profiles test application c This file addresses the following features Note Set the profile security parameters and initialize the main profile by defining the main profile callback function Initialize the selected profile through the BLE CURRENT PROFILE ROLES definition by calling the profile Init function with the BLE Pro
52. nker e SPI Layer SPI layer APIs read write from to BlueNRG SPI buffers Note This profile framework only supports peripheral slave roles No multiple profiles are supported at the same time 8 56 DoclD026385 Rev 2 Ly UM1770 ACI framework 2 d ACI framework All the BlueNRG commands are sent to the controller via the ACI framework The ACI framework exposes functions to the upper layers to send the various commands supported by the BlueNRG and to get the events raised from the BlueNRG network coprocessor The ACI framework implements the ACI APIs according to the Bluetooth LE stack application command interface APIS defined on the UM1755 user manual on References Section Three types of events are handled within the profile framework 1 BlueNRG events raised by the BlueNRG network coprocessor refer to UM1755 user manual on Section 7 List of references 2 General profile events which are used by all profiles and are not specific to any profile refer to Section 5 1 Generic events 3 Profile specific events defined by each profile DoclD026385 Rev 2 9 56 Execution context UM1770 3 10 56 Execution context The BlueNRG host profiles framework implements a single task model for execution The entire processing takes place in the ISR context and the main thread context The execution context is a while 1 loop The following functions are processed in this loop 1 Process it
53. ns BLE STATUS SUCCESS if started successfully or BLE STATUS FAILED if not The application is notified of successful initialization of the profile by the event EVT FMT INITIALIZED through the registered callback Parameters e BLE CALLBACK FUNCTION TYPE the callback through which the application is notified of events by the find me 6 2 2 FMT Advertize d Description The command puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode was issued successfully DoclD026385 Rev 2 23 56 Profile application interface functions UM1770 6 2 3 6 2 4 6 2 5 6 2 6 24 56 FMT_Add_Device_To_WhiteList Description This function is called by the application to add devices into the whitelist Parameters e addrType address type of the bdAddr to be added to the whitelist 0x00 PUBLIC ADDRESS 0x01 RANDOM ADDRESS e bdAddr address of the peer device that must be added to the whitelist FMLProfile_StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Find Me Locator FindMeLocator_Init Description The application should call this function to initialize the Find Me Locator Profile The initialization procedure returns BLE STATUS SUCCESS if started successfully or BLE_STATUS F
54. ofile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Health thermometer profile HT Init Description Initializes the health thermometer profile Returns BLE STATUS SUCCESS if the procedure is started successfully and then notifies the application of successful initialization of the profile through the event EVT HT INITIALIZED DoclD026385 Rev 2 25 56 Profile application interface functions UM1770 6 3 2 6 3 3 26 56 Parameters e thermometerFeatures bitmask for the characteristics to be added to the health thermometer service The various bit masks for the characteristics are INTERMEDIATE TEMPERATURE CHAR 0x01 MEASUREMENT INTERVAL CHAR 0x02 TEMPERATURE TYPE 0x04 e minValidInterval the minimum valid interval value for the measurement interval characteristic This is only valid if the MEASUREMENT INTERVAL CHAR flag is set in the thermometer features e maxValidInterval the maximum valid interval value for the measurement interval characteristic e BLE CALLBACK FUNCTION TYPE callback function to be called by the profile to notify the application of the events HT Advertize Description This command puts the device into discoverable mode BLE STATUS SUCCESS is returned if the command to put the device into discoverable mode
55. ormation is longer than 18 octets BLE STATUS INVALID PARAMS is returned On successful write BLE STATUS SUCCESS is returned Parameters 1 alertCount alert count for the category specified The application must maintain the count of new alerts 2 category which is affected by the command 3 Textlnfo textual information corresponding to the alert ANS Update Unread Alert Status Description The application calls this to update the number of unread alerts for the category specified in the new alert characteristic If the category ID specified is not valid BLE STATUS INVALID PARAMS is returned On successful write to the alert status BLE STATUS SUCCESS is returned Parameters 1 categoryID category which is affected by the command 2 AlertCount alert count for the category specified The application must maintain the count of unread alerts 3 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 4 13 6 5 6 5 1 6 5 2 d ANSProfile StateMachine Description The application calls this function for checking current main profile and profile state substate and performing related actions and consequent states updates Parameters None Blood pressure profile BPS Init Description Initializes and registers the blood pressure Sensor profile with the main Profile It returns BLE STATUS SUCCESS if the procedure is started successfully or BLE S
56. performs the processing of any pending events read It is defined on file hci c ACI Framework 2 Profile Process it sends the commands during the initialization or pairing process and updates the main profile state machine It is defined on file profile c main profile file 3 Profile specific state machine it is called for checking current main profile and profile state substate and performing related actions and consequent status updates functions StateMachine void on each specific profile 4 Application state machine it performs application specific handling sending data to profiles enabling advertising displaying to the user etc An example of such function is the Host Profile Test Application defined within the profiles test application c file test application for profile PTS validation The PTS profile validation application profiles test application c provides an example of such processing The BlueNRG events are notified to the main profile application profile c through the Event CB callback which performs the required actions based on main profile state and substate Further the Event CB function notifies the BlueNRG events to a specific profile by calling the profile callback function Event Handler This function is called with the following instruction gMainProfileCtxt bleProfileApplNotifyFunc appNotifEvt 1 amp appNotifStatus Each profile registers its BlueNRG event handler fun
57. ranty granted by ST for such product ST and the ST logo are trademarks of ST All other product or service names are the property of their respective owners Information in this document supersedes and replaces information previously supplied in any prior versions of this document 2014 STMicroelectronics All rights reserved d 56 56 DoclD026385 Rev 2
58. tData contains the response received from the server EVT TC READ TIME WITH DST CHAR The application can read the time with dst change characteristic on the server by using the function TimeClient Get Next DST Change The response to this function call is returned in this event The evtData contains the response received from the server EVT TC READ TIME UPDATE STATE CHAR The application can read the time update state characteristic on the server by using the function TimeClient Get Server Time Update State The response to this function call is returned in this event The evtData contains the response received from the server d DoclD026385 Rev 2 UM1770 Application profile interface 5 11 Blood pressure sensor events 1 EVT_BPS_INITIALIZED this event is sent by the blood pressure sensor to the application when the initialization sequence is completed and the device is ready to start advertising EVT BPS BPM CHAR UPDATE CMPLT this event is sent to the application when an update to the blood pressure measurement characteristic previously started by the application completes The status indicates whether the update was successful or not EVT BPS ICP CHAR UPDATE CMPLT this event is sent to the application when an update to the intermediate cuff pressure characteristic previously started by the application completes The status indicates whether the update was successful or not EVT BPS
59. terface functions UM1770 6 7 6 7 1 6 7 2 6 7 3 6 7 4 6 7 5 38 56 Phone alert profile PAC_Init Description Initializes the Phone Alert Status profile for client role and registers the Phone Alert Profile with the main profile It returns BLE_STATUS SUCCESS if the procedure is successfully started The application is notified through the event EVT_PAC_INITIALIZED on successful initialization Parameters 1 BLE CALLBACK FUNCTION TYPE callback function to be called by the profile to notify the application of the events PAC Add Device To WhiteList Description The application calls this function to add the devices to whitelist Parameters 1 _bdAddr the address of the peer device that must be added to the whitelist PAC Advertize Description The application calls this function to put the device into discoverable mode Configure Ringer Description The application calls this to write the ringer mode to the phone alert server It returns BLE STATUS SUCCESS if the parameters are valid and the procedure has been started successfully otherwise it returns error codes Parameters 1 ringerMode the ringer mode to be set The valid ringer modes are SILENT MODE 0x01 MUTE ONCE 0x02 CANCEL SILENT MODE 0x03 PAC Read AlertStatus Description When this function is called by the application the profile starts a GATT procedure to read the characteristic v
60. the Process and Profile_Process continuously The BLE Profile Init function takes two parameters A pointer to the securityParameters the security parameters should specify the io capabilities mitm mode bonding mode and encryption key size Acallback function the callback registered should be of the form typedef void BLE CALLBACK FUNCTION TYPE tNotificationEvent event uint8 evtLen uint8 evtData This function is used by the profile to notify the application of events When the application is notified of an event it only reads the number of parameters specified in the evtLen parameter Below is the list of events sent by the various profiles to the application Generic events The events in this category are not specific to any profile 1 EVT MP BLUE INITIALIZED this event is sent to the application by the main profile when the controller has been initialized 2 EVT MP CONNECTION COMPLETE this event is sent to the application by the main profile when a connection has been successfully established with the peer 3 EVT MP PASSKEY REQUEST this event is sent to the application by the main profile when there is a request for passkey during the pairing process from the controller This event has no parameters The application must call the function BLE Profile Send Pass Key and send the passkey to the controller 4 EVT MP PAIRING COMPLETE this event is sent to the application by the main profile when the de
61. tion This function is called to send the intermediate cuff pressure values during the measurement process until a stable value is obtained The function can only be used only if the intermediate Cuff Pressure Char is set to True during initialization The application is notified of successful update through the event EVT BPS ICP CHAR UPDATE CMPLT Parameters icpVal the intermediate Cuff pressure value structure containing the following structure members Flags the flags is a bitmask which tells the peer of the data to follow BitO a value of 1 indicates that the unit is kPa a value of 0 indicates that the unit is mm Hg Bit3 a value of 1 implies there is a user ID field in the data Bit4 a value of 1 implies there is a measurement status in the data Icp intermediate cuff pressure value UserID if is set then this field should contain the value of the USER ID MeasurementStatus a structure containing the values of the various bit mask features supported by the device BPS Send Blood Pressure Measurement Description This function is called to send the Blood Pressure measurement values It updates the blood pressure measurement characteristic with the value if the device is connected The application is notified through the event EVT BPS BPM CHAR UPDATE CMPLT Parameters e bpmval the blood pressure value structure The members are similar to those in icpValue BPS StateMachine
62. vice is successfully paired with the peer 5 EVT MP DISCONNECTION COMPLETE this event is sent to the application by the main profile to notify the result of a disconnection procedure initiated by master slave 6 EVT MP ADVERTIZE ERROR this event is sent by any of the child profiles when enabling of advertising fails It is the application s responsibility to restart advertising 7 EVT MP ADVERTISING TIMEOUT this event is sent by the child profiles when the limited discoverable mode times out or the profile specific advertising timeout occurs It is the application s responsibility to restart advertising d DoclD026385 Rev 2 UM1770 Application profile interface 5 2 5 3 d Heart rate profile events The events under this category are those which are sent by the heart rate profile to the application 1 EVT HRS INITIALIZED this event is sent to the application when the heart rate profile has completed its initialization sequence and is ready to enable advertising or the initialization sequence failed The evtData parameter contains the error code 0 00 means the initialization was successful EVT HRS CHAR UPDATE CMPLT this event is sent to the application whenever it has started a characteristic update procedure to update the heart rate measurement or body sensor location The evtData contains the status service handle and characteristic handle This has to be changed to give different events for each updat
63. was issued successfully Parameters useWhitelist If the useWhiteList is set to TRUE the device is configured to use the whitelist which is configured with bonded devices at the time of initialization otherwise the device enters limited discoverable mode to connect to any of the available devices HT Send Temperature Measurement Description The application calls this function to update the temperature measurement characteristic The application is notified through the event EVT HT TEMPERATURE CHAR UPDATE CMPLT when the update is complete Parameters tempMeasurementVal The temperature measurement value structure contains the following members 3 DoclD026385 Rev 2 UM1770 Profile application interface functions 6 3 4 6 3 5 d 1 flags bit mask of the fields supported in the characteristic a FLAG TEMPERATURE UNITS FARENHEIT 0x01 b FLAG TIMESTAMP PRESENT 0x02 c FLAG TEMPERATURE TYPE 0x04 2 Temperature temperature measurement value 4 byte timeStamp timestamp of the measurement 4 temperatureType temperature type a TEMP_MEASURED_AT_ARMPIT 0x01 TEMP_MEASURED_FOR_BODY 0x02 TEMP_MEASURED_AT_EAR 0x03 TEMP_MEASURED_AT_FINGER 0x04 TEMP_MEASURED_AT_GASTRO_INTESTINAL_TRACT 0x05 TEMP_MEASURED_AT_MOUTH 0x06 TEMP_MEASURED_AT_RECTUM 0x07 TEMP_MEASURED_AT_TOE 0x08 TEMP_MEASURED_AT_TYMPANUM 0x09 e o gt Q AU HT Send Interm
Download Pdf Manuals
Related Search
Related Contents
tarjetas de los instrumentos musicales TS-590S - Kenwood マルチ計測器株式会社 instrucciones Layout 3 Manual PCE LS 500 / PCE-LS 3000 Physium MANUEL D`UTILISATION INDICATEUR 2100 climbing stones klimstenen pierres à grimper Klettersteine piedras Copyright © All rights reserved.
Failed to retrieve file