SmartSnippets DA1459x SDK
Data Structures | Macros | Typedefs | Enumerations | Functions
bls.h File Reference

Blood Pressure Service implementation API. More...

#include <stdbool.h>
#include "ble_service.h"
#include "svc_types.h"

Go to the source code of this file.

Data Structures

struct  bls_callbacks_t
 BLS application callbacks. More...
 
struct  bls_measurement_t
 Blood Pressure Measurement. More...
 
struct  bls_config_t
 Blood Pressure Service config used during initialization of service. More...
 

Macros

#define BLS_MEASUREMENT_STATUS(NAME, VALUE)   ( NAME ## _MASK & (VALUE << NAME ## _POS) )
 BLS Measurement Status fields.
 

Typedefs

typedef void(* bls_measurement_indication_changed_cb_t) (ble_service_t *service, uint16_t conn_idx, bool enabled)
 Callback function, called when Pressure Measurement indication was changed by the client. More...
 
typedef void(* bls_measurement_indication_sent_cb_t) (ble_service_t *service, uint16_t conn_idx, bool status)
 Callback function, called when confirmation to Pressure Measurement indication has been received. More...
 
typedef void(* bls_interm_cuff_pressure_notif_changed_cb_t) (ble_service_t *service, uint16_t conn_idx, bool enabled)
 Callback function, called when Intermediate Cuff Pressure notification was changed by the client. More...
 
typedef void(* bls_interm_cuff_pressure_notif_sent_cb_t) (ble_service_t *service, uint16_t conn_idx, bool status)
 Callback function, called when a Cuff Pressure notification has been sent to the client. More...
 

Enumerations

enum  bls_body_movement_t { BLS_BODY_MOVEMENT_NOT_DETECTED = BLS_MEASUREMENT_STATUS(BLS_BODY_MOVEMENT, 0), BLS_BODY_MOVEMENT_DETECTED = BLS_MEASUREMENT_STATUS(BLS_BODY_MOVEMENT, 1) }
 Body Movement Detection Flag. More...
 
enum  bls_cuff_fit_t { BLS_CUFF_FIT_PROPERLY = BLS_MEASUREMENT_STATUS(BLS_CUFF_FIT, 0), BLS_CUFF_FIT_TOO_LOOSE = BLS_MEASUREMENT_STATUS(BLS_CUFF_FIT, 1) }
 Cuff Fit Detection Flag. More...
 
enum  bls_irregular_pulse_t { BLS_IRREGULAR_PULSE_NOT_DETECTED = BLS_MEASUREMENT_STATUS(BLS_CUFF_FIT, 0), BLS_IRREGULAR_PULSE_DETECTED = BLS_MEASUREMENT_STATUS(BLS_CUFF_FIT, 1) }
 Irregular Pulse Detection Flag. More...
 
enum  bls_pulse_rate_range_t { BLS_PULSE_RATE_RANGE_WITHIN = BLS_MEASUREMENT_STATUS(BLS_PULSE_RATE_RANGE, 0), BLS_PULSE_RATE_RANGE_EXCEEDS = BLS_MEASUREMENT_STATUS(BLS_PULSE_RATE_RANGE, 1), BLS_PULSE_RATE_RANGE_LESS = BLS_MEASUREMENT_STATUS(BLS_PULSE_RATE_RANGE, 2) }
 Pulse Rate Range Detection Flags. More...
 
enum  bls_measurement_pos_detection_t { BLS_MEASUREREMENT_POS_DETECTION_PROPER = BLS_MEASUREMENT_STATUS(BLS_MEASUREREMENT_POS_DETECTION, 0), BLS_MEASUREREMENT_POS_DETECTION_IMPROPER = BLS_MEASUREMENT_STATUS(BLS_MEASUREREMENT_POS_DETECTION, 1) }
 Measurement Position Detection Flag. More...
 
enum  bls_pressure_unit_t { BLS_PRESSURE_UNIT_MMHG = 0x00, BLS_PRESSURE_UNIT_KPA = 0x01 }
 Blood Pressure Service Pressure Unit. More...
 
enum  bls_feature_t {
  BLS_FEATURE_BODY_MOVEMENT_DETECTION = 0x01, BLS_FEATURE_CUFF_FIT_DETECTION = 0x02, BLS_FEATURE_IRREGULAR_PULSE_DETECTION = 0x04, BLS_FEATURE_PULSE_RATE_RANGE_DETECTION = 0x08,
  BLS_FEATURE_MEASUREMENT_POS_DETECTION = 0x10, BLS_FEATURE_MULTIPLE_BOND = 0x20
}
 Blood Pressure Feature supported features. More...
 
enum  bls_supported_char_t { BLS_SUPPORTED_CHAR_INTERM_CUFF_PRESSURE = 0x01 }
 Support optional characteristics. More...
 

Functions

ble_service_tbls_init (const ble_service_config_t *config, const bls_config_t *bls_config, const bls_callbacks_t *cb)
 Initialize Body Pressure Service instance. More...
 
bool bls_indicate_pressure_measurement (ble_service_t *svc, uint16_t conn_idx, const bls_measurement_t *measurement)
 Indicate blood pressure measurement to client. More...
 
bool bls_notify_intermediate_cuff_pressure (ble_service_t *svc, uint16_t conn_idx, const bls_measurement_t *measurement)
 Notify intermediate cuff pressure measurement to client. More...
 

Detailed Description

Blood Pressure Service implementation API.

Copyright (C) 2019-2023 Renesas Electronics Corporation and/or its affiliates. All rights reserved. Confidential Information.

This software ("Software") is supplied by Renesas Electronics Corporation and/or its affiliates ("Renesas"). Renesas grants you a personal, non-exclusive, non-transferable, revocable, non-sub-licensable right and license to use the Software, solely if used in or together with Renesas products. You may make copies of this Software, provided this copyright notice and disclaimer ("Notice") is included in all such copies. Renesas reserves the right to change or discontinue the Software at any time without notice.

THE SOFTWARE IS PROVIDED "AS IS". RENESAS DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED UNDER LAW, IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE, EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. USE OF THIS SOFTWARE MAY BE SUBJECT TO TERMS AND CONDITIONS CONTAINED IN AN ADDITIONAL AGREEMENT BETWEEN YOU AND RENESAS. IN CASE OF CONFLICT BETWEEN THE TERMS OF THIS NOTICE AND ANY SUCH ADDITIONAL LICENSE AGREEMENT, THE TERMS OF THE AGREEMENT SHALL TAKE PRECEDENCE. BY CONTINUING TO USE THIS SOFTWARE, YOU AGREE TO THE TERMS OF THIS NOTICE.IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT PERMITTED TO USE THIS SOFTWARE.

Typedef Documentation

◆ bls_interm_cuff_pressure_notif_changed_cb_t

typedef void(* bls_interm_cuff_pressure_notif_changed_cb_t) (ble_service_t *service, uint16_t conn_idx, bool enabled)

Callback function, called when Intermediate Cuff Pressure notification was changed by the client.

Parameters
[in]serviceservice instance
[in]conn_idxconnection index
[in]enablednotification status

◆ bls_interm_cuff_pressure_notif_sent_cb_t

typedef void(* bls_interm_cuff_pressure_notif_sent_cb_t) (ble_service_t *service, uint16_t conn_idx, bool status)

Callback function, called when a Cuff Pressure notification has been sent to the client.

Parameters
[in]serviceservice instance
[in]conn_idxconnection index
[in]statusnotification status

◆ bls_measurement_indication_changed_cb_t

typedef void(* bls_measurement_indication_changed_cb_t) (ble_service_t *service, uint16_t conn_idx, bool enabled)

Callback function, called when Pressure Measurement indication was changed by the client.

Parameters
[in]serviceservice instance
[in]conn_idxconnection index
[in]enabledindication status

◆ bls_measurement_indication_sent_cb_t

typedef void(* bls_measurement_indication_sent_cb_t) (ble_service_t *service, uint16_t conn_idx, bool status)

Callback function, called when confirmation to Pressure Measurement indication has been received.

Parameters
[in]serviceservice instance
[in]conn_idxconnection index
[in]statusindication status

Enumeration Type Documentation

◆ bls_body_movement_t

Body Movement Detection Flag.

Enumerator
BLS_BODY_MOVEMENT_NOT_DETECTED 

No body movement

BLS_BODY_MOVEMENT_DETECTED 

Detect body movement during measurement

◆ bls_cuff_fit_t

Cuff Fit Detection Flag.

Enumerator
BLS_CUFF_FIT_PROPERLY 

Cuff fits properly

BLS_CUFF_FIT_TOO_LOOSE 

Cuff too lose

◆ bls_feature_t

Blood Pressure Feature supported features.

Enumerator
BLS_FEATURE_BODY_MOVEMENT_DETECTION 

Body Movement Detection Support

BLS_FEATURE_CUFF_FIT_DETECTION 

Cuff Fit Detection Support

BLS_FEATURE_IRREGULAR_PULSE_DETECTION 

Irregular Pulse Detection Support

BLS_FEATURE_PULSE_RATE_RANGE_DETECTION 

Pulse Rate Range Detection Support

BLS_FEATURE_MEASUREMENT_POS_DETECTION 

Measurement Position Detection Support

BLS_FEATURE_MULTIPLE_BOND 

Multiple Bond Support

◆ bls_irregular_pulse_t

Irregular Pulse Detection Flag.

Enumerator
BLS_IRREGULAR_PULSE_NOT_DETECTED 

No irregular pulse detected

BLS_IRREGULAR_PULSE_DETECTED 

Irregular pulse detected

◆ bls_measurement_pos_detection_t

Measurement Position Detection Flag.

Enumerator
BLS_MEASUREREMENT_POS_DETECTION_PROPER 

Proper measurement position

BLS_MEASUREREMENT_POS_DETECTION_IMPROPER 

Improper measurement position

◆ bls_pressure_unit_t

Blood Pressure Service Pressure Unit.

Enumerator
BLS_PRESSURE_UNIT_MMHG 

Blood pressure in mmHg

BLS_PRESSURE_UNIT_KPA 

Blood pressure in kPa

◆ bls_pulse_rate_range_t

Pulse Rate Range Detection Flags.

Enumerator
BLS_PULSE_RATE_RANGE_WITHIN 

Pulse rate is within the range

BLS_PULSE_RATE_RANGE_EXCEEDS 

Pulse rate exceeds upper limit

BLS_PULSE_RATE_RANGE_LESS 

Pulse rate is less than lower limit

◆ bls_supported_char_t

Support optional characteristics.

Enumerator
BLS_SUPPORTED_CHAR_INTERM_CUFF_PRESSURE 

Support Intermediate Cuff Pressure Characteristic

Function Documentation

◆ bls_indicate_pressure_measurement()

bool bls_indicate_pressure_measurement ( ble_service_t svc,
uint16_t  conn_idx,
const bls_measurement_t measurement 
)

Indicate blood pressure measurement to client.

Send indication of the Blood Pressure Measurement characteristic value to a client (if such indications have been previously enabled).

Parameters
[in]svcservice instance
[in]conn_idxconnection index
[in]measurementblood pressure measurement
Returns
True if the indication has been sent successfully, false otherwise

◆ bls_init()

ble_service_t* bls_init ( const ble_service_config_t config,
const bls_config_t bls_config,
const bls_callbacks_t cb 
)

Initialize Body Pressure Service instance.

This function initializes Body Pressure Service with a given set of flags.

Parameters
[in]configservice configuration
[in]bls_configBlood Pressure Service specific configuration
[in]cbapplication callbacks
Returns
service instance

◆ bls_notify_intermediate_cuff_pressure()

bool bls_notify_intermediate_cuff_pressure ( ble_service_t svc,
uint16_t  conn_idx,
const bls_measurement_t measurement 
)

Notify intermediate cuff pressure measurement to client.

Send notification of the Intermediate Cuff Pressure characteristic value to a client (if such notifications have been previously enabled).

Parameters
[in]svcservice instance
[in]conn_idxconnection index
[in]measurementintermediate blood pressure measurement
Returns
True if the notification has been sent successfully, false otherwise