Microchip® Advanced Software Framework

ble_host_sdk/utils/ble_utils.h File Reference
#include <asf.h>

Macros

#define ALL_UNUSED(...)   ALL_UNUSED_IMPL( VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__ )
 
#define ALL_UNUSED_IMPL(nargs)   ALL_UNUSED_IMPL_(nargs)
 
#define ALL_UNUSED_IMPL_(nargs)   UNUSED ## nargs
 
#define BLE_ASSERT   (true)
 
#define ble_assert(expr)
 
#define BLE_ROLE_ALL   0x0F
 
#define BLE_ROLE_BROADCASTER   0x02
 
#define BLE_ROLE_CENTRAL   0x05
 
#define BLE_ROLE_OBSERVER   0x01
 
#define BLE_ROLE_PERIPHERAL   0x0A
 
#define BLE_SDK_BUILD_NO(version)   (version & 0x0000FFFF)
 
#define BLE_SDK_MAJOR_NO(version)   ((version >> 28) & 0x0000000F)
 
#define BLE_SDK_MINOR_NO(version)   ((version >> 24) & 0x0000000F)
 
#define BLE_SDK_MINOR_NO_INC   (1)
 
#define BLE_SDK_VERSION   BLUSDK_VER_6_1
 
#define BLU_SDK_API
 
#define BLUSDK_VER_6_0   (0x60000000)
 
#define BLUSDK_VER_6_1   (0x61000000)
 
#define BTLC1000_MR   0x00
 
#define BTLC1000_ZR   0x01
 
#define DBG_LOG
 
#define DBG_LOG_ADV
 
#define DBG_LOG_CONT   printf
 
#define DBG_LOG_CONT_DEV   ALL_UNUSED
 
#define DBG_LOG_DEV   ALL_UNUSED
 
#define DBG_LOG_PTS   ALL_UNUSED
 
#define IEEE11073_EXPONENT   (0xFF000000)
 
#define IEEE754_MANTISA(val)   ((uint32_t)(val * 10))
 
#define IEEE754_TO_IEEE11073_FLOAT(f_val)
 
#define NIBBLE2ASCII(nibble)   (((nibble < 0x0A) ? (nibble + '0') : (nibble + 0x57)))
 
#define UNUSED1(x)   (void)(x)
 
#define UNUSED2(x, y)   (void)(x),(void)(y)
 
#define UNUSED3(x, y, z)   (void)(x),(void)(y),(void)(z)
 
#define UNUSED4(a, x, y, z)   (void)(a),(void)(x),(void)(y),(void)(z)
 
#define UNUSED5(a, b, x, y, z)   (void)(a),(void)(b),(void)(x),(void)(y),(void)(z)
 
#define UNUSED6(a, b, c, x, y, z)   (void)(a),(void)(b),(void)(c),(void)(x),(void)(y),(void)(z)
 
#define UNUSED7(a, b, c, d, x, y, z)   (void)(a),(void)(b),(void)(c),(void)(d),(void)(x),(void)(y),(void)(z)
 
#define UNUSED8(a, b, c, d, e, x, y, z)   (void)(a),(void)(b),(void)(c),(void)(d),(void)(e),(void)(x),(void)(y),(void)(z)
 
#define VA_NUM_ARGS(...)   VA_NUM_ARGS_IMPL(__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1)
 
#define VA_NUM_ARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, N,...)   N
 

Functions

static uint32_t convert_ieee754_ieee11073_float (float f_val)
 
static void dump_hex_buffer (void *buf, uint32_t len)
 
uint8_t getchar_timeout (uint32_t timeout)
 

#define ALL_UNUSED (   ...)    ALL_UNUSED_IMPL( VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__ )

Referenced by anp_client_disconnected_event_handler(), anp_info_service_discover(), app_connected_event_handler(), app_connected_state_handler(), app_disconnected_event_handler(), app_disconnected_state_handler(), app_htpt_enable_rsp_handler(), app_htpt_meas_intv_upd_rsp(), app_htptp_meas_intv_chg_req(), bat_init_service(), battery_simulation_task(), ble_conn_param_update(), ble_connected_app_event(), ble_connected_state_handler(), ble_device_dead_handler(), ble_device_out_of_sync_handler(), ble_disconnected_app_event(), ble_enc_status_changed_app_event(), ble_encryption_app_event(), ble_observer_scan_data_handler(), ble_paired_app_event(), ble_resolv_rand_addr_handler(), ble_scan_report_app_event(), ble_send_slave_sec_request(), ble_undefined_event_handler(), blp_sensor_disconnect_event_handler(), blp_sensor_init(), csc_prf_disconnect_event_handler(), csc_prf_init(), dis_info_update(), fmp_locator_connected_state_handler(), fmp_locator_disconnect_event_handler(), fmp_target_connected_state_handler(), fmp_target_disconnect_event_handler(), fmp_target_init(), hid_boot_keyboardreport_update(), hid_boot_mousereport_update(), hid_connect_cb(), hid_disconnect_cb(), hid_prf_disconnect_event_handler(), hr_sensor_disconnect_event_handler(), hr_sensor_init(), main(), pas_client_disconnected_event_handler(), pas_client_write_notifications(), platform_init(), pxp_monitor_scan_data_handler(), pxp_reporter_connected_state_handler(), pxp_reporter_disconnect_event_handler(), pxp_reporter_init(), and sps_disconnected_event_handler().

#define ALL_UNUSED_IMPL (   nargs)    ALL_UNUSED_IMPL_(nargs)
#define ALL_UNUSED_IMPL_ (   nargs)    UNUSED ## nargs
#define BLE_ASSERT   (true)
#define ble_assert (   expr)
Value:
{\
if (!(expr)) while (true);\
}
if((SERIAL_RX_BUF_SIZE_HOST-1)==serial_rx_buf_tail)
Definition: sio2host.c:258
#define true
Definition: compiler.h:363

Referenced by platform_gpio_set(), platform_init(), and platform_send_sync().

#define BLE_ROLE_ALL   0x0F
#define BLE_ROLE_BROADCASTER   0x02
#define BLE_ROLE_CENTRAL   0x05
#define BLE_ROLE_OBSERVER   0x01
#define BLE_ROLE_PERIPHERAL   0x0A
#define BLE_SDK_BUILD_NO (   version)    (version & 0x0000FFFF)

Referenced by ble_sdk_version().

#define BLE_SDK_MAJOR_NO (   version)    ((version >> 28) & 0x0000000F)

Referenced by ble_sdk_version().

#define BLE_SDK_MINOR_NO (   version)    ((version >> 24) & 0x0000000F)

Referenced by ble_sdk_version().

#define BLE_SDK_MINOR_NO_INC   (1)

Referenced by ble_sdk_version().

#define BLE_SDK_VERSION   BLUSDK_VER_6_1

Referenced by ble_sdk_version().

#define BLU_SDK_API
#define BLUSDK_VER_6_0   (0x60000000)
#define BLUSDK_VER_6_1   (0x61000000)
#define BTLC1000_MR   0x00
#define BTLC1000_ZR   0x01
#define DBG_LOG
Value:
printf("\r\n");\
printf

Referenced by acce_sensor_data_send(), alert_service_discovery(), altbeacon_init(), anp_alert_category(), anp_alert_notify_response(), anp_alert_read_response(), anp_alert_type(), anp_client_adv(), anp_client_characteristic_found_handler(), anp_client_connected_state_handler(), anp_client_descriptor_found_handler(), anp_client_disable_notification(), anp_client_discovery_complete_handler(), anp_client_init(), anp_client_notification_handler(), anp_client_service_found_handler(), anp_client_write_notification_handler(), anp_custom_event(), anp_info_connect_handler(), app_adv_param_set(), app_adv_report_cb(), app_alert_status_notify(), app_alert_status_read(), app_char_disc_resp_cb(), app_char_value_received_cb(), app_connect_request(), app_connected_cb(), app_connected_event_handler(), app_disconnected_cb(), app_disconnected_event_handler(), app_encryption_status_changed_handler(), app_error(), app_htpt_cfg_indntf_ind_handler(), app_htpt_create_db_cfm_handler(), app_htpt_disable_ind_handler(), app_htpt_enable_rsp_handler(), app_htpt_error_ind_handler(), app_htpt_meas_intv_chg_ind_handler(), app_htpt_temp_send_cfm(), app_ibeacon_init(), app_immediate_alert(), app_indication_confirmation_handler(), app_indication_handler(), app_init(), app_linkloss_alert(), app_no_device_found_handler(), app_notification_handler(), app_pair_done_event_handler(), app_passkey_confirm_req_cb(), app_pathloss_alert(), app_reset_handler(), app_ringer_setting_notify(), app_ringer_setting_read(), app_service_disc_resp_cb(), app_trans_data_received_cb(), at_app_send_lecb(), bat_custom_event(), bat_update_char_value(), battery_service_advertise(), battery_set_advertisement_data(), battery_simulation_task(), battery_start_advertisement(), beacon_init(), ble_adv_report_app_event(), ble_advertisement_data_set(), ble_connected_app_event(), ble_connected_state_handler(), ble_device_config(), ble_device_dead_handler(), ble_device_init(), ble_device_out_of_sync_handler(), ble_disconnected_app_event(), ble_disconnected_state_handler(), ble_encryption_request_handler(), ble_encryption_status_change_handler(), ble_event_manager(), ble_init(), ble_l2cap_connected(), ble_mgr_adv_start(), ble_mgr_adv_stop(), ble_mgr_connected_cb(), ble_mgr_device_init(), ble_mgr_scan_start(), ble_mgr_scan_stop(), ble_mgr_start_connection(), ble_mgr_transparent_uart_disable(), ble_mgr_transparent_uart_enable(), ble_mgr_transparent_uart_send(), ble_mtu_changed_cmd_complete_handler(), ble_observer_custom_event(), ble_observer_scan_data_handler(), ble_observer_scan_info_handler(), ble_pair_done_handler(), ble_pair_key_request_handler(), ble_pair_request_handler(), ble_remove_bonding_info(), ble_resolv_rand_addr_handler(), ble_restore_bonding_info(), ble_scan_info(), ble_scan_info_handler(), ble_scan_report_app_event(), ble_scan_report_handler(), ble_sdk_version(), ble_send_slave_sec_request(), ble_set_address(), ble_set_dev_config(), ble_slave_security_request_handler(), ble_store_bonding_info(), blp_char_indication(), blp_char_notification(), blp_disconnection(), blp_sensor_adv(), blp_sensor_app_custom_event(), blp_sensor_init(), blp_sensor_send_indication(), blp_sensor_send_notification(), blp_sensor_service_define(), brd_adv_init(), brd_set_advertisement_data(), brd_set_advertisement_type(), brd_start_broadcast(), csc_app_recv_buf(), csc_app_send_buf(), csc_prf_connected_state_handler(), csc_prf_dev_adv(), csc_prf_discovery_complete_handler(), csc_prf_init(), csc_prf_report_ntf_cb(), csc_prf_write_notification_handler(), csc_serv_send_data(), device_information_advertise(), dis_custom_event(), dis_info_update(), display_alert_status_info(), eddystone_adv_start(), eddystone_app_init(), eddystone_create_url_frame(), eddystone_custom_event(), esurl_char_changed_event(), esurl_dev_disconnected_event(), esurl_paired_event(), esurl_write_authorize_event(), fmp_locator_discovery_complete_handler(), fmp_locator_service_discover(), fmp_locator_service_found_handler(), fmp_target_adv(), fmp_target_connected_state_handler(), fmp_target_disconnect_event_handler(), fmp_target_service_define(), gap_dev_scan(), gyro_sensor_data_send(), hid_keyboard_app_init(), hid_mouse_app_init(), hid_prf_dev_adv(), hid_prf_disconnect_event_handler(), hid_serv_init(), hid_serv_report_update(), hid_service_dbreg(), hr_measurment_send(), hr_sensor_adv(), hr_sensor_app_custom_event(), hr_sensor_char_write_request(), hr_sensor_disconnect(), hr_sensor_init(), hr_sensor_send_notification(), hr_sensor_service_define(), htp_init(), htp_temperature_send(), htpt_set_advertisement_data(), l2cap_connected(), l2cap_credit_indication(), l2cap_data_recv(), l2cap_disconnect(), l2cap_send_resp(), lls_alert_read_response(), lls_set_alert_value(), main(), multirole_app_custom_event(), pas_client_adv(), pas_client_char_write_response_handler(), pas_client_discovery_complete_handler(), pas_client_init(), pas_client_service_found_handler(), pas_client_start_service_discovery(), pas_client_write_notifications(), pds_compact_sector(), pds_module_init(), pxp_app_init(), pxp_monitor_app_button_event(), pxp_monitor_connect_request(), pxp_monitor_discovery_complete_handler(), pxp_monitor_init(), pxp_monitor_scan_data_handler(), pxp_monitor_service_discover(), pxp_monitor_service_found_handler(), pxp_monitor_start_scan(), pxp_reporter_adv(), pxp_reporter_connected_state_handler(), pxp_reporter_disconnect_event_handler(), pxp_service_define(), rssi_update(), sps_char_changed_event(), sps_custom_event(), sps_scan_refresh_char_update(), sps_service_advertise(), time_info_adv(), time_info_characteristic_read_response(), time_info_connected_state_handler(), time_info_disconnected_event_handler(), time_info_discovery_complete_handler(), time_info_service_discovery(), time_info_write_notification_handler(), tip_app_custom_event(), tis_current_time_noti(), tis_current_time_read_response(), tis_dst_change_read_response(), tis_rtu_update_read_response(), txps_power_read_response(), and update_blp_sensor_value().

#define DBG_LOG_ADV
Value:
printf("\r\nBLE-ADV: ");\
printf

Referenced by ble_advertisement_data_set().

#define DBG_LOG_CONT_DEV   ALL_UNUSED
#define DBG_LOG_DEV   ALL_UNUSED

Referenced by alert_service_discovery(), anp_alert_notify_response(), anp_alert_read_response(), anp_client_characteristic_found_handler(), anp_client_descriptor_found_handler(), anp_client_disable_notification(), anp_client_discovery_complete_handler(), anp_client_security_done_handler(), anp_client_service_found_handler(), anp_client_write_notification_handler(), anp_client_write_response_handler(), app_alert_status_notify(), app_alert_status_read(), app_connected_state(), app_htpt_temp_send_cfm(), app_indication_confirmation_handler(), app_notification_cfm_handler(), app_notification_confirmation_handler(), app_pair_done_event_handler(), app_read_response_cb(), app_ringer_setting_notify(), app_ringer_setting_read(), bat_update_char_value(), ble_advertisement_data_set(), ble_characteristic_write_cmd_complete_handler(), ble_conn_param_update(), ble_connected_state_handler(), ble_disconnected_state_handler(), ble_encryption_request_handler(), ble_event_manager(), ble_mtu_changed_cmd_complete_handler(), ble_mtu_changed_indication_handler(), ble_notification_confirmed_app_event(), ble_observer_custom_event(), ble_observer_scan_info_handler(), ble_pair_done_handler(), ble_pair_request_handler(), ble_resolv_rand_addr_handler(), ble_scan_info_handler(), ble_sdk_version(), ble_send_slave_sec_request(), ble_undefined_event_handler(), blp_indication_confirmation_handler(), blp_notification_confirmation_handler(), button_cb(), csc_notification_confirmation_handler(), csc_prf_connected_state_handler(), csc_prf_discovery_complete_handler(), csc_prf_service_found_handler(), fmp_locator_discovery_complete_handler(), fmp_locator_service_discover(), hid_boot_keyboardreport_update(), hid_boot_mousereport_update(), hid_get_reportchar(), hid_get_reportid(), hid_notification_confirmed_cb(), hid_ntf_instance(), hid_prf_boot_ntf_cb(), hid_prf_char_changed_handler(), hid_prf_control_point_ntf_cb(), hid_prf_init(), hid_prf_protocol_mode_ntf_cb(), hid_prf_report_ntf_cb(), hid_serv_get_instance(), hid_serv_report_update(), hid_service_dbreg(), hr_sensor_char_write_request(), hr_sensor_notification_cfm_handler(), hr_sensor_service_define(), l2cap_conn_req(), l2cap_data_recv(), pas_client_char_read_response_handler(), pas_client_char_write_response_handler(), pas_client_characteristic_found_handler(), pas_client_descriptor_found_handler(), pas_client_discovery_complete_handler(), pas_client_notification_handler(), pas_client_start_service_discovery(), pds_init(), pxp_monitor_characteristic_read_response(), pxp_monitor_discovery_complete_handler(), pxp_monitor_service_discover(), pxp_service_define(), sps_notification_confirmed_cb(), sps_scan_refresh_char_update(), time_info_connected_state_handler(), time_info_discovery_complete_handler(), time_info_service_discovery(), tip_app_custom_event(), tip_disconnect_cb(), tip_discovery_complete_cb(), tip_encryption_status_changed_cb(), and tip_pair_done_cb().

#define IEEE11073_EXPONENT   (0xFF000000)
#define IEEE754_MANTISA (   val)    ((uint32_t)(val * 10))
#define IEEE754_TO_IEEE11073_FLOAT (   f_val)
Value:
#define IEEE11073_EXPONENT
Definition: ble_host_sdk/utils/ble_utils.h:118
#define IEEE754_MANTISA(val)
Definition: ble_host_sdk/utils/ble_utils.h:120

Referenced by convert_ieee754_ieee11073_float().

#define NIBBLE2ASCII (   nibble)    (((nibble < 0x0A) ? (nibble + '0') : (nibble + 0x57)))
#define UNUSED1 (   x)    (void)(x)
#define UNUSED2 (   x,
 
)    (void)(x),(void)(y)
#define UNUSED3 (   x,
  y,
 
)    (void)(x),(void)(y),(void)(z)
#define UNUSED4 (   a,
  x,
  y,
 
)    (void)(a),(void)(x),(void)(y),(void)(z)
#define UNUSED5 (   a,
  b,
  x,
  y,
 
)    (void)(a),(void)(b),(void)(x),(void)(y),(void)(z)
#define UNUSED6 (   a,
  b,
  c,
  x,
  y,
 
)    (void)(a),(void)(b),(void)(c),(void)(x),(void)(y),(void)(z)
#define UNUSED7 (   a,
  b,
  c,
  d,
  x,
  y,
 
)    (void)(a),(void)(b),(void)(c),(void)(d),(void)(x),(void)(y),(void)(z)
#define UNUSED8 (   a,
  b,
  c,
  d,
  e,
  x,
  y,
 
)    (void)(a),(void)(b),(void)(c),(void)(d),(void)(e),(void)(x),(void)(y),(void)(z)
#define VA_NUM_ARGS (   ...)    VA_NUM_ARGS_IMPL(__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1)
#define VA_NUM_ARGS_IMPL (   _1,
  _2,
  _3,
  _4,
  _5,
  _6,
  _7,
  _8,
  N,
  ... 
)    N

static uint32_t convert_ieee754_ieee11073_float ( float  f_val)
inlinestatic
static void dump_hex_buffer ( void *  buf,
uint32_t  len 
)
inlinestatic

References buffer, and DBG_LOG_CONT.

uint8_t getchar_timeout ( uint32_t  timeout)