Microchip® Advanced Software Framework

device_info.c File Reference

Device Information Service.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include "device_info.h"

Functions

at_ble_status_t dis_info_update (dis_gatt_service_handler_t *dis_serv, dis_info_type info_type, dis_info_data *info_data, at_ble_handle_t conn_handle)
 Update the DIS characteristic value after defining the services using dis_primary_service_define. More...
 
void dis_init_service (dis_gatt_service_handler_t *device_info_serv)
 Initialize the dis service related information. More...
 
at_ble_status_t dis_primary_service_define (dis_gatt_service_handler_t *dis_primary_service)
 Register a dis service instance inside stack. More...
 

Variables

device_info_char_value_t char_value
 characteristics of the device information service More...
 
bool volatile dis_notification_flag [DIS_TOTAL_CHARATERISTIC_NUM] = {false}
 

at_ble_status_t dis_info_update ( dis_gatt_service_handler_t dis_serv,
dis_info_type  info_type,
dis_info_data info_data,
at_ble_handle_t  conn_handle 
)

Update the DIS characteristic value after defining the services using dis_primary_service_define.

Parameters
[in]dis_servdis service instance
[in]info_typedis characteristic type to be updated
[in]info_datadata need to be updated
Returns
AT_BLE_SUCCESS operation completed successfully .
AT_BLE_FAILURE Generic error.

References ALL_UNUSED, at_ble_characteristic_value_set(), AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_characteristic_t::char_val_handle, dis_info_data::data_len, DBG_LOG, dis_info_data::info_data, at_ble_characteristic_t::init_value, dis_gatt_service_handler::serv_chars, and at_ble_characteristic_t::value_max_len.

void dis_init_service ( dis_gatt_service_handler_t device_info_serv)

Initialize the dis service related information.

DIS service and characteristic initialization(Called only once by user).

References AT_BLE_ATTR_NO_PERMISSIONS, AT_BLE_ATTR_READABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_READABLE_REQ_AUTHN_NO_AUTHR, AT_BLE_CHAR_READ, AT_BLE_UUID_16, BLE_PAIR_ENABLE, at_ble_characteristic_t::char_val_handle, at_ble_characteristic_t::client_config_handle, at_ble_characteristic_t::client_config_permissions, DEFAULT_FIRMWARE_REIVSION, device_info_char_value_t::default_firmware_revision, DEFAULT_HARDWARE_REVISION, device_info_char_value_t::default_hardware_revision, DEFAULT_MANUFACTURER_NAME, DEFAULT_MODEL_NUMBER, device_info_char_value_t::default_model_number, device_info_char_value_t::default_pnp_id, DEFAULT_SERIAL_NUMBER, device_info_char_value_t::default_serial_number, DEFAULT_SOFTWARE_REVISION, device_info_char_value_t::default_software_revision, device_info_char_value_t::default_system_id, DIS_CHAR_FIRMWARE_REIVSION_INIT_LEN, DIS_CHAR_FIRMWARE_REIVSION_MAX_LEN, DIS_CHAR_FIRMWARE_REIVSION_UUID, DIS_CHAR_HARDWARE_REVISION_INIT_LEN, DIS_CHAR_HARDWARE_REVISION_MAX_LEN, DIS_CHAR_HARDWARE_REVISION_UUID, DIS_CHAR_IEEE_REG_CERT_DATA_LIST_INIT_LEN, DIS_CHAR_IEEE_REG_CERT_DATA_LIST_MAX_LEN, DIS_CHAR_IEEE_REG_CERT_DATA_LIST_UUID, DIS_CHAR_MANUFACTURER_NAME_INIT_LEN, DIS_CHAR_MANUFACTURER_NAME_MAX_LEN, DIS_CHAR_MANUFACTURER_NAME_UUID, DIS_CHAR_MODEL_NUMBER_INIT_LEN, DIS_CHAR_MODEL_NUMBER_MAX_LEN, DIS_CHAR_MODEL_NUMBER_UUID, DIS_CHAR_PNP_ID_INIT_LEN, DIS_CHAR_PNP_ID_MAX_LEN, DIS_CHAR_PNP_ID_UUID, DIS_CHAR_SERIAL_NUMBER_INIT_LEN, DIS_CHAR_SERIAL_NUMBER_MAX_LEN, DIS_CHAR_SERIAL_NUMBER_UUID, DIS_CHAR_SOFTWARE_REVISION_INIT_LEN, DIS_CHAR_SOFTWARE_REVISION_MAX_LEN, DIS_CHAR_SOFTWARE_REVISION_UUID, DIS_CHAR_SYSTEM_ID_INIT_LEN, DIS_CHAR_SYSTEM_ID_MAX_LEN, DIS_CHAR_SYSTEM_ID_UUID, DIS_SERVICE_UUID, device_info_char_value_t::ieee_reg_cert_data_list, at_ble_characteristic_t::init_value, system_id_char_value_t::manufacturer_id, device_info_char_value_t::manufacturer_name, NULL, system_id_char_value_t::org_unique_id, PNP_ID_PRODUCT_ID, PNP_ID_PRODUCT_VERSION, PNP_ID_VENDOR_ID, PNP_ID_VENDOR_ID_SOURCE, at_ble_characteristic_t::presentation_format, pnp_id_char_value_t::product_id, pnp_id_char_value_t::product_version, at_ble_characteristic_t::properties, dis_gatt_service_handler::serv_chars, dis_gatt_service_handler::serv_handle, dis_gatt_service_handler::serv_uuid, at_ble_characteristic_t::server_config_handle, at_ble_characteristic_t::server_config_permissions, SYSTEM_ID_MANUFACTURER_ID, SYSTEM_ID_MANUFACTURER_ID_LEN, SYSTEM_ID_ORG_UNIQUE_ID, SYSTEM_ID_ORG_UNIQUE_ID_LEN, at_ble_uuid_t::type, at_ble_characteristic_t::user_desc, at_ble_characteristic_t::user_desc_handle, at_ble_characteristic_t::user_desc_len, at_ble_characteristic_t::user_desc_max_len, at_ble_characteristic_t::user_desc_permissions, at_ble_uuid_t::uuid, at_ble_characteristic_t::uuid, at_ble_characteristic_t::value_init_len, at_ble_characteristic_t::value_max_len, at_ble_characteristic_t::value_permissions, pnp_id_char_value_t::vendor_id, and pnp_id_char_value_t::vendor_id_source.

Referenced by blp_sensor_service_init(), hid_prf_init(), hr_sensor_service_init(), htp_init(), and main().

characteristics of the device information service

bool volatile dis_notification_flag[DIS_TOTAL_CHARATERISTIC_NUM] = {false}