Пример #1
0
    // Measurement Interval Characteristic Value
    [HTS_IDX_MEAS_INTV_VAL]         =   {ATT_CHAR_MEAS_INTERVAL, PERM(RD, ENABLE), HTPT_MEAS_INTV_MAX_LEN,
                                         0, NULL},
    // Measurement Interval Characteristic - Client Characteristic Configuration Descriptor
    [HTS_IDX_MEAS_INTV_CFG]         =   {ATT_DESC_CLIENT_CHAR_CFG, PERM(RD, ENABLE)|PERM(WR, ENABLE), sizeof(uint16_t),
                                         0, NULL},
    // Measurement Interval Characteristic - Valid Range Descriptor
    [HTS_IDX_MEAS_INTV_VAL_RANGE]   =   {ATT_DESC_VALID_RANGE, PERM(RD, ENABLE), sizeof(uint32_t),
                                         0, NULL},
};

/// Health Thermometer Service
const att_svc_desc_t htpt_hlth_therm_svc = ATT_SVC_HEALTH_THERMOM;

/// Health Thermometer Service Temperature Measurement Characteristic
const struct att_char_desc htpt_temp_meas_char = ATT_CHAR(ATT_CHAR_PROP_IND, HTPT_TEMP_MEAS_CHAR,
                                                            ATT_CHAR_TEMPERATURE_MEAS);

/// Health Thermometer Service Temperature Type Characteristic
const struct att_char_desc htpt_temp_type_char = ATT_CHAR(ATT_CHAR_PROP_RD, HTPT_TEMP_TYPE_CHAR,
                                                            ATT_CHAR_TEMPERATURE_TYPE);

/// Health Thermometer Service Intermediate Temperature Characteristic
const struct att_char_desc htpt_interm_temp_char = ATT_CHAR(ATT_CHAR_PROP_NTF, HTPT_INTERM_TEMP_CHAR,
                                                              ATT_CHAR_INTERMED_TEMPERATURE);

/// Health Thermometer Service Measurement Interval Characteristic
const struct att_char_desc htpt_meas_intv_char = ATT_CHAR(ATT_CHAR_PROP_RD, HTPT_MEAS_INTV_CHAR,
                                                            ATT_CHAR_MEAS_INTERVAL);

/*
 * GLOBAL VARIABLE DEFINITIONS
Пример #2
0
                                          0, NULL},

    // Ringer Control Point Characteristic Declaration
    [PASS_IDX_RINGER_CTNL_PT_CHAR]   =   {ATT_DECL_CHARACTERISTIC, PERM(RD, ENABLE), sizeof(pasps_ringer_ctnl_pt_char),
                                          sizeof(pasps_ringer_ctnl_pt_char), (uint8_t *)&pasps_ringer_ctnl_pt_char},
    // Ringer Control Point Characteristic Value
    [PASS_IDX_RINGER_CTNL_PT_VAL]    =   {ATT_CHAR_RINGER_CNTL_POINT, PERM(WR, ENABLE), sizeof(uint8_t),
                                          0, NULL},
};

/// Phone Alert Status Service
const att_svc_desc_t pasps_pass_svc                   = ATT_SVC_PHONE_ALERT_STATUS;

/// Phone Alert Status Service Alert Status Characteristic
const struct att_char_desc pasps_alert_status_char   = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_NTF,
                                                                0,
                                                                ATT_CHAR_ALERT_STATUS);

/// Phone Alert Status Service Ringer Setting Characteristic
const struct att_char_desc pasps_ringer_setting_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_NTF,
                                                                0,
                                                                ATT_CHAR_RINGER_SETTING);

/// Phone Alert Status Service Ringer Settings Characteristic
const struct att_char_desc pasps_ringer_ctnl_pt_char = ATT_CHAR(ATT_CHAR_PROP_WR_NO_RESP,
                                                                0,
                                                                ATT_CHAR_RINGER_CNTL_POINT);

/*
 * GLOBAL VARIABLE DEFINITIONS
 ****************************************************************************************
Пример #3
0
/*
 * Services
 */
/// Current Time Service
const att_svc_desc_t tips_cts_svc      = ATT_SVC_CURRENT_TIME;
/// Next DST Change Service
const att_svc_desc_t tips_ndcs_svc     = ATT_SVC_NEXT_DST_CHANGE;
/// Reference Time Update Service
const att_svc_desc_t tips_rtus_svc     = ATT_SVC_REF_TIME_UPDATE;

/*
 * Current Time Service Characteristics
 */
///Current Time Characteristic
const struct att_char_desc tips_curr_time_char         = ATT_CHAR(ATT_CHAR_PROP_RD|ATT_CHAR_PROP_NTF,
                                                                    CTS_CURRENT_TIME_CHAR,
                                                                    ATT_CHAR_CT_TIME);
///Local Time Info Characteristic
const struct att_char_desc tips_loc_time_info_char     = ATT_CHAR(ATT_CHAR_PROP_RD,
                                                                    CTS_LOCAL_TIME_INFO_CHAR,
                                                                    ATT_CHAR_LOCAL_TIME_INFO);
///Reference Time Info Characteristic
const struct att_char_desc tips_ref_time_info_char      = ATT_CHAR(ATT_CHAR_PROP_RD,
                                                                    CTS_REF_TIME_INFO_CHAR,
                                                                    ATT_CHAR_REFERENCE_TIME_INFO);

/*
 * Next DST Change Service Characteristics
 */
///Time with DST Characteristic
const struct att_char_desc tips_time_with_dst_char     = ATT_CHAR(ATT_CHAR_PROP_RD,
Пример #4
0
#include "gap.h"
#include "gattc_task.h"
#include "attm_util.h"
#include "atts_util.h"
#include "attm_cfg.h"
#include "prf_utils.h"

#include "streamdatad_task.h"
#include "streamdatad.h"
#include "llc_task.h" // llc_nb_of_pkt_evt_complete

/// Pong Service
static const att_svc_desc_t streamdatad_svc = STREAMDATAD_SERVICE_UUID;
/// Enable Characteristic

static const struct att_char_desc streamdatad_enable_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP, 0, STREAMDATAD_ENABLE_UUID);

/// Data Characteristic
static const struct att_char_desc streamdatad_d0_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D0_UUID);
static const struct att_char_desc streamdatad_d1_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D1_UUID);
static const struct att_char_desc streamdatad_d2_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D2_UUID);
static const struct att_char_desc streamdatad_d3_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D3_UUID);
static const struct att_char_desc streamdatad_d4_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D4_UUID);
static const struct att_char_desc streamdatad_d5_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D5_UUID);
static const struct att_char_desc streamdatad_d6_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D6_UUID);
static const struct att_char_desc streamdatad_d7_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D7_UUID);
static const struct att_char_desc streamdatad_d8_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D8_UUID);
static const struct att_char_desc streamdatad_d9_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP | ATT_CHAR_PROP_NTF, 0, STREAMDATAD_D9_UUID);
/// Enable description
static const uint8_t streamdatad_enable_desc[] = STREAMDATAD_ENABLE_DESC;
Пример #5
0
extern uint8_t accel_threshold __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
extern uint8_t accel_adv_interval1 __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
extern uint8_t accel_adv_interval2 __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
extern uint8_t accel_adv_interval3 __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY

extern uint8_t accel_con_interval __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY

extern uint8_t accel_mode __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
extern uint8_t accel_latency __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
extern uint8_t accel_window __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY

/// Pong Service
static const att_svc_desc_t accel_svc = ACCEL_SERVICE_UUID;
/// Enable Characteristic
static const struct att_char_desc accel_enable_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP, 0, ACCEL_ENABLE_UUID);

/// Range Characteristic
static const struct att_char_desc accel_range_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR, 0, ACCEL_RANGE_UUID);

/// X axis Characteristic
static const struct att_char_desc accel_x_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR | ATT_CHAR_PROP_NTF, 0, ACCEL_X_UUID);

/// Y axis Characteristic
static const struct att_char_desc accel_y_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR | ATT_CHAR_PROP_NTF, 0, ACCEL_Y_UUID);

/// Z axis Characteristic
static const struct att_char_desc accel_z_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR | ATT_CHAR_PROP_NTF, 0, ACCEL_Z_UUID);

/// Display line 1 Characteristic
static const struct att_char_desc accel_display1_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR, 0, ACCEL_DISPLAY1_UUID);
Пример #6
0
    [BAS_IDX_BATT_LVL_VAL]         =   {ATT_CHAR_BATTERY_LEVEL, PERM(RD, ENABLE), sizeof(uint8_t),
                                        0, NULL},
    // Battery Level Characteristic - Client Characteristic Configuration Descriptor
    [BAS_IDX_BATT_LVL_NTF_CFG]     =   {ATT_DESC_CLIENT_CHAR_CFG, PERM(RD, ENABLE)|PERM(WR, ENABLE), sizeof(uint16_t),
                                        0, NULL},
    // Battery Level Characteristic - Characteristic Presentation Format Descriptor
    [BAS_IDX_BATT_LVL_PRES_FMT]    =   {ATT_DESC_CHAR_PRES_FORMAT, PERM(RD, ENABLE), sizeof(struct prf_char_pres_fmt),
                                        0, NULL},
};

/// Battery Service
const att_svc_desc_t bas_svc = ATT_SVC_BATTERY_SERVICE;

/// Battery Level characteristic
const struct att_char_desc bas_batt_level_char = ATT_CHAR(ATT_CHAR_PROP_RD,
                                                            0,
                                                            ATT_CHAR_BATTERY_LEVEL);

/*
 * GLOBAL VARIABLE DEFINITIONS
 ****************************************************************************************
 */

struct bass_env_tag bass_env __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY

/// BASS task descriptor
static const struct ke_task_desc TASK_DESC_BASS = {bass_state_handler, &bass_default_handler, bass_state, BASS_STATE_MAX, BASS_IDX_MAX};


/*
 * GLOBAL FUNCTIONS DEFINITIONS
Пример #7
0
                                         sizeof(findt_alert_lvl_char), (uint8_t *)&findt_alert_lvl_char},
    // Alert Level Characteristic Value
    [FINDT_IAS_IDX_ALERT_LVL_VAL]   =   {ATT_CHAR_ALERT_LEVEL, PERM(WR, ENABLE), sizeof(uint8_t),
                                         0, NULL},
};

/*
 *  FIND ME PROFILE TARGET ATTRIBUTES
 ****************************************************************************************
 */
/// Immediate Alert Service
const att_svc_desc_t findt_ias_svc = ATT_SVC_IMMEDIATE_ALERT;

/// Alert Level Service - Heart Rate Measurement Characteristic
const struct att_char_desc findt_alert_lvl_char = ATT_CHAR(ATT_CHAR_PROP_WR_NO_RESP,
                                                               0,
                                                             ATT_CHAR_ALERT_LEVEL);

/*
 * GLOBAL VARIABLE DEFINITIONS
 ****************************************************************************************
 */
struct findt_env_tag findt_env __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY

/// FIND ME task descriptor
static const struct ke_task_desc TASK_DESC_FINDT = {findt_state_handler, &findt_default_handler, findt_state, FINDT_STATE_MAX, FINDT_IDX_MAX};


/*
 * FUNCTION DEFINITIONS
 ****************************************************************************************
Пример #8
0
#include "anps_task.h"
#include "anp_common.h"
#include "prf_utils.h"
#include "prf_types.h"

/*
 * ANS ATTRIBUTES
 ****************************************************************************************
 */

/// Alert Notification Service
const att_svc_desc_t anps_ans_svc                          = ATT_SVC_ALERT_NTF;

/// Supported New Alert Category Characteristic
const struct att_char_desc anps_supp_new_alert_cat_char    = ATT_CHAR(ATT_CHAR_PROP_RD,
                                                                      0,
                                                                      ATT_CHAR_SUP_NEW_ALERT_CAT);
/// New Alert Characteristic
const struct att_char_desc anps_new_alert_char             = ATT_CHAR(ATT_CHAR_PROP_NTF,
                                                                      0,
                                                                      ATT_CHAR_NEW_ALERT);
/// Supported Unread Alert Category Characteristic
const struct att_char_desc anps_supp_unread_alert_cat_char = ATT_CHAR(ATT_CHAR_PROP_RD,
                                                                      0,
                                                                      ATT_CHAR_SUP_UNREAD_ALERT_CAT);
/// Unread Alert Status Characteristic
const struct att_char_desc anps_unread_alert_status_char   = ATT_CHAR(ATT_CHAR_PROP_NTF,
                                                                      0,
                                                                      ATT_CHAR_UNREAD_ALERT_STATUS);
/// Alert Notification Control Point Characteristic
const struct att_char_desc anps_alert_ntf_ctnl_pt_char     = ATT_CHAR(ATT_CHAR_PROP_WR,
Пример #9
0
#include "glps.h"
#include "glps_task.h"
#include "prf_utils.h"

/*
 *  GLUCOSE PROFILE ATTRIBUTES
 ****************************************************************************************
 */

/// Glucose Sensor Service
static const att_svc_desc_t glps_gls_svc = ATT_SVC_GLUCOSE;


/// Glucose Measurement characteristic value
static const struct att_char_desc glps_meas_char =
        ATT_CHAR(ATT_CHAR_PROP_NTF, 0,
                  ATT_CHAR_GLUCOSE_MEAS);
/// Glucose Measurement Context characteristic value
static const struct att_char_desc glps_meas_ctx_char =
        ATT_CHAR(ATT_CHAR_PROP_NTF, 0,
                  ATT_CHAR_GLUCOSE_MEAS_CTX);
/// Glucose Feature characteristic value
static const struct att_char_desc glps_feature_char =
        ATT_CHAR(ATT_CHAR_PROP_RD, 0,
                  ATT_CHAR_GLUCOSE_FEATURE);
/// Record Access Control Point characteristic value
static const struct att_char_desc glps_racp_char =
        ATT_CHAR(ATT_CHAR_PROP_WR | ATT_CHAR_PROP_IND, 0,
                  ATT_CHAR_REC_ACCESS_CTRL_PT);


Пример #10
0
};

/// Specifies the message handlers that are common to all states.
const struct ke_state_handler sample128_default_handler = KE_STATE_HANDLER(sample128_default_state);

/// Defines the place holder for the states of all the task instances.
ke_state_t sample128_state[SAMPLE128_IDX_MAX] __attribute__((section("exchange_mem_case1")));

#endif //BLE_SAMPLE128

//gsx
#if 0
/// Pong Service
static const att_svc_desc_t sample128_svc_gsx = 0xFFA0;
///  SAMPLE128_1_IDX_CHAR
static const struct att_char_desc sample128_val1_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP, 0, 0xFFA1);
///  SAMPLE128_2_IDX_CHAR
static const struct att_char_desc sample128_val2_char = ATT_CHAR(ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR_NO_RESP, 0, 0xFFA2);

/// char1 description
static const uint8_t sample128_1_desc[] = "value1";
#define SAMPLE128_1_DESC_LEN 6
/// char2 description
static const uint8_t sample128_2_desc[] = "value2";
#define SAMPLE128_2_DESC_LEN 6


/// Full Sample128 Database Description - Used to add attributes into the database
static const struct attm_desc sample128_att_db[SAMPLE128_1_IDX_NB] = 
{
	  [SAMPLE128_1_IDX_SVC]   =   /* Accelerometer service */