Microchip® Advanced Software Framework

common/components/wifi/winc3400/ble/utils/ble_utils.h File Reference

BLE Utils declarations.

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

#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_BROADCASTER   (0x05)
 
#define BLE_CENTRAL   (0x01)
 
#define BLE_CENTRAL_AND_PERIPHERAL   (0x03)
 
#define BLE_OBSERVER   (0x04)
 
#define BLE_PERIPHERAL   (0x02)
 
#define DBG_LOG
 
#define DBG_LOG_CONT   printf
 
#define DBG_LOG_DEV   ALL_UNUSED
 
#define IEEE11073_EXPONENT   (0xFF000000)
 
#define IEEE754_MANTISA(val)   ((uint32_t)(val * 10))
 
#define IEEE754_TO_IEEE11073_FLOAT(f_val)
 
#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)
 

#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_BROADCASTER   (0x05)
#define BLE_CENTRAL   (0x01)
#define BLE_CENTRAL_AND_PERIPHERAL   (0x03)
#define BLE_OBSERVER   (0x04)
#define BLE_PERIPHERAL   (0x02)
#define DBG_LOG
Value:
printf("\r\n");\
#define printf(...)
Definition: ip64-addr.c:37

Referenced by 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_alert_status_notify(), app_alert_status_read(), app_connect_request(), app_connected_event_handler(), 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_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_pathloss_alert(), app_reset_handler(), app_ringer_setting_notify(), app_ringer_setting_read(), 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_bat_process(), ble_bat_profile_init(), ble_bat_start_advertise(), ble_conn_param_update(), ble_connected_app_event(), ble_connected_state_handler(), ble_csc_init(), 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_heart_rate_process(), ble_heart_rate_profile_init(), ble_heart_rate_start_advertise(), ble_init(), ble_l2cap_connected(), 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_handler(), ble_slave_security_request_handler(), ble_store_bonding_info(), ble_trans_char_changed_event(), ble_trans_service_advertise(), ble_trans_service_send_buf(), 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_disconnect_event_handler(), 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(), 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_disconnect_event_handler(), pxp_monitor_app_button_event(), pxp_monitor_characteristic_found_handler(), pxp_monitor_connect_request(), pxp_monitor_discovery_complete_handler(), pxp_monitor_init(), pxp_monitor_pair_done_handler(), 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(), trans_update_ctrl_char_value(), trans_update_tx_char_value(), txps_power_read_response(), and update_blp_sensor_value().

#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_dummy_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_key_request_handler(), ble_pair_request_handler(), ble_resolv_rand_addr_handler(), ble_scan_info_handler(), ble_sdk_version(), ble_send_slave_sec_request(), ble_slave_security_handler(), ble_trans_char_changed_event(), ble_undefined_event_handler(), BLE_UNUSED2_VAR(), 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(), heart_rate_update_char_value(), 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 IEEE754_MANTISA(val)
Definition: common/components/wifi/winc3400/ble/utils/ble_utils.h:78
#define IEEE11073_EXPONENT
Definition: common/components/wifi/winc3400/ble/utils/ble_utils.h:76

Referenced by convert_ieee754_ieee11073_float().

#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