Created
August 2, 2013 18:11
-
-
Save theterg/6142052 to your computer and use it in GitHub Desktop.
Bluegiga BTLE test code modified to analyze CRP protocol notification data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef APITYPES_H_ | |
| #define APITYPES_H_ | |
| #ifdef __GNUC__ | |
| #define PACKSTRUCT( decl ) decl __attribute__((__packed__)) | |
| #define ALIGNED __attribute__((aligned(0x4))) | |
| #else //msvc | |
| #define PACKSTRUCT( decl ) __pragma( pack(push, 1) ) decl __pragma( pack(pop) ) | |
| #define ALIGNED | |
| #endif | |
| typedef unsigned char uint8; | |
| typedef unsigned short uint16; | |
| typedef signed short int16; | |
| typedef unsigned long uint32; | |
| typedef signed char int8; | |
| typedef struct bd_addr_t | |
| { | |
| uint8 addr[6]; | |
| }bd_addr; | |
| typedef bd_addr hwaddr; | |
| typedef struct | |
| { | |
| uint8 len; | |
| uint8 data[]; | |
| }uint8array; | |
| typedef struct | |
| { | |
| uint8 len; | |
| int8 data[]; | |
| }string; | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /***************************************************************************** | |
| * | |
| * | |
| * !!!!!!!! THIS IS AUTOGENERATED FILE, DO NOT EDIT !!!!!!!! | |
| * | |
| * | |
| ****************************************************************************/ | |
| #include <stdio.h> | |
| #include "cmd_def.h" | |
| void (*bglib_output)(uint8 len1,uint8* data1,uint16 len2,uint8* data2)=0; | |
| static const struct ble_msg apis[]={ | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_system,ble_cmd_system_reset_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_hello_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_address_get_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_system,ble_cmd_system_reg_write_id}, 0x24,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_system,ble_cmd_system_reg_read_id}, 0x4,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_get_counters_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_get_connections_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_system,ble_cmd_system_read_memory_id}, 0x26,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_get_info_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_system,ble_cmd_system_endpoint_tx_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x7,ble_cls_system,ble_cmd_system_whitelist_append_id}, 0x2a,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x7,ble_cls_system,ble_cmd_system_whitelist_remove_id}, 0x2a,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_system,ble_cmd_system_whitelist_clear_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_system,ble_cmd_system_endpoint_rx_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_system,ble_cmd_system_endpoint_set_watermarks_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_defrag_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_dump_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_erase_all_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_flash,ble_cmd_flash_ps_save_id}, 0x84,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_flash,ble_cmd_flash_ps_load_id}, 0x4,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_flash,ble_cmd_flash_ps_erase_id}, 0x4,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_flash,ble_cmd_flash_erase_page_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_flash,ble_cmd_flash_write_words_id}, 0x84,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x4,ble_cls_attributes,ble_cmd_attributes_write_id}, 0x824,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x4,ble_cls_attributes,ble_cmd_attributes_read_id}, 0x44,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_attributes,ble_cmd_attributes_read_type_id}, 0x4,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_attributes,ble_cmd_attributes_user_read_response_id}, 0x822,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_attributes,ble_cmd_attributes_user_write_response_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_disconnect_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_get_rssi_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x9,ble_cls_connection,ble_cmd_connection_update_id}, 0x44442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_version_update_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_channel_map_get_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_connection,ble_cmd_connection_channel_map_set_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_features_get_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_connection,ble_cmd_connection_get_status_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_connection,ble_cmd_connection_raw_tx_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x8,ble_cls_attclient,ble_cmd_attclient_find_by_type_value_id}, 0x84442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x6,ble_cls_attclient,ble_cmd_attclient_read_by_group_type_id}, 0x8442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x6,ble_cls_attclient,ble_cmd_attclient_read_by_type_id}, 0x8442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_attclient,ble_cmd_attclient_find_information_id}, 0x442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_by_handle_id}, 0x42,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x4,ble_cls_attclient,ble_cmd_attclient_attribute_write_id}, 0x842,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x4,ble_cls_attclient,ble_cmd_attclient_write_command_id}, 0x842,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_attclient,ble_cmd_attclient_indicate_confirm_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_long_id}, 0x42,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x6,ble_cls_attclient,ble_cmd_attclient_prepare_write_id}, 0x8442,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_attclient,ble_cmd_attclient_execute_write_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_attclient,ble_cmd_attclient_read_multiple_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_sm,ble_cmd_sm_encrypt_start_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_sm,ble_cmd_sm_set_bondable_mode_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_sm,ble_cmd_sm_delete_bonding_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_sm,ble_cmd_sm_set_parameters_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_sm,ble_cmd_sm_passkey_entry_id}, 0x62,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_sm,ble_cmd_sm_get_bonds_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_sm,ble_cmd_sm_set_oob_data_id}, 0x8,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_privacy_flags_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_mode_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_gap,ble_cmd_gap_discover_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0xf,ble_cls_gap,ble_cmd_gap_connect_direct_id}, 0x44442a,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_gap,ble_cmd_gap_end_procedure_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x8,ble_cls_gap,ble_cmd_gap_connect_selective_id}, 0x4444,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_gap,ble_cmd_gap_set_filtering_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_gap,ble_cmd_gap_set_scan_parameters_id}, 0x244,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_gap,ble_cmd_gap_set_adv_parameters_id}, 0x244,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_adv_data_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x7,ble_cls_gap,ble_cmd_gap_set_directed_connectable_mode_id}, 0x2a,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_io_port_config_irq_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x6,ble_cls_hardware,ble_cmd_hardware_set_soft_timer_id}, 0x226,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_adc_read_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_direction_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_function_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_io_port_config_pull_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_io_port_write_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_read_id}, 0x22,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x6,ble_cls_hardware,ble_cmd_hardware_spi_config_id}, 0x222222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_spi_transfer_id}, 0x82,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_i2c_read_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_i2c_write_id}, 0x822,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_hardware,ble_cmd_hardware_set_txpower_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x5,ble_cls_hardware,ble_cmd_hardware_timer_comparator_id}, 0x4222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x3,ble_cls_test,ble_cmd_test_phy_tx_id}, 0x222,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_test,ble_cmd_test_phy_rx_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_test,ble_cmd_test_phy_end_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_test,ble_cmd_test_phy_reset_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_test,ble_cmd_test_get_channel_map_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_test,ble_cmd_test_debug_id}, 0x8,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_dfu,ble_cmd_dfu_reset_id}, 0x2,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x4,ble_cls_dfu,ble_cmd_dfu_flash_set_address_id}, 0x6,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x1,ble_cls_dfu,ble_cmd_dfu_flash_upload_id}, 0x8,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_cmd|0x0,0x0,ble_cls_dfu,ble_cmd_dfu_flash_upload_finish_id}, 0x0,(ble_cmd_handler)ble_default}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_system,ble_cmd_system_reset_id}, 0x0, (ble_cmd_handler)ble_rsp_system_reset}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_system,ble_cmd_system_hello_id}, 0x0, (ble_cmd_handler)ble_rsp_system_hello}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x6,ble_cls_system,ble_cmd_system_address_get_id}, 0xa, (ble_cmd_handler)ble_rsp_system_address_get}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_system,ble_cmd_system_reg_write_id}, 0x4, (ble_cmd_handler)ble_rsp_system_reg_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_system,ble_cmd_system_reg_read_id}, 0x24, (ble_cmd_handler)ble_rsp_system_reg_read}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x5,ble_cls_system,ble_cmd_system_get_counters_id}, 0x22222, (ble_cmd_handler)ble_rsp_system_get_counters}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_system,ble_cmd_system_get_connections_id}, 0x2, (ble_cmd_handler)ble_rsp_system_get_connections}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x5,ble_cls_system,ble_cmd_system_read_memory_id}, 0x86, (ble_cmd_handler)ble_rsp_system_read_memory}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0xc,ble_cls_system,ble_cmd_system_get_info_id}, 0x2244444, (ble_cmd_handler)ble_rsp_system_get_info}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_system,ble_cmd_system_endpoint_tx_id}, 0x4, (ble_cmd_handler)ble_rsp_system_endpoint_tx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_system,ble_cmd_system_whitelist_append_id}, 0x4, (ble_cmd_handler)ble_rsp_system_whitelist_append}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_system,ble_cmd_system_whitelist_remove_id}, 0x4, (ble_cmd_handler)ble_rsp_system_whitelist_remove}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_system,ble_cmd_system_whitelist_clear_id}, 0x0, (ble_cmd_handler)ble_rsp_system_whitelist_clear}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_system,ble_cmd_system_endpoint_rx_id}, 0x84, (ble_cmd_handler)ble_rsp_system_endpoint_rx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_system,ble_cmd_system_endpoint_set_watermarks_id}, 0x4, (ble_cmd_handler)ble_rsp_system_endpoint_set_watermarks}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_defrag_id}, 0x0, (ble_cmd_handler)ble_rsp_flash_ps_defrag}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_dump_id}, 0x0, (ble_cmd_handler)ble_rsp_flash_ps_dump}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_erase_all_id}, 0x0, (ble_cmd_handler)ble_rsp_flash_ps_erase_all}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_flash,ble_cmd_flash_ps_save_id}, 0x4, (ble_cmd_handler)ble_rsp_flash_ps_save}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_flash,ble_cmd_flash_ps_load_id}, 0x84, (ble_cmd_handler)ble_rsp_flash_ps_load}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_flash,ble_cmd_flash_ps_erase_id}, 0x0, (ble_cmd_handler)ble_rsp_flash_ps_erase}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_flash,ble_cmd_flash_erase_page_id}, 0x4, (ble_cmd_handler)ble_rsp_flash_erase_page}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_flash,ble_cmd_flash_write_words_id}, 0x0, (ble_cmd_handler)ble_rsp_flash_write_words}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_attributes,ble_cmd_attributes_write_id}, 0x4, (ble_cmd_handler)ble_rsp_attributes_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x7,ble_cls_attributes,ble_cmd_attributes_read_id}, 0x8444, (ble_cmd_handler)ble_rsp_attributes_read}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x5,ble_cls_attributes,ble_cmd_attributes_read_type_id}, 0x844, (ble_cmd_handler)ble_rsp_attributes_read_type}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_attributes,ble_cmd_attributes_user_read_response_id}, 0x0, (ble_cmd_handler)ble_rsp_attributes_user_read_response}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_attributes,ble_cmd_attributes_user_write_response_id}, 0x0, (ble_cmd_handler)ble_rsp_attributes_user_write_response}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_connection,ble_cmd_connection_disconnect_id}, 0x42, (ble_cmd_handler)ble_rsp_connection_disconnect}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_connection,ble_cmd_connection_get_rssi_id}, 0x32, (ble_cmd_handler)ble_rsp_connection_get_rssi}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_connection,ble_cmd_connection_update_id}, 0x42, (ble_cmd_handler)ble_rsp_connection_update}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_connection,ble_cmd_connection_version_update_id}, 0x42, (ble_cmd_handler)ble_rsp_connection_version_update}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_connection,ble_cmd_connection_channel_map_get_id}, 0x82, (ble_cmd_handler)ble_rsp_connection_channel_map_get}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_connection,ble_cmd_connection_channel_map_set_id}, 0x42, (ble_cmd_handler)ble_rsp_connection_channel_map_set}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_connection,ble_cmd_connection_features_get_id}, 0x42, (ble_cmd_handler)ble_rsp_connection_features_get}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_connection,ble_cmd_connection_get_status_id}, 0x2, (ble_cmd_handler)ble_rsp_connection_get_status}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_connection,ble_cmd_connection_raw_tx_id}, 0x2, (ble_cmd_handler)ble_rsp_connection_raw_tx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_find_by_type_value_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_find_by_type_value}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_by_group_type_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_read_by_group_type}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_by_type_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_read_by_type}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_find_information_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_find_information}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_by_handle_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_read_by_handle}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_attribute_write_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_attribute_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_write_command_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_write_command}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_attclient,ble_cmd_attclient_indicate_confirm_id}, 0x4, (ble_cmd_handler)ble_rsp_attclient_indicate_confirm}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_long_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_read_long}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_prepare_write_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_prepare_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_execute_write_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_execute_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_attclient,ble_cmd_attclient_read_multiple_id}, 0x42, (ble_cmd_handler)ble_rsp_attclient_read_multiple}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_sm,ble_cmd_sm_encrypt_start_id}, 0x42, (ble_cmd_handler)ble_rsp_sm_encrypt_start}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_sm,ble_cmd_sm_set_bondable_mode_id}, 0x0, (ble_cmd_handler)ble_rsp_sm_set_bondable_mode}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_sm,ble_cmd_sm_delete_bonding_id}, 0x4, (ble_cmd_handler)ble_rsp_sm_delete_bonding}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_sm,ble_cmd_sm_set_parameters_id}, 0x0, (ble_cmd_handler)ble_rsp_sm_set_parameters}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_sm,ble_cmd_sm_passkey_entry_id}, 0x4, (ble_cmd_handler)ble_rsp_sm_passkey_entry}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_sm,ble_cmd_sm_get_bonds_id}, 0x2, (ble_cmd_handler)ble_rsp_sm_get_bonds}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_sm,ble_cmd_sm_set_oob_data_id}, 0x0, (ble_cmd_handler)ble_rsp_sm_set_oob_data}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_gap,ble_cmd_gap_set_privacy_flags_id}, 0x0, (ble_cmd_handler)ble_rsp_gap_set_privacy_flags}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_mode_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_mode}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_discover_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_discover}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_gap,ble_cmd_gap_connect_direct_id}, 0x24, (ble_cmd_handler)ble_rsp_gap_connect_direct}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_end_procedure_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_end_procedure}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_gap,ble_cmd_gap_connect_selective_id}, 0x24, (ble_cmd_handler)ble_rsp_gap_connect_selective}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_filtering_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_filtering}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_scan_parameters_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_scan_parameters}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_adv_parameters_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_adv_parameters}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_adv_data_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_adv_data}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_gap,ble_cmd_gap_set_directed_connectable_mode_id}, 0x4, (ble_cmd_handler)ble_rsp_gap_set_directed_connectable_mode}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_irq_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_io_port_config_irq}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_set_soft_timer_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_set_soft_timer}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_adc_read_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_adc_read}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_direction_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_io_port_config_direction}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_function_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_io_port_config_function}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_config_pull_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_io_port_config_pull}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_io_port_write_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_io_port_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x4,ble_cls_hardware,ble_cmd_hardware_io_port_read_id}, 0x224, (ble_cmd_handler)ble_rsp_hardware_io_port_read}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_spi_config_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_spi_config}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x4,ble_cls_hardware,ble_cmd_hardware_spi_transfer_id}, 0x824, (ble_cmd_handler)ble_rsp_hardware_spi_transfer}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x3,ble_cls_hardware,ble_cmd_hardware_i2c_read_id}, 0x84, (ble_cmd_handler)ble_rsp_hardware_i2c_read}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_hardware,ble_cmd_hardware_i2c_write_id}, 0x2, (ble_cmd_handler)ble_rsp_hardware_i2c_write}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_hardware,ble_cmd_hardware_set_txpower_id}, 0x0, (ble_cmd_handler)ble_rsp_hardware_set_txpower}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_hardware,ble_cmd_hardware_timer_comparator_id}, 0x4, (ble_cmd_handler)ble_rsp_hardware_timer_comparator}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_test,ble_cmd_test_phy_tx_id}, 0x0, (ble_cmd_handler)ble_rsp_test_phy_tx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_test,ble_cmd_test_phy_rx_id}, 0x0, (ble_cmd_handler)ble_rsp_test_phy_rx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_test,ble_cmd_test_phy_end_id}, 0x4, (ble_cmd_handler)ble_rsp_test_phy_end}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_test,ble_cmd_test_phy_reset_id}, 0x0, (ble_cmd_handler)ble_rsp_test_phy_reset}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_test,ble_cmd_test_get_channel_map_id}, 0x8, (ble_cmd_handler)ble_rsp_test_get_channel_map}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x1,ble_cls_test,ble_cmd_test_debug_id}, 0x8, (ble_cmd_handler)ble_rsp_test_debug}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x0,ble_cls_dfu,ble_cmd_dfu_reset_id}, 0x0, (ble_cmd_handler)ble_rsp_dfu_reset}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_dfu,ble_cmd_dfu_flash_set_address_id}, 0x4, (ble_cmd_handler)ble_rsp_dfu_flash_set_address}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_dfu,ble_cmd_dfu_flash_upload_id}, 0x4, (ble_cmd_handler)ble_rsp_dfu_flash_upload}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_rsp|0x0,0x2,ble_cls_dfu,ble_cmd_dfu_flash_upload_finish_id}, 0x4, (ble_cmd_handler)ble_rsp_dfu_flash_upload_finish}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0xc,ble_cls_system,ble_evt_system_boot_id}, 0x2244444, (ble_cmd_handler)ble_evt_system_boot}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x1,ble_cls_system,ble_evt_system_debug_id}, 0x8, (ble_cmd_handler)ble_evt_system_debug}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_system,ble_evt_system_endpoint_watermark_rx_id}, 0x22, (ble_cmd_handler)ble_evt_system_endpoint_watermark_rx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_system,ble_evt_system_endpoint_watermark_tx_id}, 0x22, (ble_cmd_handler)ble_evt_system_endpoint_watermark_tx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x4,ble_cls_system,ble_evt_system_script_failure_id}, 0x44, (ble_cmd_handler)ble_evt_system_script_failure}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x0,ble_cls_system,ble_evt_system_no_license_key_id}, 0x0, (ble_cmd_handler)ble_evt_system_no_license_key}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_flash,ble_evt_flash_ps_key_id}, 0x84, (ble_cmd_handler)ble_evt_flash_ps_key}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x7,ble_cls_attributes,ble_evt_attributes_value_id}, 0x84422, (ble_cmd_handler)ble_evt_attributes_value}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x6,ble_cls_attributes,ble_evt_attributes_user_read_request_id}, 0x2442, (ble_cmd_handler)ble_evt_attributes_user_read_request}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_attributes,ble_evt_attributes_status_id}, 0x24, (ble_cmd_handler)ble_evt_attributes_status}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x10,ble_cls_connection,ble_evt_connection_status_id}, 0x24442a22, (ble_cmd_handler)ble_evt_connection_status}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x6,ble_cls_connection,ble_evt_connection_version_ind_id}, 0x4422, (ble_cmd_handler)ble_evt_connection_version_ind}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_connection,ble_evt_connection_feature_ind_id}, 0x82, (ble_cmd_handler)ble_evt_connection_feature_ind}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_connection,ble_evt_connection_raw_rx_id}, 0x82, (ble_cmd_handler)ble_evt_connection_raw_rx}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_connection,ble_evt_connection_disconnected_id}, 0x42, (ble_cmd_handler)ble_evt_connection_disconnected}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_attclient,ble_evt_attclient_indicated_id}, 0x42, (ble_cmd_handler)ble_evt_attclient_indicated}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x5,ble_cls_attclient,ble_evt_attclient_procedure_completed_id}, 0x442, (ble_cmd_handler)ble_evt_attclient_procedure_completed}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x6,ble_cls_attclient,ble_evt_attclient_group_found_id}, 0x8442, (ble_cmd_handler)ble_evt_attclient_group_found}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x7,ble_cls_attclient,ble_evt_attclient_attribute_found_id}, 0x82442, (ble_cmd_handler)ble_evt_attclient_attribute_found}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x4,ble_cls_attclient,ble_evt_attclient_find_information_found_id}, 0x842, (ble_cmd_handler)ble_evt_attclient_find_information_found}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x5,ble_cls_attclient,ble_evt_attclient_attribute_value_id}, 0x8242, (ble_cmd_handler)ble_evt_attclient_attribute_value}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_attclient,ble_evt_attclient_read_multiple_response_id}, 0x82, (ble_cmd_handler)ble_evt_attclient_read_multiple_response}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_sm,ble_evt_sm_smp_data_id}, 0x822, (ble_cmd_handler)ble_evt_sm_smp_data}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_sm,ble_evt_sm_bonding_fail_id}, 0x42, (ble_cmd_handler)ble_evt_sm_bonding_fail}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x5,ble_cls_sm,ble_evt_sm_passkey_display_id}, 0x62, (ble_cmd_handler)ble_evt_sm_passkey_display}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x1,ble_cls_sm,ble_evt_sm_passkey_request_id}, 0x2, (ble_cmd_handler)ble_evt_sm_passkey_request}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x4,ble_cls_sm,ble_evt_sm_bond_status_id}, 0x2222, (ble_cmd_handler)ble_evt_sm_bond_status}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0xb,ble_cls_gap,ble_evt_gap_scan_response_id}, 0x822a23, (ble_cmd_handler)ble_evt_gap_scan_response}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x2,ble_cls_gap,ble_evt_gap_mode_changed_id}, 0x22, (ble_cmd_handler)ble_evt_gap_mode_changed}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x7,ble_cls_hardware,ble_evt_hardware_io_port_status_id}, 0x2226, (ble_cmd_handler)ble_evt_hardware_io_port_status}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x1,ble_cls_hardware,ble_evt_hardware_soft_timer_id}, 0x2, (ble_cmd_handler)ble_evt_hardware_soft_timer}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x3,ble_cls_hardware,ble_evt_hardware_adc_result_id}, 0x52, (ble_cmd_handler)ble_evt_hardware_adc_result}, | |
| {{(uint8)ble_dev_type_ble|(uint8)ble_msg_type_evt|0x0,0x4,ble_cls_dfu,ble_evt_dfu_boot_id}, 0x6, (ble_cmd_handler)ble_evt_dfu_boot}, | |
| {{0,0,0,0}, 0, 0}}; | |
| const struct ble_msg * ble_get_msg(uint8 idx) | |
| { | |
| return &apis[idx]; | |
| } | |
| const struct ble_msg * ble_find_msg_hdr(struct ble_header hdr) | |
| { | |
| const struct ble_msg *msg=apis; | |
| while(msg->handler) | |
| { | |
| if(((msg->hdr.type_hilen&0xF8)==(hdr.type_hilen&0xF8))&& | |
| (msg->hdr.cls==hdr.cls)&& | |
| (msg->hdr.command==hdr.command))return msg; | |
| msg++; | |
| } | |
| return 0; | |
| } | |
| const struct ble_msg * ble_get_msg_hdr(struct ble_header hdr) | |
| { | |
| if((hdr.type_hilen&0x80)==ble_msg_type_evt) | |
| { | |
| if(hdr.cls>=(sizeof(ble_class_evt_handlers)/sizeof(struct ble_class_handler_t))) | |
| return NULL; | |
| if(hdr.command>=ble_class_evt_handlers[hdr.cls].maxhandlers) | |
| return NULL; | |
| return ble_class_evt_handlers[hdr.cls].msgs[hdr.command]; | |
| }else | |
| if((hdr.type_hilen&0x80)==ble_msg_type_rsp) | |
| { | |
| if(hdr.cls>=(sizeof(ble_class_rsp_handlers)/sizeof(struct ble_class_handler_t))) | |
| return NULL; | |
| if(hdr.command>=ble_class_rsp_handlers[hdr.cls].maxhandlers) | |
| return NULL; | |
| return ble_class_rsp_handlers[hdr.cls].msgs[hdr.command]; | |
| } | |
| return ble_find_msg_hdr(hdr); | |
| } | |
| void ble_send_message(uint8 msgid,...) | |
| { | |
| uint32 i; | |
| uint32 u32; | |
| uint16 u16; | |
| uint8 u8; | |
| struct ble_cmd_packet packet; | |
| uint8 *b=(uint8 *)&packet.payload; | |
| uint8 *hw; | |
| uint8 *data_ptr=0; | |
| uint16 data_len=0; | |
| va_list va; | |
| va_start(va,msgid); | |
| i=apis[msgid].params; | |
| packet.header=apis[msgid].hdr; | |
| while(i) | |
| { | |
| switch(i&0xF) | |
| { | |
| case 7://int32 | |
| case 6://uint32 | |
| u32=va_arg(va,uint32); | |
| *b++=u32&0xff;u32>>=8; | |
| *b++=u32&0xff;u32>>=8; | |
| *b++=u32&0xff;u32>>=8; | |
| *b++=u32&0xff; | |
| break; | |
| case 5://int16 | |
| case 4://uint16 | |
| u16=va_arg(va,unsigned); | |
| *b++=u16&0xff;u16>>=8; | |
| *b++=u16&0xff; | |
| break; | |
| case 3://int8 | |
| case 2://uint8 | |
| u8=va_arg(va,int); | |
| *b++=u8&0xff; | |
| break; | |
| case 9://string | |
| case 8://uint8 array | |
| data_len=va_arg(va,int); | |
| *b++=data_len; | |
| //assuming default packet<256 | |
| u16=data_len+packet.header.lolen; | |
| packet.header.lolen=u16&0xff; | |
| packet.header.type_hilen|=u16>>8; | |
| data_ptr=va_arg(va,uint8*); | |
| break; | |
| case 10://hwaddr | |
| hw=va_arg(va,uint8*); | |
| *b++=*hw++; | |
| *b++=*hw++; | |
| *b++=*hw++; | |
| *b++=*hw++; | |
| *b++=*hw++; | |
| *b++=*hw++; | |
| break; | |
| } | |
| i=i>>4; | |
| } | |
| va_end(va); if(bglib_output)bglib_output(sizeof(struct ble_header)+apis[msgid].hdr.lolen,(uint8*)&packet,data_len,(uint8*)data_ptr); | |
| } | |
| static const struct ble_msg* ble_class_system_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_system_reset_idx], | |
| &apis[ble_rsp_system_hello_idx], | |
| &apis[ble_rsp_system_address_get_idx], | |
| &apis[ble_rsp_system_reg_write_idx], | |
| &apis[ble_rsp_system_reg_read_idx], | |
| &apis[ble_rsp_system_get_counters_idx], | |
| &apis[ble_rsp_system_get_connections_idx], | |
| &apis[ble_rsp_system_read_memory_idx], | |
| &apis[ble_rsp_system_get_info_idx], | |
| &apis[ble_rsp_system_endpoint_tx_idx], | |
| &apis[ble_rsp_system_whitelist_append_idx], | |
| &apis[ble_rsp_system_whitelist_remove_idx], | |
| &apis[ble_rsp_system_whitelist_clear_idx], | |
| &apis[ble_rsp_system_endpoint_rx_idx], | |
| &apis[ble_rsp_system_endpoint_set_watermarks_idx], | |
| }; | |
| static const struct ble_msg* ble_class_system_evt_handlers[]= | |
| { | |
| &apis[ble_evt_system_boot_idx], | |
| &apis[ble_evt_system_debug_idx], | |
| &apis[ble_evt_system_endpoint_watermark_rx_idx], | |
| &apis[ble_evt_system_endpoint_watermark_tx_idx], | |
| &apis[ble_evt_system_script_failure_idx], | |
| &apis[ble_evt_system_no_license_key_idx], | |
| }; | |
| static const struct ble_msg* ble_class_flash_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_flash_ps_defrag_idx], | |
| &apis[ble_rsp_flash_ps_dump_idx], | |
| &apis[ble_rsp_flash_ps_erase_all_idx], | |
| &apis[ble_rsp_flash_ps_save_idx], | |
| &apis[ble_rsp_flash_ps_load_idx], | |
| &apis[ble_rsp_flash_ps_erase_idx], | |
| &apis[ble_rsp_flash_erase_page_idx], | |
| &apis[ble_rsp_flash_write_words_idx], | |
| }; | |
| static const struct ble_msg* ble_class_flash_evt_handlers[]= | |
| { | |
| &apis[ble_evt_flash_ps_key_idx], | |
| }; | |
| static const struct ble_msg* ble_class_attributes_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_attributes_write_idx], | |
| &apis[ble_rsp_attributes_read_idx], | |
| &apis[ble_rsp_attributes_read_type_idx], | |
| &apis[ble_rsp_attributes_user_read_response_idx], | |
| &apis[ble_rsp_attributes_user_write_response_idx], | |
| }; | |
| static const struct ble_msg* ble_class_attributes_evt_handlers[]= | |
| { | |
| &apis[ble_evt_attributes_value_idx], | |
| &apis[ble_evt_attributes_user_read_request_idx], | |
| &apis[ble_evt_attributes_status_idx], | |
| }; | |
| static const struct ble_msg* ble_class_connection_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_connection_disconnect_idx], | |
| &apis[ble_rsp_connection_get_rssi_idx], | |
| &apis[ble_rsp_connection_update_idx], | |
| &apis[ble_rsp_connection_version_update_idx], | |
| &apis[ble_rsp_connection_channel_map_get_idx], | |
| &apis[ble_rsp_connection_channel_map_set_idx], | |
| &apis[ble_rsp_connection_features_get_idx], | |
| &apis[ble_rsp_connection_get_status_idx], | |
| &apis[ble_rsp_connection_raw_tx_idx], | |
| }; | |
| static const struct ble_msg* ble_class_connection_evt_handlers[]= | |
| { | |
| &apis[ble_evt_connection_status_idx], | |
| &apis[ble_evt_connection_version_ind_idx], | |
| &apis[ble_evt_connection_feature_ind_idx], | |
| &apis[ble_evt_connection_raw_rx_idx], | |
| &apis[ble_evt_connection_disconnected_idx], | |
| }; | |
| static const struct ble_msg* ble_class_attclient_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_attclient_find_by_type_value_idx], | |
| &apis[ble_rsp_attclient_read_by_group_type_idx], | |
| &apis[ble_rsp_attclient_read_by_type_idx], | |
| &apis[ble_rsp_attclient_find_information_idx], | |
| &apis[ble_rsp_attclient_read_by_handle_idx], | |
| &apis[ble_rsp_attclient_attribute_write_idx], | |
| &apis[ble_rsp_attclient_write_command_idx], | |
| &apis[ble_rsp_attclient_indicate_confirm_idx], | |
| &apis[ble_rsp_attclient_read_long_idx], | |
| &apis[ble_rsp_attclient_prepare_write_idx], | |
| &apis[ble_rsp_attclient_execute_write_idx], | |
| &apis[ble_rsp_attclient_read_multiple_idx], | |
| }; | |
| static const struct ble_msg* ble_class_attclient_evt_handlers[]= | |
| { | |
| &apis[ble_evt_attclient_indicated_idx], | |
| &apis[ble_evt_attclient_procedure_completed_idx], | |
| &apis[ble_evt_attclient_group_found_idx], | |
| &apis[ble_evt_attclient_attribute_found_idx], | |
| &apis[ble_evt_attclient_find_information_found_idx], | |
| &apis[ble_evt_attclient_attribute_value_idx], | |
| &apis[ble_evt_attclient_read_multiple_response_idx], | |
| }; | |
| static const struct ble_msg* ble_class_sm_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_sm_encrypt_start_idx], | |
| &apis[ble_rsp_sm_set_bondable_mode_idx], | |
| &apis[ble_rsp_sm_delete_bonding_idx], | |
| &apis[ble_rsp_sm_set_parameters_idx], | |
| &apis[ble_rsp_sm_passkey_entry_idx], | |
| &apis[ble_rsp_sm_get_bonds_idx], | |
| &apis[ble_rsp_sm_set_oob_data_idx], | |
| }; | |
| static const struct ble_msg* ble_class_sm_evt_handlers[]= | |
| { | |
| &apis[ble_evt_sm_smp_data_idx], | |
| &apis[ble_evt_sm_bonding_fail_idx], | |
| &apis[ble_evt_sm_passkey_display_idx], | |
| &apis[ble_evt_sm_passkey_request_idx], | |
| &apis[ble_evt_sm_bond_status_idx], | |
| }; | |
| static const struct ble_msg* ble_class_gap_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_gap_set_privacy_flags_idx], | |
| &apis[ble_rsp_gap_set_mode_idx], | |
| &apis[ble_rsp_gap_discover_idx], | |
| &apis[ble_rsp_gap_connect_direct_idx], | |
| &apis[ble_rsp_gap_end_procedure_idx], | |
| &apis[ble_rsp_gap_connect_selective_idx], | |
| &apis[ble_rsp_gap_set_filtering_idx], | |
| &apis[ble_rsp_gap_set_scan_parameters_idx], | |
| &apis[ble_rsp_gap_set_adv_parameters_idx], | |
| &apis[ble_rsp_gap_set_adv_data_idx], | |
| &apis[ble_rsp_gap_set_directed_connectable_mode_idx], | |
| }; | |
| static const struct ble_msg* ble_class_gap_evt_handlers[]= | |
| { | |
| &apis[ble_evt_gap_scan_response_idx], | |
| &apis[ble_evt_gap_mode_changed_idx], | |
| }; | |
| static const struct ble_msg* ble_class_hardware_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_hardware_io_port_config_irq_idx], | |
| &apis[ble_rsp_hardware_set_soft_timer_idx], | |
| &apis[ble_rsp_hardware_adc_read_idx], | |
| &apis[ble_rsp_hardware_io_port_config_direction_idx], | |
| &apis[ble_rsp_hardware_io_port_config_function_idx], | |
| &apis[ble_rsp_hardware_io_port_config_pull_idx], | |
| &apis[ble_rsp_hardware_io_port_write_idx], | |
| &apis[ble_rsp_hardware_io_port_read_idx], | |
| &apis[ble_rsp_hardware_spi_config_idx], | |
| &apis[ble_rsp_hardware_spi_transfer_idx], | |
| &apis[ble_rsp_hardware_i2c_read_idx], | |
| &apis[ble_rsp_hardware_i2c_write_idx], | |
| &apis[ble_rsp_hardware_set_txpower_idx], | |
| &apis[ble_rsp_hardware_timer_comparator_idx], | |
| }; | |
| static const struct ble_msg* ble_class_hardware_evt_handlers[]= | |
| { | |
| &apis[ble_evt_hardware_io_port_status_idx], | |
| &apis[ble_evt_hardware_soft_timer_idx], | |
| &apis[ble_evt_hardware_adc_result_idx], | |
| }; | |
| static const struct ble_msg* ble_class_test_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_test_phy_tx_idx], | |
| &apis[ble_rsp_test_phy_rx_idx], | |
| &apis[ble_rsp_test_phy_end_idx], | |
| &apis[ble_rsp_test_phy_reset_idx], | |
| &apis[ble_rsp_test_get_channel_map_idx], | |
| &apis[ble_rsp_test_debug_idx], | |
| }; | |
| static const struct ble_msg* ble_class_dfu_rsp_handlers[]= | |
| { | |
| &apis[ble_rsp_dfu_reset_idx], | |
| &apis[ble_rsp_dfu_flash_set_address_idx], | |
| &apis[ble_rsp_dfu_flash_upload_idx], | |
| &apis[ble_rsp_dfu_flash_upload_finish_idx], | |
| }; | |
| static const struct ble_msg* ble_class_dfu_evt_handlers[]= | |
| { | |
| &apis[ble_evt_dfu_boot_idx], | |
| }; | |
| struct ble_class_handler_t ble_class_rsp_handlers[ble_cls_last]= | |
| { | |
| {ble_class_system_rsp_handlers,15}, | |
| {ble_class_flash_rsp_handlers,8}, | |
| {ble_class_attributes_rsp_handlers,5}, | |
| {ble_class_connection_rsp_handlers,9}, | |
| {ble_class_attclient_rsp_handlers,12}, | |
| {ble_class_sm_rsp_handlers,7}, | |
| {ble_class_gap_rsp_handlers,11}, | |
| {ble_class_hardware_rsp_handlers,14}, | |
| {ble_class_test_rsp_handlers,6}, | |
| {ble_class_dfu_rsp_handlers,4}, | |
| }; | |
| struct ble_class_handler_t ble_class_evt_handlers[ble_cls_last]= | |
| { | |
| {ble_class_system_evt_handlers,6}, | |
| {ble_class_flash_evt_handlers,1}, | |
| {ble_class_attributes_evt_handlers,3}, | |
| {ble_class_connection_evt_handlers,5}, | |
| {ble_class_attclient_evt_handlers,7}, | |
| {ble_class_sm_evt_handlers,5}, | |
| {ble_class_gap_evt_handlers,2}, | |
| {ble_class_hardware_evt_handlers,3}, | |
| {NULL,0}, | |
| {ble_class_dfu_evt_handlers,1}, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef cmd_def_h | |
| #define cmd_def_h | |
| /***************************************************************************** | |
| * | |
| * | |
| * !!!!!!!! THIS IS AUTOGENERATED FILE, DO NOT EDIT !!!!!!!! | |
| * | |
| * | |
| ****************************************************************************/ | |
| #include <stdarg.h> | |
| #include "apitypes.h" | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| /* Compability */ | |
| #ifndef PACKSTRUCT | |
| #ifdef PACKED | |
| #define PACKSTRUCT(a) a PACKED | |
| #else | |
| /*Default packed configuration*/ | |
| #ifdef __GNUC__ | |
| #define PACKSTRUCT( decl ) decl __attribute__((__packed__)) | |
| #define ALIGNED __attribute__((aligned(0x4))) | |
| #else //msvc | |
| #define PACKSTRUCT( decl ) __pragma( pack(push, 1) ) decl __pragma( pack(pop) ) | |
| #define ALIGNED | |
| #endif | |
| #endif | |
| #endif | |
| struct ble_cmd_packet; | |
| typedef void (*ble_cmd_handler)(const void*); | |
| struct ble_header | |
| { | |
| uint8 type_hilen; | |
| uint8 lolen; | |
| uint8 cls; | |
| uint8 command; | |
| }; | |
| struct ble_msg | |
| { | |
| struct ble_header hdr; | |
| uint32 params; | |
| ble_cmd_handler handler; | |
| }; | |
| const struct ble_msg * ble_find_msg_hdr(struct ble_header hdr); | |
| const struct ble_msg * ble_get_msg(uint8 idx) ; | |
| const struct ble_msg * ble_get_msg_hdr(struct ble_header hdr) ; | |
| extern void (*bglib_output)(uint8 len1,uint8* data1,uint16 len2,uint8* data2); | |
| void ble_send_message(uint8 msgid,...); | |
| enum system_endpoints | |
| { | |
| system_endpoint_api = 0, | |
| system_endpoint_test = 1, | |
| system_endpoint_script = 2, | |
| system_endpoint_usb = 3, | |
| system_endpoint_uart0 = 4, | |
| system_endpoint_uart1 = 5, | |
| system_endpoints_max = 6 | |
| }; | |
| enum attributes_attribute_change_reason | |
| { | |
| attributes_attribute_change_reason_write_request = 0, | |
| attributes_attribute_change_reason_write_command = 1, | |
| attributes_attribute_change_reason_write_request_user = 2, | |
| attributes_attribute_change_reason_max = 3 | |
| }; | |
| enum attributes_attribute_status_flag | |
| { | |
| attributes_attribute_status_flag_notify = 1, | |
| attributes_attribute_status_flag_indicate = 2, | |
| attributes_attribute_status_flag_max = 3 | |
| }; | |
| enum connection_connstatus | |
| { | |
| connection_connected = 1, | |
| connection_encrypted = 2, | |
| connection_completed = 4, | |
| connection_parameters_change = 8, | |
| connection_connstatus_max = 9 | |
| }; | |
| enum attclient_attribute_value_types | |
| { | |
| attclient_attribute_value_type_read = 0, | |
| attclient_attribute_value_type_notify = 1, | |
| attclient_attribute_value_type_indicate = 2, | |
| attclient_attribute_value_type_read_by_type = 3, | |
| attclient_attribute_value_type_read_blob = 4, | |
| attclient_attribute_value_type_indicate_rsp_req = 5, | |
| attclient_attribute_value_types_max = 6 | |
| }; | |
| enum sm_bonding_key | |
| { | |
| sm_bonding_key_ltk = 0x01, | |
| sm_bonding_key_addr_public = 0x02, | |
| sm_bonding_key_addr_static = 0x04, | |
| sm_bonding_key_irk = 0x08, | |
| sm_bonding_key_edivrand = 0x10, | |
| sm_bonding_key_csrk = 0x20, | |
| sm_bonding_key_masterid = 0x40, | |
| sm_bonding_key_max = 65 | |
| }; | |
| enum sm_io_capability | |
| { | |
| sm_io_capability_displayonly = 0, | |
| sm_io_capability_displayyesno = 1, | |
| sm_io_capability_keyboardonly = 2, | |
| sm_io_capability_noinputnooutput = 3, | |
| sm_io_capability_keyboarddisplay = 4, | |
| sm_io_capability_max = 5 | |
| }; | |
| #define GAP_SCAN_HEADER_ADV_IND 0 | |
| #define GAP_SCAN_HEADER_ADV_DIRECT_IND 1 | |
| #define GAP_SCAN_HEADER_ADV_NONCONN_IND 2 | |
| #define GAP_SCAN_HEADER_SCAN_REQ 3 | |
| #define GAP_SCAN_HEADER_SCAN_RSP 4 | |
| #define GAP_SCAN_HEADER_CONNECT_REQ 5 | |
| #define GAP_SCAN_HEADER_ADV_DISCOVER_IND 6 | |
| #define GAP_AD_FLAG_LIMITED_DISCOVERABLE 0x01 | |
| #define GAP_AD_FLAG_GENERAL_DISCOVERABLE 0x02 | |
| #define GAP_AD_FLAG_BREDR_NOT_SUPPORTED 0x04 | |
| #define GAP_AD_FLAG_SIMULTANEOUS_LEBREDR_CTRL 0x10 | |
| #define GAP_AD_FLAG_SIMULTANEOUS_LEBREDR_HOST 0x20 | |
| #define GAP_AD_FLAG_MASK 0x1f | |
| enum gap_address_type | |
| { | |
| gap_address_type_public = 0, | |
| gap_address_type_random = 1, | |
| gap_address_type_max = 2 | |
| }; | |
| enum gap_discoverable_mode | |
| { | |
| gap_non_discoverable = 0, | |
| gap_limited_discoverable = 1, | |
| gap_general_discoverable = 2, | |
| gap_broadcast = 3, | |
| gap_user_data = 4, | |
| gap_discoverable_mode_max= 5 | |
| }; | |
| enum gap_connectable_mode | |
| { | |
| gap_non_connectable = 0, | |
| gap_directed_connectable = 1, | |
| gap_undirected_connectable = 2, | |
| gap_scannable_connectable = 3, | |
| gap_connectable_mode_max = 4 | |
| }; | |
| enum gap_discover_mode | |
| { | |
| gap_discover_limited = 0, | |
| gap_discover_generic = 1, | |
| gap_discover_observation = 2, | |
| gap_discover_mode_max = 3 | |
| }; | |
| enum gap_ad_types | |
| { | |
| gap_ad_type_none = 0, | |
| gap_ad_type_flags = 1, | |
| gap_ad_type_services_16bit_more = 2, | |
| gap_ad_type_services_16bit_all = 3, | |
| gap_ad_type_services_32bit_more = 4, | |
| gap_ad_type_services_32bit_all = 5, | |
| gap_ad_type_services_128bit_more = 6, | |
| gap_ad_type_services_128bit_all = 7, | |
| gap_ad_type_localname_short = 8, | |
| gap_ad_type_localname_complete = 9, | |
| gap_ad_type_txpower = 10, | |
| gap_ad_types_max = 11 | |
| }; | |
| enum gap_advertising_policy | |
| { | |
| gap_adv_policy_all = 0, | |
| gap_adv_policy_whitelist_scan = 1, | |
| gap_adv_policy_whitelist_connect = 2, | |
| gap_adv_policy_whitelist_all = 3, | |
| gap_advertising_policy_max = 4 | |
| }; | |
| enum gap_scan_policy | |
| { | |
| gap_scan_policy_all = 0, | |
| gap_scan_policy_whitelist = 1, | |
| gap_scan_policy_max = 2 | |
| }; | |
| enum ble_parameter_types | |
| { | |
| ble_msg_parameter_uint8=2, | |
| ble_msg_parameter_int8=3, | |
| ble_msg_parameter_uint16=4, | |
| ble_msg_parameter_int16=5, | |
| ble_msg_parameter_uint32=6, | |
| ble_msg_parameter_int32=7, | |
| ble_msg_parameter_uint8array=8, | |
| ble_msg_parameter_string=9, | |
| ble_msg_parameter_hwaddr=10 | |
| }; | |
| enum ble_msg_types | |
| { | |
| ble_msg_type_cmd=0x00, | |
| ble_msg_type_rsp=0x00, | |
| ble_msg_type_evt=0x80, | |
| }; | |
| enum ble_dev_types | |
| { | |
| ble_dev_type_ble =0x00, | |
| ble_dev_type_wifi =0x08, | |
| ble_dev_type_iwrap =0x10, | |
| }; | |
| enum ble_classes | |
| { | |
| ble_cls_system, | |
| ble_cls_flash, | |
| ble_cls_attributes, | |
| ble_cls_connection, | |
| ble_cls_attclient, | |
| ble_cls_sm, | |
| ble_cls_gap, | |
| ble_cls_hardware, | |
| ble_cls_test, | |
| ble_cls_dfu, | |
| ble_cls_last | |
| }; | |
| enum ble_command_ids | |
| { | |
| ble_cmd_system_reset_id=0, | |
| ble_cmd_system_hello_id=1, | |
| ble_cmd_system_address_get_id=2, | |
| ble_cmd_system_reg_write_id=3, | |
| ble_cmd_system_reg_read_id=4, | |
| ble_cmd_system_get_counters_id=5, | |
| ble_cmd_system_get_connections_id=6, | |
| ble_cmd_system_read_memory_id=7, | |
| ble_cmd_system_get_info_id=8, | |
| ble_cmd_system_endpoint_tx_id=9, | |
| ble_cmd_system_whitelist_append_id=10, | |
| ble_cmd_system_whitelist_remove_id=11, | |
| ble_cmd_system_whitelist_clear_id=12, | |
| ble_cmd_system_endpoint_rx_id=13, | |
| ble_cmd_system_endpoint_set_watermarks_id=14, | |
| ble_cmd_flash_ps_defrag_id=0, | |
| ble_cmd_flash_ps_dump_id=1, | |
| ble_cmd_flash_ps_erase_all_id=2, | |
| ble_cmd_flash_ps_save_id=3, | |
| ble_cmd_flash_ps_load_id=4, | |
| ble_cmd_flash_ps_erase_id=5, | |
| ble_cmd_flash_erase_page_id=6, | |
| ble_cmd_flash_write_words_id=7, | |
| ble_cmd_attributes_write_id=0, | |
| ble_cmd_attributes_read_id=1, | |
| ble_cmd_attributes_read_type_id=2, | |
| ble_cmd_attributes_user_read_response_id=3, | |
| ble_cmd_attributes_user_write_response_id=4, | |
| ble_cmd_connection_disconnect_id=0, | |
| ble_cmd_connection_get_rssi_id=1, | |
| ble_cmd_connection_update_id=2, | |
| ble_cmd_connection_version_update_id=3, | |
| ble_cmd_connection_channel_map_get_id=4, | |
| ble_cmd_connection_channel_map_set_id=5, | |
| ble_cmd_connection_features_get_id=6, | |
| ble_cmd_connection_get_status_id=7, | |
| ble_cmd_connection_raw_tx_id=8, | |
| ble_cmd_attclient_find_by_type_value_id=0, | |
| ble_cmd_attclient_read_by_group_type_id=1, | |
| ble_cmd_attclient_read_by_type_id=2, | |
| ble_cmd_attclient_find_information_id=3, | |
| ble_cmd_attclient_read_by_handle_id=4, | |
| ble_cmd_attclient_attribute_write_id=5, | |
| ble_cmd_attclient_write_command_id=6, | |
| ble_cmd_attclient_indicate_confirm_id=7, | |
| ble_cmd_attclient_read_long_id=8, | |
| ble_cmd_attclient_prepare_write_id=9, | |
| ble_cmd_attclient_execute_write_id=10, | |
| ble_cmd_attclient_read_multiple_id=11, | |
| ble_cmd_sm_encrypt_start_id=0, | |
| ble_cmd_sm_set_bondable_mode_id=1, | |
| ble_cmd_sm_delete_bonding_id=2, | |
| ble_cmd_sm_set_parameters_id=3, | |
| ble_cmd_sm_passkey_entry_id=4, | |
| ble_cmd_sm_get_bonds_id=5, | |
| ble_cmd_sm_set_oob_data_id=6, | |
| ble_cmd_gap_set_privacy_flags_id=0, | |
| ble_cmd_gap_set_mode_id=1, | |
| ble_cmd_gap_discover_id=2, | |
| ble_cmd_gap_connect_direct_id=3, | |
| ble_cmd_gap_end_procedure_id=4, | |
| ble_cmd_gap_connect_selective_id=5, | |
| ble_cmd_gap_set_filtering_id=6, | |
| ble_cmd_gap_set_scan_parameters_id=7, | |
| ble_cmd_gap_set_adv_parameters_id=8, | |
| ble_cmd_gap_set_adv_data_id=9, | |
| ble_cmd_gap_set_directed_connectable_mode_id=10, | |
| ble_cmd_hardware_io_port_config_irq_id=0, | |
| ble_cmd_hardware_set_soft_timer_id=1, | |
| ble_cmd_hardware_adc_read_id=2, | |
| ble_cmd_hardware_io_port_config_direction_id=3, | |
| ble_cmd_hardware_io_port_config_function_id=4, | |
| ble_cmd_hardware_io_port_config_pull_id=5, | |
| ble_cmd_hardware_io_port_write_id=6, | |
| ble_cmd_hardware_io_port_read_id=7, | |
| ble_cmd_hardware_spi_config_id=8, | |
| ble_cmd_hardware_spi_transfer_id=9, | |
| ble_cmd_hardware_i2c_read_id=10, | |
| ble_cmd_hardware_i2c_write_id=11, | |
| ble_cmd_hardware_set_txpower_id=12, | |
| ble_cmd_hardware_timer_comparator_id=13, | |
| ble_cmd_test_phy_tx_id=0, | |
| ble_cmd_test_phy_rx_id=1, | |
| ble_cmd_test_phy_end_id=2, | |
| ble_cmd_test_phy_reset_id=3, | |
| ble_cmd_test_get_channel_map_id=4, | |
| ble_cmd_test_debug_id=5, | |
| ble_cmd_dfu_reset_id=0, | |
| ble_cmd_dfu_flash_set_address_id=1, | |
| ble_cmd_dfu_flash_upload_id=2, | |
| ble_cmd_dfu_flash_upload_finish_id=3, | |
| }; | |
| enum ble_response_ids | |
| { | |
| ble_rsp_system_reset_id=0, | |
| ble_rsp_system_hello_id=1, | |
| ble_rsp_system_address_get_id=2, | |
| ble_rsp_system_reg_write_id=3, | |
| ble_rsp_system_reg_read_id=4, | |
| ble_rsp_system_get_counters_id=5, | |
| ble_rsp_system_get_connections_id=6, | |
| ble_rsp_system_read_memory_id=7, | |
| ble_rsp_system_get_info_id=8, | |
| ble_rsp_system_endpoint_tx_id=9, | |
| ble_rsp_system_whitelist_append_id=10, | |
| ble_rsp_system_whitelist_remove_id=11, | |
| ble_rsp_system_whitelist_clear_id=12, | |
| ble_rsp_system_endpoint_rx_id=13, | |
| ble_rsp_system_endpoint_set_watermarks_id=14, | |
| ble_rsp_flash_ps_defrag_id=0, | |
| ble_rsp_flash_ps_dump_id=1, | |
| ble_rsp_flash_ps_erase_all_id=2, | |
| ble_rsp_flash_ps_save_id=3, | |
| ble_rsp_flash_ps_load_id=4, | |
| ble_rsp_flash_ps_erase_id=5, | |
| ble_rsp_flash_erase_page_id=6, | |
| ble_rsp_flash_write_words_id=7, | |
| ble_rsp_attributes_write_id=0, | |
| ble_rsp_attributes_read_id=1, | |
| ble_rsp_attributes_read_type_id=2, | |
| ble_rsp_attributes_user_read_response_id=3, | |
| ble_rsp_attributes_user_write_response_id=4, | |
| ble_rsp_connection_disconnect_id=0, | |
| ble_rsp_connection_get_rssi_id=1, | |
| ble_rsp_connection_update_id=2, | |
| ble_rsp_connection_version_update_id=3, | |
| ble_rsp_connection_channel_map_get_id=4, | |
| ble_rsp_connection_channel_map_set_id=5, | |
| ble_rsp_connection_features_get_id=6, | |
| ble_rsp_connection_get_status_id=7, | |
| ble_rsp_connection_raw_tx_id=8, | |
| ble_rsp_attclient_find_by_type_value_id=0, | |
| ble_rsp_attclient_read_by_group_type_id=1, | |
| ble_rsp_attclient_read_by_type_id=2, | |
| ble_rsp_attclient_find_information_id=3, | |
| ble_rsp_attclient_read_by_handle_id=4, | |
| ble_rsp_attclient_attribute_write_id=5, | |
| ble_rsp_attclient_write_command_id=6, | |
| ble_rsp_attclient_indicate_confirm_id=7, | |
| ble_rsp_attclient_read_long_id=8, | |
| ble_rsp_attclient_prepare_write_id=9, | |
| ble_rsp_attclient_execute_write_id=10, | |
| ble_rsp_attclient_read_multiple_id=11, | |
| ble_rsp_sm_encrypt_start_id=0, | |
| ble_rsp_sm_set_bondable_mode_id=1, | |
| ble_rsp_sm_delete_bonding_id=2, | |
| ble_rsp_sm_set_parameters_id=3, | |
| ble_rsp_sm_passkey_entry_id=4, | |
| ble_rsp_sm_get_bonds_id=5, | |
| ble_rsp_sm_set_oob_data_id=6, | |
| ble_rsp_gap_set_privacy_flags_id=0, | |
| ble_rsp_gap_set_mode_id=1, | |
| ble_rsp_gap_discover_id=2, | |
| ble_rsp_gap_connect_direct_id=3, | |
| ble_rsp_gap_end_procedure_id=4, | |
| ble_rsp_gap_connect_selective_id=5, | |
| ble_rsp_gap_set_filtering_id=6, | |
| ble_rsp_gap_set_scan_parameters_id=7, | |
| ble_rsp_gap_set_adv_parameters_id=8, | |
| ble_rsp_gap_set_adv_data_id=9, | |
| ble_rsp_gap_set_directed_connectable_mode_id=10, | |
| ble_rsp_hardware_io_port_config_irq_id=0, | |
| ble_rsp_hardware_set_soft_timer_id=1, | |
| ble_rsp_hardware_adc_read_id=2, | |
| ble_rsp_hardware_io_port_config_direction_id=3, | |
| ble_rsp_hardware_io_port_config_function_id=4, | |
| ble_rsp_hardware_io_port_config_pull_id=5, | |
| ble_rsp_hardware_io_port_write_id=6, | |
| ble_rsp_hardware_io_port_read_id=7, | |
| ble_rsp_hardware_spi_config_id=8, | |
| ble_rsp_hardware_spi_transfer_id=9, | |
| ble_rsp_hardware_i2c_read_id=10, | |
| ble_rsp_hardware_i2c_write_id=11, | |
| ble_rsp_hardware_set_txpower_id=12, | |
| ble_rsp_hardware_timer_comparator_id=13, | |
| ble_rsp_test_phy_tx_id=0, | |
| ble_rsp_test_phy_rx_id=1, | |
| ble_rsp_test_phy_end_id=2, | |
| ble_rsp_test_phy_reset_id=3, | |
| ble_rsp_test_get_channel_map_id=4, | |
| ble_rsp_test_debug_id=5, | |
| ble_rsp_dfu_reset_id=0, | |
| ble_rsp_dfu_flash_set_address_id=1, | |
| ble_rsp_dfu_flash_upload_id=2, | |
| ble_rsp_dfu_flash_upload_finish_id=3, | |
| }; | |
| enum ble_event_ids | |
| { | |
| ble_evt_system_boot_id=0, | |
| ble_evt_system_debug_id=1, | |
| ble_evt_system_endpoint_watermark_rx_id=2, | |
| ble_evt_system_endpoint_watermark_tx_id=3, | |
| ble_evt_system_script_failure_id=4, | |
| ble_evt_system_no_license_key_id=5, | |
| ble_evt_flash_ps_key_id=0, | |
| ble_evt_attributes_value_id=0, | |
| ble_evt_attributes_user_read_request_id=1, | |
| ble_evt_attributes_status_id=2, | |
| ble_evt_connection_status_id=0, | |
| ble_evt_connection_version_ind_id=1, | |
| ble_evt_connection_feature_ind_id=2, | |
| ble_evt_connection_raw_rx_id=3, | |
| ble_evt_connection_disconnected_id=4, | |
| ble_evt_attclient_indicated_id=0, | |
| ble_evt_attclient_procedure_completed_id=1, | |
| ble_evt_attclient_group_found_id=2, | |
| ble_evt_attclient_attribute_found_id=3, | |
| ble_evt_attclient_find_information_found_id=4, | |
| ble_evt_attclient_attribute_value_id=5, | |
| ble_evt_attclient_read_multiple_response_id=6, | |
| ble_evt_sm_smp_data_id=0, | |
| ble_evt_sm_bonding_fail_id=1, | |
| ble_evt_sm_passkey_display_id=2, | |
| ble_evt_sm_passkey_request_id=3, | |
| ble_evt_sm_bond_status_id=4, | |
| ble_evt_gap_scan_response_id=0, | |
| ble_evt_gap_mode_changed_id=1, | |
| ble_evt_hardware_io_port_status_id=0, | |
| ble_evt_hardware_soft_timer_id=1, | |
| ble_evt_hardware_adc_result_id=2, | |
| ble_evt_dfu_boot_id=0, | |
| }; | |
| enum ble_msg_idx | |
| { | |
| ble_cmd_system_reset_idx =0, | |
| ble_cmd_system_hello_idx =1, | |
| ble_cmd_system_address_get_idx =2, | |
| ble_cmd_system_reg_write_idx =3, | |
| ble_cmd_system_reg_read_idx =4, | |
| ble_cmd_system_get_counters_idx =5, | |
| ble_cmd_system_get_connections_idx =6, | |
| ble_cmd_system_read_memory_idx =7, | |
| ble_cmd_system_get_info_idx =8, | |
| ble_cmd_system_endpoint_tx_idx =9, | |
| ble_cmd_system_whitelist_append_idx =10, | |
| ble_cmd_system_whitelist_remove_idx =11, | |
| ble_cmd_system_whitelist_clear_idx =12, | |
| ble_cmd_system_endpoint_rx_idx =13, | |
| ble_cmd_system_endpoint_set_watermarks_idx =14, | |
| ble_cmd_flash_ps_defrag_idx =15, | |
| ble_cmd_flash_ps_dump_idx =16, | |
| ble_cmd_flash_ps_erase_all_idx =17, | |
| ble_cmd_flash_ps_save_idx =18, | |
| ble_cmd_flash_ps_load_idx =19, | |
| ble_cmd_flash_ps_erase_idx =20, | |
| ble_cmd_flash_erase_page_idx =21, | |
| ble_cmd_flash_write_words_idx =22, | |
| ble_cmd_attributes_write_idx =23, | |
| ble_cmd_attributes_read_idx =24, | |
| ble_cmd_attributes_read_type_idx =25, | |
| ble_cmd_attributes_user_read_response_idx =26, | |
| ble_cmd_attributes_user_write_response_idx =27, | |
| ble_cmd_connection_disconnect_idx =28, | |
| ble_cmd_connection_get_rssi_idx =29, | |
| ble_cmd_connection_update_idx =30, | |
| ble_cmd_connection_version_update_idx =31, | |
| ble_cmd_connection_channel_map_get_idx =32, | |
| ble_cmd_connection_channel_map_set_idx =33, | |
| ble_cmd_connection_features_get_idx =34, | |
| ble_cmd_connection_get_status_idx =35, | |
| ble_cmd_connection_raw_tx_idx =36, | |
| ble_cmd_attclient_find_by_type_value_idx =37, | |
| ble_cmd_attclient_read_by_group_type_idx =38, | |
| ble_cmd_attclient_read_by_type_idx =39, | |
| ble_cmd_attclient_find_information_idx =40, | |
| ble_cmd_attclient_read_by_handle_idx =41, | |
| ble_cmd_attclient_attribute_write_idx =42, | |
| ble_cmd_attclient_write_command_idx =43, | |
| ble_cmd_attclient_indicate_confirm_idx =44, | |
| ble_cmd_attclient_read_long_idx =45, | |
| ble_cmd_attclient_prepare_write_idx =46, | |
| ble_cmd_attclient_execute_write_idx =47, | |
| ble_cmd_attclient_read_multiple_idx =48, | |
| ble_cmd_sm_encrypt_start_idx =49, | |
| ble_cmd_sm_set_bondable_mode_idx =50, | |
| ble_cmd_sm_delete_bonding_idx =51, | |
| ble_cmd_sm_set_parameters_idx =52, | |
| ble_cmd_sm_passkey_entry_idx =53, | |
| ble_cmd_sm_get_bonds_idx =54, | |
| ble_cmd_sm_set_oob_data_idx =55, | |
| ble_cmd_gap_set_privacy_flags_idx =56, | |
| ble_cmd_gap_set_mode_idx =57, | |
| ble_cmd_gap_discover_idx =58, | |
| ble_cmd_gap_connect_direct_idx =59, | |
| ble_cmd_gap_end_procedure_idx =60, | |
| ble_cmd_gap_connect_selective_idx =61, | |
| ble_cmd_gap_set_filtering_idx =62, | |
| ble_cmd_gap_set_scan_parameters_idx =63, | |
| ble_cmd_gap_set_adv_parameters_idx =64, | |
| ble_cmd_gap_set_adv_data_idx =65, | |
| ble_cmd_gap_set_directed_connectable_mode_idx =66, | |
| ble_cmd_hardware_io_port_config_irq_idx =67, | |
| ble_cmd_hardware_set_soft_timer_idx =68, | |
| ble_cmd_hardware_adc_read_idx =69, | |
| ble_cmd_hardware_io_port_config_direction_idx =70, | |
| ble_cmd_hardware_io_port_config_function_idx =71, | |
| ble_cmd_hardware_io_port_config_pull_idx =72, | |
| ble_cmd_hardware_io_port_write_idx =73, | |
| ble_cmd_hardware_io_port_read_idx =74, | |
| ble_cmd_hardware_spi_config_idx =75, | |
| ble_cmd_hardware_spi_transfer_idx =76, | |
| ble_cmd_hardware_i2c_read_idx =77, | |
| ble_cmd_hardware_i2c_write_idx =78, | |
| ble_cmd_hardware_set_txpower_idx =79, | |
| ble_cmd_hardware_timer_comparator_idx =80, | |
| ble_cmd_test_phy_tx_idx =81, | |
| ble_cmd_test_phy_rx_idx =82, | |
| ble_cmd_test_phy_end_idx =83, | |
| ble_cmd_test_phy_reset_idx =84, | |
| ble_cmd_test_get_channel_map_idx =85, | |
| ble_cmd_test_debug_idx =86, | |
| ble_cmd_dfu_reset_idx =87, | |
| ble_cmd_dfu_flash_set_address_idx =88, | |
| ble_cmd_dfu_flash_upload_idx =89, | |
| ble_cmd_dfu_flash_upload_finish_idx =90, | |
| ble_rsp_system_reset_idx =91, | |
| ble_rsp_system_hello_idx =92, | |
| ble_rsp_system_address_get_idx =93, | |
| ble_rsp_system_reg_write_idx =94, | |
| ble_rsp_system_reg_read_idx =95, | |
| ble_rsp_system_get_counters_idx =96, | |
| ble_rsp_system_get_connections_idx =97, | |
| ble_rsp_system_read_memory_idx =98, | |
| ble_rsp_system_get_info_idx =99, | |
| ble_rsp_system_endpoint_tx_idx =100, | |
| ble_rsp_system_whitelist_append_idx =101, | |
| ble_rsp_system_whitelist_remove_idx =102, | |
| ble_rsp_system_whitelist_clear_idx =103, | |
| ble_rsp_system_endpoint_rx_idx =104, | |
| ble_rsp_system_endpoint_set_watermarks_idx =105, | |
| ble_rsp_flash_ps_defrag_idx =106, | |
| ble_rsp_flash_ps_dump_idx =107, | |
| ble_rsp_flash_ps_erase_all_idx =108, | |
| ble_rsp_flash_ps_save_idx =109, | |
| ble_rsp_flash_ps_load_idx =110, | |
| ble_rsp_flash_ps_erase_idx =111, | |
| ble_rsp_flash_erase_page_idx =112, | |
| ble_rsp_flash_write_words_idx =113, | |
| ble_rsp_attributes_write_idx =114, | |
| ble_rsp_attributes_read_idx =115, | |
| ble_rsp_attributes_read_type_idx =116, | |
| ble_rsp_attributes_user_read_response_idx =117, | |
| ble_rsp_attributes_user_write_response_idx =118, | |
| ble_rsp_connection_disconnect_idx =119, | |
| ble_rsp_connection_get_rssi_idx =120, | |
| ble_rsp_connection_update_idx =121, | |
| ble_rsp_connection_version_update_idx =122, | |
| ble_rsp_connection_channel_map_get_idx =123, | |
| ble_rsp_connection_channel_map_set_idx =124, | |
| ble_rsp_connection_features_get_idx =125, | |
| ble_rsp_connection_get_status_idx =126, | |
| ble_rsp_connection_raw_tx_idx =127, | |
| ble_rsp_attclient_find_by_type_value_idx =128, | |
| ble_rsp_attclient_read_by_group_type_idx =129, | |
| ble_rsp_attclient_read_by_type_idx =130, | |
| ble_rsp_attclient_find_information_idx =131, | |
| ble_rsp_attclient_read_by_handle_idx =132, | |
| ble_rsp_attclient_attribute_write_idx =133, | |
| ble_rsp_attclient_write_command_idx =134, | |
| ble_rsp_attclient_indicate_confirm_idx =135, | |
| ble_rsp_attclient_read_long_idx =136, | |
| ble_rsp_attclient_prepare_write_idx =137, | |
| ble_rsp_attclient_execute_write_idx =138, | |
| ble_rsp_attclient_read_multiple_idx =139, | |
| ble_rsp_sm_encrypt_start_idx =140, | |
| ble_rsp_sm_set_bondable_mode_idx =141, | |
| ble_rsp_sm_delete_bonding_idx =142, | |
| ble_rsp_sm_set_parameters_idx =143, | |
| ble_rsp_sm_passkey_entry_idx =144, | |
| ble_rsp_sm_get_bonds_idx =145, | |
| ble_rsp_sm_set_oob_data_idx =146, | |
| ble_rsp_gap_set_privacy_flags_idx =147, | |
| ble_rsp_gap_set_mode_idx =148, | |
| ble_rsp_gap_discover_idx =149, | |
| ble_rsp_gap_connect_direct_idx =150, | |
| ble_rsp_gap_end_procedure_idx =151, | |
| ble_rsp_gap_connect_selective_idx =152, | |
| ble_rsp_gap_set_filtering_idx =153, | |
| ble_rsp_gap_set_scan_parameters_idx =154, | |
| ble_rsp_gap_set_adv_parameters_idx =155, | |
| ble_rsp_gap_set_adv_data_idx =156, | |
| ble_rsp_gap_set_directed_connectable_mode_idx =157, | |
| ble_rsp_hardware_io_port_config_irq_idx =158, | |
| ble_rsp_hardware_set_soft_timer_idx =159, | |
| ble_rsp_hardware_adc_read_idx =160, | |
| ble_rsp_hardware_io_port_config_direction_idx =161, | |
| ble_rsp_hardware_io_port_config_function_idx =162, | |
| ble_rsp_hardware_io_port_config_pull_idx =163, | |
| ble_rsp_hardware_io_port_write_idx =164, | |
| ble_rsp_hardware_io_port_read_idx =165, | |
| ble_rsp_hardware_spi_config_idx =166, | |
| ble_rsp_hardware_spi_transfer_idx =167, | |
| ble_rsp_hardware_i2c_read_idx =168, | |
| ble_rsp_hardware_i2c_write_idx =169, | |
| ble_rsp_hardware_set_txpower_idx =170, | |
| ble_rsp_hardware_timer_comparator_idx =171, | |
| ble_rsp_test_phy_tx_idx =172, | |
| ble_rsp_test_phy_rx_idx =173, | |
| ble_rsp_test_phy_end_idx =174, | |
| ble_rsp_test_phy_reset_idx =175, | |
| ble_rsp_test_get_channel_map_idx =176, | |
| ble_rsp_test_debug_idx =177, | |
| ble_rsp_dfu_reset_idx =178, | |
| ble_rsp_dfu_flash_set_address_idx =179, | |
| ble_rsp_dfu_flash_upload_idx =180, | |
| ble_rsp_dfu_flash_upload_finish_idx =181, | |
| ble_evt_system_boot_idx =182, | |
| ble_evt_system_debug_idx =183, | |
| ble_evt_system_endpoint_watermark_rx_idx =184, | |
| ble_evt_system_endpoint_watermark_tx_idx =185, | |
| ble_evt_system_script_failure_idx =186, | |
| ble_evt_system_no_license_key_idx =187, | |
| ble_evt_flash_ps_key_idx =188, | |
| ble_evt_attributes_value_idx =189, | |
| ble_evt_attributes_user_read_request_idx =190, | |
| ble_evt_attributes_status_idx =191, | |
| ble_evt_connection_status_idx =192, | |
| ble_evt_connection_version_ind_idx =193, | |
| ble_evt_connection_feature_ind_idx =194, | |
| ble_evt_connection_raw_rx_idx =195, | |
| ble_evt_connection_disconnected_idx =196, | |
| ble_evt_attclient_indicated_idx =197, | |
| ble_evt_attclient_procedure_completed_idx =198, | |
| ble_evt_attclient_group_found_idx =199, | |
| ble_evt_attclient_attribute_found_idx =200, | |
| ble_evt_attclient_find_information_found_idx =201, | |
| ble_evt_attclient_attribute_value_idx =202, | |
| ble_evt_attclient_read_multiple_response_idx =203, | |
| ble_evt_sm_smp_data_idx =204, | |
| ble_evt_sm_bonding_fail_idx =205, | |
| ble_evt_sm_passkey_display_idx =206, | |
| ble_evt_sm_passkey_request_idx =207, | |
| ble_evt_sm_bond_status_idx =208, | |
| ble_evt_gap_scan_response_idx =209, | |
| ble_evt_gap_mode_changed_idx =210, | |
| ble_evt_hardware_io_port_status_idx =211, | |
| ble_evt_hardware_soft_timer_idx =212, | |
| ble_evt_hardware_adc_result_idx =213, | |
| ble_evt_dfu_boot_idx =214, | |
| }; | |
| enum ble_error_spaces | |
| { | |
| ble_err_bt=512, | |
| ble_err_att=1024, | |
| ble_err_bg=256, | |
| ble_err_smp=768, | |
| }; | |
| enum ble_error | |
| { | |
| ble_err_bt_error_success =ble_err_bt+0, //Command completed succesfully | |
| ble_err_bt_bt_error_authentication_failure =ble_err_bt+5, //Pairing or authentication failed due to incorrect results in the pairing or authentication procedure. This could be due to an incorrect PIN or Link Key | |
| ble_err_bt_pin_or_key_missing =ble_err_bt+6, //Pairing failed because of missing PIN, or authentication failed because of missing Key | |
| ble_err_bt_bt_error_memory_capacity_exceeded =ble_err_bt+7, //Controller is out of memory. | |
| ble_err_bt_connection_timeout =ble_err_bt+8, //Link supervision timeout has expired. | |
| ble_err_bt_connection_limit_exceeded =ble_err_bt+9, //Controller is at limit of connections it can support. | |
| ble_err_bt_bt_error_command_disallowed =ble_err_bt+12, //Command requested cannot be executed because the Controller is in a state where it cannot process this command at this time. | |
| ble_err_bt_bt_error_invalid_command_parameters =ble_err_bt+18, //Command contained invalid parameters. | |
| ble_err_bt_bt_error_remote_user_terminated =ble_err_bt+19, //User on the remote device terminated the connection. | |
| ble_err_bt_bt_error_connection_terminated_by_local_host =ble_err_bt+22, //Local device terminated the connection. | |
| ble_err_bt_bt_error_ll_response_timeout =ble_err_bt+34, //Connection terminated due to link-layer procedure timeout. | |
| ble_err_bt_bt_error_ll_instant_passed =ble_err_bt+40, //Received link-layer control packet where instant was in the past. | |
| ble_err_bt_bt_error_controller_busy =ble_err_bt+58, //Operation was rejected because the controller is busy and unable to process the request. | |
| ble_err_bt_bt_error_directed_advertising_timeout =ble_err_bt+60, //Directed advertising completed without a connection being created. | |
| ble_err_bt_bt_error_connection_terminated_due_to_mic_failure=ble_err_bt+61, //Connection was terminated because the Message Integrity Check (MIC) failed on a received packet. | |
| ble_err_bt_bt_error_connection_failed_to_be_established =ble_err_bt+62, //LL initiated a connection but the connection has failed to be established. Controller did not receive any packets from remote end. | |
| ble_err_att_invalid_handle =ble_err_att+1, //The attribute handle given was not valid on this server | |
| ble_err_att_read_not_permitted =ble_err_att+2, //The attribute cannot be read | |
| ble_err_att_write_not_permitted =ble_err_att+3, //The attribute cannot be written | |
| ble_err_att_invalid_pdu =ble_err_att+4, //The attribute PDU was invalid | |
| ble_err_att_insufficient_authentication =ble_err_att+5, //The attribute requires authentication before it can be read or written. | |
| ble_err_att_request_not_supported =ble_err_att+6, //Attribute Server does not support the request received from the client. | |
| ble_err_att_invalid_offset =ble_err_att+7, //Offset specified was past the end of the attribute | |
| ble_err_att_insufficient_authorization =ble_err_att+8, //The attribute requires authorization before it can be read or written. | |
| ble_err_att_prepare_queue_full =ble_err_att+9, //Too many prepare writes have been queueud | |
| ble_err_att_att_not_found =ble_err_att+10, //No attribute found within the given attribute handle range. | |
| ble_err_att_att_not_long =ble_err_att+11, //The attribute cannot be read or written using the Read Blob Request | |
| ble_err_att_insufficient_enc_key_size =ble_err_att+12, //The Encryption Key Size used for encrypting this link is insufficient. | |
| ble_err_att_invalid_att_length =ble_err_att+13, //The attribute value length is invalid for the operation | |
| ble_err_att_unlikely_error =ble_err_att+14, //The attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested. | |
| ble_err_att_insufficient_encryption =ble_err_att+15, //The attribute requires encryption before it can be read or written. | |
| ble_err_att_unsupported_group_type =ble_err_att+16, //The attribute type is not a supported grouping attribute as defined by a higher layer specification. | |
| ble_err_att_insufficient_resources =ble_err_att+17, //Insufficient Resources to complete the request | |
| ble_err_att_application =ble_err_att+128,//Application error code defined by a higher layer specification. | |
| ble_err_success =0, //No error | |
| ble_err_invalid_param =ble_err_bg+128, //Command contained invalid parameter | |
| ble_err_wrong_state =ble_err_bg+129, //Device is in wrong state to receive command | |
| ble_err_out_of_memory =ble_err_bg+130, //Device has run out of memory | |
| ble_err_not_implemented =ble_err_bg+131, //Feature is not implemented | |
| ble_err_invalid_command =ble_err_bg+132, //Command was not recognized | |
| ble_err_timeout =ble_err_bg+133, //Command or Procedure failed due to timeout | |
| ble_err_not_connected =ble_err_bg+134, //Connection handle passed is to command is not a valid handle | |
| ble_err_flow =ble_err_bg+135, //Command would cause either underflow or overflow error | |
| ble_err_user_attribute =ble_err_bg+136, //User attribute was accessed through API which is not supported | |
| ble_err_invalid_license_key =ble_err_bg+137, //No valid license key found | |
| ble_err_smp_passkey_entry_failed =ble_err_smp+1, //The user input of passkey failed, for example, the user cancelled the operation | |
| ble_err_smp_oob_not_available =ble_err_smp+2, //Out of Band data is not available for authentication | |
| ble_err_smp_authentication_requirements =ble_err_smp+3, //The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices | |
| ble_err_smp_confirm_value_failed =ble_err_smp+4, //The confirm value does not match the calculated compare value | |
| ble_err_smp_pairing_not_supported =ble_err_smp+5, //Pairing is not supported by the device | |
| ble_err_smp_encryption_key_size =ble_err_smp+6, //The resultant encryption key size is insufficient for the security requirements of this device | |
| ble_err_smp_command_not_supported =ble_err_smp+7, //The SMP command received is not supported on this device | |
| ble_err_smp_unspecified_reason =ble_err_smp+8, //Pairing failed due to an unspecified reason | |
| ble_err_smp_repeated_attempts =ble_err_smp+9, //Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request | |
| ble_err_smp_invalid_parameters =ble_err_smp+10, //The Invalid Parameters error code indicates: the command length is invalid or a parameter is outside of the specified range. | |
| ble_err_last | |
| }; | |
| PACKSTRUCT(struct ble_msg_system_reset_cmd_t | |
| { | |
| uint8 boot_in_dfu; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_address_get_rsp_t | |
| { | |
| bd_addr address; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_reg_write_cmd_t | |
| { | |
| uint16 address; | |
| uint8 value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_reg_write_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_reg_read_cmd_t | |
| { | |
| uint16 address; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_reg_read_rsp_t | |
| { | |
| uint16 address; | |
| uint8 value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_get_counters_rsp_t | |
| { | |
| uint8 txok; | |
| uint8 txretry; | |
| uint8 rxok; | |
| uint8 rxfail; | |
| uint8 mbuf; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_get_connections_rsp_t | |
| { | |
| uint8 maxconn; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_read_memory_cmd_t | |
| { | |
| uint32 address; | |
| uint8 length; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_read_memory_rsp_t | |
| { | |
| uint32 address; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_get_info_rsp_t | |
| { | |
| uint16 major; | |
| uint16 minor; | |
| uint16 patch; | |
| uint16 build; | |
| uint16 ll_version; | |
| uint8 protocol_version; | |
| uint8 hw; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_tx_cmd_t | |
| { | |
| uint8 endpoint; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_tx_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_whitelist_append_cmd_t | |
| { | |
| bd_addr address; | |
| uint8 address_type; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_whitelist_append_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_whitelist_remove_cmd_t | |
| { | |
| bd_addr address; | |
| uint8 address_type; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_whitelist_remove_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_rx_cmd_t | |
| { | |
| uint8 endpoint; | |
| uint8 size; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_rx_rsp_t | |
| { | |
| uint16 result; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_set_watermarks_cmd_t | |
| { | |
| uint8 endpoint; | |
| uint8 rx; | |
| uint8 tx; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_set_watermarks_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_boot_evt_t | |
| { | |
| uint16 major; | |
| uint16 minor; | |
| uint16 patch; | |
| uint16 build; | |
| uint16 ll_version; | |
| uint8 protocol_version; | |
| uint8 hw; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_debug_evt_t | |
| { | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_watermark_rx_evt_t | |
| { | |
| uint8 endpoint; | |
| uint8 data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_endpoint_watermark_tx_evt_t | |
| { | |
| uint8 endpoint; | |
| uint8 data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_system_script_failure_evt_t | |
| { | |
| uint16 address; | |
| uint16 reason; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_save_cmd_t | |
| { | |
| uint16 key; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_save_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_load_cmd_t | |
| { | |
| uint16 key; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_load_rsp_t | |
| { | |
| uint16 result; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_erase_cmd_t | |
| { | |
| uint16 key; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_erase_page_cmd_t | |
| { | |
| uint8 page; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_erase_page_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_write_words_cmd_t | |
| { | |
| uint16 address; | |
| uint8array words; | |
| }); | |
| PACKSTRUCT(struct ble_msg_flash_ps_key_evt_t | |
| { | |
| uint16 key; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_write_cmd_t | |
| { | |
| uint16 handle; | |
| uint8 offset; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_write_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_read_cmd_t | |
| { | |
| uint16 handle; | |
| uint16 offset; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_read_rsp_t | |
| { | |
| uint16 handle; | |
| uint16 offset; | |
| uint16 result; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_read_type_cmd_t | |
| { | |
| uint16 handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_read_type_rsp_t | |
| { | |
| uint16 handle; | |
| uint16 result; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_user_read_response_cmd_t | |
| { | |
| uint8 connection; | |
| uint8 att_error; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_user_write_response_cmd_t | |
| { | |
| uint8 connection; | |
| uint8 att_error; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_value_evt_t | |
| { | |
| uint8 connection; | |
| uint8 reason; | |
| uint16 handle; | |
| uint16 offset; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_user_read_request_evt_t | |
| { | |
| uint8 connection; | |
| uint16 handle; | |
| uint16 offset; | |
| uint8 maxsize; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attributes_status_evt_t | |
| { | |
| uint16 handle; | |
| uint8 flags; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_disconnect_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_disconnect_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_get_rssi_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_get_rssi_rsp_t | |
| { | |
| uint8 connection; | |
| int8 rssi; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_update_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 interval_min; | |
| uint16 interval_max; | |
| uint16 latency; | |
| uint16 timeout; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_update_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_version_update_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_version_update_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_channel_map_get_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_channel_map_get_rsp_t | |
| { | |
| uint8 connection; | |
| uint8array map; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_channel_map_set_cmd_t | |
| { | |
| uint8 connection; | |
| uint8array map; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_channel_map_set_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_features_get_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_features_get_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_get_status_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_get_status_rsp_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_raw_tx_cmd_t | |
| { | |
| uint8 connection; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_raw_tx_rsp_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_status_evt_t | |
| { | |
| uint8 connection; | |
| uint8 flags; | |
| bd_addr address; | |
| uint8 address_type; | |
| uint16 conn_interval; | |
| uint16 timeout; | |
| uint16 latency; | |
| uint8 bonding; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_version_ind_evt_t | |
| { | |
| uint8 connection; | |
| uint8 vers_nr; | |
| uint16 comp_id; | |
| uint16 sub_vers_nr; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_feature_ind_evt_t | |
| { | |
| uint8 connection; | |
| uint8array features; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_raw_rx_evt_t | |
| { | |
| uint8 connection; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_connection_disconnected_evt_t | |
| { | |
| uint8 connection; | |
| uint16 reason; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_find_by_type_value_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 start; | |
| uint16 end; | |
| uint16 uuid; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_find_by_type_value_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_group_type_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 start; | |
| uint16 end; | |
| uint8array uuid; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_group_type_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_type_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 start; | |
| uint16 end; | |
| uint8array uuid; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_type_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_find_information_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 start; | |
| uint16 end; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_find_information_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_handle_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 chrhandle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_by_handle_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_attribute_write_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 atthandle; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_attribute_write_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_write_command_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 atthandle; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_write_command_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_indicate_confirm_cmd_t | |
| { | |
| uint8 connection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_indicate_confirm_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_long_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 chrhandle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_long_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_prepare_write_cmd_t | |
| { | |
| uint8 connection; | |
| uint16 atthandle; | |
| uint16 offset; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_prepare_write_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_execute_write_cmd_t | |
| { | |
| uint8 connection; | |
| uint8 commit; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_execute_write_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_multiple_cmd_t | |
| { | |
| uint8 connection; | |
| uint8array handles; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_multiple_rsp_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_indicated_evt_t | |
| { | |
| uint8 connection; | |
| uint16 attrhandle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_procedure_completed_evt_t | |
| { | |
| uint8 connection; | |
| uint16 result; | |
| uint16 chrhandle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_group_found_evt_t | |
| { | |
| uint8 connection; | |
| uint16 start; | |
| uint16 end; | |
| uint8array uuid; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_attribute_found_evt_t | |
| { | |
| uint8 connection; | |
| uint16 chrdecl; | |
| uint16 value; | |
| uint8 properties; | |
| uint8array uuid; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_find_information_found_evt_t | |
| { | |
| uint8 connection; | |
| uint16 chrhandle; | |
| uint8array uuid; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_attribute_value_evt_t | |
| { | |
| uint8 connection; | |
| uint16 atthandle; | |
| uint8 type; | |
| uint8array value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_attclient_read_multiple_response_evt_t | |
| { | |
| uint8 connection; | |
| uint8array handles; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_encrypt_start_cmd_t | |
| { | |
| uint8 handle; | |
| uint8 bonding; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_encrypt_start_rsp_t | |
| { | |
| uint8 handle; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_set_bondable_mode_cmd_t | |
| { | |
| uint8 bondable; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_delete_bonding_cmd_t | |
| { | |
| uint8 handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_delete_bonding_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_set_parameters_cmd_t | |
| { | |
| uint8 mitm; | |
| uint8 min_key_size; | |
| uint8 io_capabilities; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_passkey_entry_cmd_t | |
| { | |
| uint8 handle; | |
| uint32 passkey; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_passkey_entry_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_get_bonds_rsp_t | |
| { | |
| uint8 bonds; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_set_oob_data_cmd_t | |
| { | |
| uint8array oob; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_smp_data_evt_t | |
| { | |
| uint8 handle; | |
| uint8 packet; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_bonding_fail_evt_t | |
| { | |
| uint8 handle; | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_passkey_display_evt_t | |
| { | |
| uint8 handle; | |
| uint32 passkey; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_passkey_request_evt_t | |
| { | |
| uint8 handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_sm_bond_status_evt_t | |
| { | |
| uint8 bond; | |
| uint8 keysize; | |
| uint8 mitm; | |
| uint8 keys; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_privacy_flags_cmd_t | |
| { | |
| uint8 peripheral_privacy; | |
| uint8 central_privacy; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_mode_cmd_t | |
| { | |
| uint8 discover; | |
| uint8 connect; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_mode_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_discover_cmd_t | |
| { | |
| uint8 mode; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_discover_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_connect_direct_cmd_t | |
| { | |
| bd_addr address; | |
| uint8 addr_type; | |
| uint16 conn_interval_min; | |
| uint16 conn_interval_max; | |
| uint16 timeout; | |
| uint16 latency; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_connect_direct_rsp_t | |
| { | |
| uint16 result; | |
| uint8 connection_handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_end_procedure_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_connect_selective_cmd_t | |
| { | |
| uint16 conn_interval_min; | |
| uint16 conn_interval_max; | |
| uint16 timeout; | |
| uint16 latency; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_connect_selective_rsp_t | |
| { | |
| uint16 result; | |
| uint8 connection_handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_filtering_cmd_t | |
| { | |
| uint8 scan_policy; | |
| uint8 adv_policy; | |
| uint8 scan_duplicate_filtering; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_filtering_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_scan_parameters_cmd_t | |
| { | |
| uint16 scan_interval; | |
| uint16 scan_window; | |
| uint8 active; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_scan_parameters_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_adv_parameters_cmd_t | |
| { | |
| uint16 adv_interval_min; | |
| uint16 adv_interval_max; | |
| uint8 adv_channels; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_adv_parameters_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_adv_data_cmd_t | |
| { | |
| uint8 set_scanrsp; | |
| uint8array adv_data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_adv_data_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_directed_connectable_mode_cmd_t | |
| { | |
| bd_addr address; | |
| uint8 addr_type; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_set_directed_connectable_mode_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_scan_response_evt_t | |
| { | |
| int8 rssi; | |
| uint8 packet_type; | |
| bd_addr sender; | |
| uint8 address_type; | |
| uint8 bond; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_gap_mode_changed_evt_t | |
| { | |
| uint8 discover; | |
| uint8 connect; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_irq_cmd_t | |
| { | |
| uint8 port; | |
| uint8 enable_bits; | |
| uint8 falling_edge; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_irq_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_set_soft_timer_cmd_t | |
| { | |
| uint32 time; | |
| uint8 handle; | |
| uint8 single_shot; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_set_soft_timer_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_adc_read_cmd_t | |
| { | |
| uint8 input; | |
| uint8 decimation; | |
| uint8 reference_selection; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_adc_read_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_direction_cmd_t | |
| { | |
| uint8 port; | |
| uint8 direction; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_direction_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_function_cmd_t | |
| { | |
| uint8 port; | |
| uint8 function; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_function_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_pull_cmd_t | |
| { | |
| uint8 port; | |
| uint8 tristate_mask; | |
| uint8 pull_up; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_config_pull_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_write_cmd_t | |
| { | |
| uint8 port; | |
| uint8 mask; | |
| uint8 data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_write_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_read_cmd_t | |
| { | |
| uint8 port; | |
| uint8 mask; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_read_rsp_t | |
| { | |
| uint16 result; | |
| uint8 port; | |
| uint8 data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_spi_config_cmd_t | |
| { | |
| uint8 channel; | |
| uint8 polarity; | |
| uint8 phase; | |
| uint8 bit_order; | |
| uint8 baud_e; | |
| uint8 baud_m; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_spi_config_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_spi_transfer_cmd_t | |
| { | |
| uint8 channel; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_spi_transfer_rsp_t | |
| { | |
| uint16 result; | |
| uint8 channel; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_i2c_read_cmd_t | |
| { | |
| uint8 address; | |
| uint8 stop; | |
| uint8 length; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_i2c_read_rsp_t | |
| { | |
| uint16 result; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_i2c_write_cmd_t | |
| { | |
| uint8 address; | |
| uint8 stop; | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_i2c_write_rsp_t | |
| { | |
| uint8 written; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_set_txpower_cmd_t | |
| { | |
| uint8 power; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_timer_comparator_cmd_t | |
| { | |
| uint8 timer; | |
| uint8 channel; | |
| uint8 mode; | |
| uint16 comparator_value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_timer_comparator_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_io_port_status_evt_t | |
| { | |
| uint32 timestamp; | |
| uint8 port; | |
| uint8 irq; | |
| uint8 state; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_soft_timer_evt_t | |
| { | |
| uint8 handle; | |
| }); | |
| PACKSTRUCT(struct ble_msg_hardware_adc_result_evt_t | |
| { | |
| uint8 input; | |
| int16 value; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_phy_tx_cmd_t | |
| { | |
| uint8 channel; | |
| uint8 length; | |
| uint8 type; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_phy_rx_cmd_t | |
| { | |
| uint8 channel; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_phy_end_rsp_t | |
| { | |
| uint16 counter; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_get_channel_map_rsp_t | |
| { | |
| uint8array channel_map; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_debug_cmd_t | |
| { | |
| uint8array input; | |
| }); | |
| PACKSTRUCT(struct ble_msg_test_debug_rsp_t | |
| { | |
| uint8array output; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_reset_cmd_t | |
| { | |
| uint8 dfu; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_flash_set_address_cmd_t | |
| { | |
| uint32 address; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_flash_set_address_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_flash_upload_cmd_t | |
| { | |
| uint8array data; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_flash_upload_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_flash_upload_finish_rsp_t | |
| { | |
| uint16 result; | |
| }); | |
| PACKSTRUCT(struct ble_msg_dfu_boot_evt_t | |
| { | |
| uint32 version; | |
| }); | |
| PACKSTRUCT( | |
| struct ble_cmd_packet | |
| { | |
| struct ble_header header; | |
| union{ | |
| uint8 handle; | |
| uint8 payload; | |
| struct ble_msg_system_reset_cmd_t system_reset_cmd; | |
| struct ble_msg_system_reg_write_cmd_t system_reg_write_cmd; | |
| struct ble_msg_system_reg_read_cmd_t system_reg_read_cmd; | |
| struct ble_msg_system_read_memory_cmd_t system_read_memory_cmd; | |
| struct ble_msg_system_endpoint_tx_cmd_t system_endpoint_tx_cmd; | |
| struct ble_msg_system_whitelist_append_cmd_t system_whitelist_append_cmd; | |
| struct ble_msg_system_whitelist_remove_cmd_t system_whitelist_remove_cmd; | |
| struct ble_msg_system_endpoint_rx_cmd_t system_endpoint_rx_cmd; | |
| struct ble_msg_system_endpoint_set_watermarks_cmd_t system_endpoint_set_watermarks_cmd; | |
| struct ble_msg_system_boot_evt_t system_boot_evt; | |
| struct ble_msg_system_debug_evt_t system_debug_evt; | |
| struct ble_msg_system_endpoint_watermark_rx_evt_t system_endpoint_watermark_rx_evt; | |
| struct ble_msg_system_endpoint_watermark_tx_evt_t system_endpoint_watermark_tx_evt; | |
| struct ble_msg_system_script_failure_evt_t system_script_failure_evt; | |
| struct ble_msg_flash_ps_save_cmd_t flash_ps_save_cmd; | |
| struct ble_msg_flash_ps_load_cmd_t flash_ps_load_cmd; | |
| struct ble_msg_flash_ps_erase_cmd_t flash_ps_erase_cmd; | |
| struct ble_msg_flash_erase_page_cmd_t flash_erase_page_cmd; | |
| struct ble_msg_flash_write_words_cmd_t flash_write_words_cmd; | |
| struct ble_msg_flash_ps_key_evt_t flash_ps_key_evt; | |
| struct ble_msg_attributes_write_cmd_t attributes_write_cmd; | |
| struct ble_msg_attributes_read_cmd_t attributes_read_cmd; | |
| struct ble_msg_attributes_read_type_cmd_t attributes_read_type_cmd; | |
| struct ble_msg_attributes_user_read_response_cmd_t attributes_user_read_response_cmd; | |
| struct ble_msg_attributes_user_write_response_cmd_t attributes_user_write_response_cmd; | |
| struct ble_msg_attributes_value_evt_t attributes_value_evt; | |
| struct ble_msg_attributes_user_read_request_evt_t attributes_user_read_request_evt; | |
| struct ble_msg_attributes_status_evt_t attributes_status_evt; | |
| struct ble_msg_connection_disconnect_cmd_t connection_disconnect_cmd; | |
| struct ble_msg_connection_get_rssi_cmd_t connection_get_rssi_cmd; | |
| struct ble_msg_connection_update_cmd_t connection_update_cmd; | |
| struct ble_msg_connection_version_update_cmd_t connection_version_update_cmd; | |
| struct ble_msg_connection_channel_map_get_cmd_t connection_channel_map_get_cmd; | |
| struct ble_msg_connection_channel_map_set_cmd_t connection_channel_map_set_cmd; | |
| struct ble_msg_connection_features_get_cmd_t connection_features_get_cmd; | |
| struct ble_msg_connection_get_status_cmd_t connection_get_status_cmd; | |
| struct ble_msg_connection_raw_tx_cmd_t connection_raw_tx_cmd; | |
| struct ble_msg_connection_status_evt_t connection_status_evt; | |
| struct ble_msg_connection_version_ind_evt_t connection_version_ind_evt; | |
| struct ble_msg_connection_feature_ind_evt_t connection_feature_ind_evt; | |
| struct ble_msg_connection_raw_rx_evt_t connection_raw_rx_evt; | |
| struct ble_msg_connection_disconnected_evt_t connection_disconnected_evt; | |
| struct ble_msg_attclient_find_by_type_value_cmd_t attclient_find_by_type_value_cmd; | |
| struct ble_msg_attclient_read_by_group_type_cmd_t attclient_read_by_group_type_cmd; | |
| struct ble_msg_attclient_read_by_type_cmd_t attclient_read_by_type_cmd; | |
| struct ble_msg_attclient_find_information_cmd_t attclient_find_information_cmd; | |
| struct ble_msg_attclient_read_by_handle_cmd_t attclient_read_by_handle_cmd; | |
| struct ble_msg_attclient_attribute_write_cmd_t attclient_attribute_write_cmd; | |
| struct ble_msg_attclient_write_command_cmd_t attclient_write_command_cmd; | |
| struct ble_msg_attclient_indicate_confirm_cmd_t attclient_indicate_confirm_cmd; | |
| struct ble_msg_attclient_read_long_cmd_t attclient_read_long_cmd; | |
| struct ble_msg_attclient_prepare_write_cmd_t attclient_prepare_write_cmd; | |
| struct ble_msg_attclient_execute_write_cmd_t attclient_execute_write_cmd; | |
| struct ble_msg_attclient_read_multiple_cmd_t attclient_read_multiple_cmd; | |
| struct ble_msg_attclient_indicated_evt_t attclient_indicated_evt; | |
| struct ble_msg_attclient_procedure_completed_evt_t attclient_procedure_completed_evt; | |
| struct ble_msg_attclient_group_found_evt_t attclient_group_found_evt; | |
| struct ble_msg_attclient_attribute_found_evt_t attclient_attribute_found_evt; | |
| struct ble_msg_attclient_find_information_found_evt_t attclient_find_information_found_evt; | |
| struct ble_msg_attclient_attribute_value_evt_t attclient_attribute_value_evt; | |
| struct ble_msg_attclient_read_multiple_response_evt_t attclient_read_multiple_response_evt; | |
| struct ble_msg_sm_encrypt_start_cmd_t sm_encrypt_start_cmd; | |
| struct ble_msg_sm_set_bondable_mode_cmd_t sm_set_bondable_mode_cmd; | |
| struct ble_msg_sm_delete_bonding_cmd_t sm_delete_bonding_cmd; | |
| struct ble_msg_sm_set_parameters_cmd_t sm_set_parameters_cmd; | |
| struct ble_msg_sm_passkey_entry_cmd_t sm_passkey_entry_cmd; | |
| struct ble_msg_sm_set_oob_data_cmd_t sm_set_oob_data_cmd; | |
| struct ble_msg_sm_smp_data_evt_t sm_smp_data_evt; | |
| struct ble_msg_sm_bonding_fail_evt_t sm_bonding_fail_evt; | |
| struct ble_msg_sm_passkey_display_evt_t sm_passkey_display_evt; | |
| struct ble_msg_sm_passkey_request_evt_t sm_passkey_request_evt; | |
| struct ble_msg_sm_bond_status_evt_t sm_bond_status_evt; | |
| struct ble_msg_gap_set_privacy_flags_cmd_t gap_set_privacy_flags_cmd; | |
| struct ble_msg_gap_set_mode_cmd_t gap_set_mode_cmd; | |
| struct ble_msg_gap_discover_cmd_t gap_discover_cmd; | |
| struct ble_msg_gap_connect_direct_cmd_t gap_connect_direct_cmd; | |
| struct ble_msg_gap_connect_selective_cmd_t gap_connect_selective_cmd; | |
| struct ble_msg_gap_set_filtering_cmd_t gap_set_filtering_cmd; | |
| struct ble_msg_gap_set_scan_parameters_cmd_t gap_set_scan_parameters_cmd; | |
| struct ble_msg_gap_set_adv_parameters_cmd_t gap_set_adv_parameters_cmd; | |
| struct ble_msg_gap_set_adv_data_cmd_t gap_set_adv_data_cmd; | |
| struct ble_msg_gap_set_directed_connectable_mode_cmd_t gap_set_directed_connectable_mode_cmd; | |
| struct ble_msg_gap_scan_response_evt_t gap_scan_response_evt; | |
| struct ble_msg_gap_mode_changed_evt_t gap_mode_changed_evt; | |
| struct ble_msg_hardware_io_port_config_irq_cmd_t hardware_io_port_config_irq_cmd; | |
| struct ble_msg_hardware_set_soft_timer_cmd_t hardware_set_soft_timer_cmd; | |
| struct ble_msg_hardware_adc_read_cmd_t hardware_adc_read_cmd; | |
| struct ble_msg_hardware_io_port_config_direction_cmd_t hardware_io_port_config_direction_cmd; | |
| struct ble_msg_hardware_io_port_config_function_cmd_t hardware_io_port_config_function_cmd; | |
| struct ble_msg_hardware_io_port_config_pull_cmd_t hardware_io_port_config_pull_cmd; | |
| struct ble_msg_hardware_io_port_write_cmd_t hardware_io_port_write_cmd; | |
| struct ble_msg_hardware_io_port_read_cmd_t hardware_io_port_read_cmd; | |
| struct ble_msg_hardware_spi_config_cmd_t hardware_spi_config_cmd; | |
| struct ble_msg_hardware_spi_transfer_cmd_t hardware_spi_transfer_cmd; | |
| struct ble_msg_hardware_i2c_read_cmd_t hardware_i2c_read_cmd; | |
| struct ble_msg_hardware_i2c_write_cmd_t hardware_i2c_write_cmd; | |
| struct ble_msg_hardware_set_txpower_cmd_t hardware_set_txpower_cmd; | |
| struct ble_msg_hardware_timer_comparator_cmd_t hardware_timer_comparator_cmd; | |
| struct ble_msg_hardware_io_port_status_evt_t hardware_io_port_status_evt; | |
| struct ble_msg_hardware_soft_timer_evt_t hardware_soft_timer_evt; | |
| struct ble_msg_hardware_adc_result_evt_t hardware_adc_result_evt; | |
| struct ble_msg_test_phy_tx_cmd_t test_phy_tx_cmd; | |
| struct ble_msg_test_phy_rx_cmd_t test_phy_rx_cmd; | |
| struct ble_msg_test_debug_cmd_t test_debug_cmd; | |
| struct ble_msg_dfu_reset_cmd_t dfu_reset_cmd; | |
| struct ble_msg_dfu_flash_set_address_cmd_t dfu_flash_set_address_cmd; | |
| struct ble_msg_dfu_flash_upload_cmd_t dfu_flash_upload_cmd; | |
| struct ble_msg_dfu_boot_evt_t dfu_boot_evt; | |
| }); | |
| }ALIGNED; | |
| /**Reset device**/ | |
| #define ble_cmd_system_reset(boot_in_dfu) ble_send_message (ble_cmd_system_reset_idx,boot_in_dfu) | |
| /**Hello - command for testing**/ | |
| #define ble_cmd_system_hello() ble_send_message (ble_cmd_system_hello_idx) | |
| /**Get device bluetooth address**/ | |
| #define ble_cmd_system_address_get() ble_send_message (ble_cmd_system_address_get_idx) | |
| /**write register**/ | |
| #define ble_cmd_system_reg_write(address,value) ble_send_message (ble_cmd_system_reg_write_idx,address,value) | |
| /**read register**/ | |
| #define ble_cmd_system_reg_read(address) ble_send_message (ble_cmd_system_reg_read_idx,address) | |
| /**get and reset packet counters**/ | |
| #define ble_cmd_system_get_counters() ble_send_message (ble_cmd_system_get_counters_idx) | |
| /**Get status from all connections**/ | |
| #define ble_cmd_system_get_connections() ble_send_message (ble_cmd_system_get_connections_idx) | |
| /**Read Memory**/ | |
| #define ble_cmd_system_read_memory(address,length) ble_send_message (ble_cmd_system_read_memory_idx,address,length) | |
| /**Get Device info**/ | |
| #define ble_cmd_system_get_info() ble_send_message (ble_cmd_system_get_info_idx) | |
| /**Send data to endpoint, error is returned if endpoint does not have enough space**/ | |
| #define ble_cmd_system_endpoint_tx(endpoint,data_len,data_data) ble_send_message (ble_cmd_system_endpoint_tx_idx,endpoint,data_len,data_data) | |
| /**Add entry to whitelist**/ | |
| #define ble_cmd_system_whitelist_append(address,address_type) ble_send_message (ble_cmd_system_whitelist_append_idx,address,address_type) | |
| /**Remove entry from whitelist**/ | |
| #define ble_cmd_system_whitelist_remove(address,address_type) ble_send_message (ble_cmd_system_whitelist_remove_idx,address,address_type) | |
| /**Add entry to whitelist**/ | |
| #define ble_cmd_system_whitelist_clear() ble_send_message (ble_cmd_system_whitelist_clear_idx) | |
| /**Read data from endpoint, error is returned if endpoint does not have enough data.**/ | |
| #define ble_cmd_system_endpoint_rx(endpoint,size) ble_send_message (ble_cmd_system_endpoint_rx_idx,endpoint,size) | |
| /**Set watermarks on both input and output side**/ | |
| #define ble_cmd_system_endpoint_set_watermarks(endpoint,rx,tx) ble_send_message (ble_cmd_system_endpoint_set_watermarks_idx,endpoint,rx,tx) | |
| /**Defragment persistent store**/ | |
| #define ble_cmd_flash_ps_defrag() ble_send_message (ble_cmd_flash_ps_defrag_idx) | |
| /**Dump all ps keys**/ | |
| #define ble_cmd_flash_ps_dump() ble_send_message (ble_cmd_flash_ps_dump_idx) | |
| /**erase all ps keys**/ | |
| #define ble_cmd_flash_ps_erase_all() ble_send_message (ble_cmd_flash_ps_erase_all_idx) | |
| /**save ps key**/ | |
| #define ble_cmd_flash_ps_save(key,value_len,value_data) ble_send_message (ble_cmd_flash_ps_save_idx,key,value_len,value_data) | |
| /**load ps key**/ | |
| #define ble_cmd_flash_ps_load(key) ble_send_message (ble_cmd_flash_ps_load_idx,key) | |
| /**erase ps key**/ | |
| #define ble_cmd_flash_ps_erase(key) ble_send_message (ble_cmd_flash_ps_erase_idx,key) | |
| /**erase flash page**/ | |
| #define ble_cmd_flash_erase_page(page) ble_send_message (ble_cmd_flash_erase_page_idx,page) | |
| /**write words to flash | |
| word size is 32bits**/ | |
| #define ble_cmd_flash_write_words(address,words_len,words_data) ble_send_message (ble_cmd_flash_write_words_idx,address,words_len,words_data) | |
| /**Write to attribute database**/ | |
| #define ble_cmd_attributes_write(handle,offset,value_len,value_data) ble_send_message (ble_cmd_attributes_write_idx,handle,offset,value_len,value_data) | |
| /**Read from attribute database**/ | |
| #define ble_cmd_attributes_read(handle,offset) ble_send_message (ble_cmd_attributes_read_idx,handle,offset) | |
| /**Read attribute type from database**/ | |
| #define ble_cmd_attributes_read_type(handle) ble_send_message (ble_cmd_attributes_read_type_idx,handle) | |
| /**Respond to user attribute read request**/ | |
| #define ble_cmd_attributes_user_read_response(connection,att_error,value_len,value_data) ble_send_message (ble_cmd_attributes_user_read_response_idx,connection,att_error,value_len,value_data) | |
| /**Response to attribute_changed event where reason is user-attribute write.**/ | |
| #define ble_cmd_attributes_user_write_response(connection,att_error) ble_send_message (ble_cmd_attributes_user_write_response_idx,connection,att_error) | |
| /**Disconnect connection, starts a disconnection procedure on connection**/ | |
| #define ble_cmd_connection_disconnect(connection) ble_send_message (ble_cmd_connection_disconnect_idx,connection) | |
| /**Get Link RSSI**/ | |
| #define ble_cmd_connection_get_rssi(connection) ble_send_message (ble_cmd_connection_get_rssi_idx,connection) | |
| /**Update connection parameters**/ | |
| #define ble_cmd_connection_update(connection,interval_min,interval_max,latency,timeout) ble_send_message (ble_cmd_connection_update_idx,connection,interval_min,interval_max,latency,timeout) | |
| /**Request version exchange**/ | |
| #define ble_cmd_connection_version_update(connection) ble_send_message (ble_cmd_connection_version_update_idx,connection) | |
| /**Get Current channel map**/ | |
| #define ble_cmd_connection_channel_map_get(connection) ble_send_message (ble_cmd_connection_channel_map_get_idx,connection) | |
| /**Set Channel map**/ | |
| #define ble_cmd_connection_channel_map_set(connection,map_len,map_data) ble_send_message (ble_cmd_connection_channel_map_set_idx,connection,map_len,map_data) | |
| /**Remote feature request**/ | |
| #define ble_cmd_connection_features_get(connection) ble_send_message (ble_cmd_connection_features_get_idx,connection) | |
| /**Get Connection Status Parameters**/ | |
| #define ble_cmd_connection_get_status(connection) ble_send_message (ble_cmd_connection_get_status_idx,connection) | |
| /**Raw TX**/ | |
| #define ble_cmd_connection_raw_tx(connection,data_len,data_data) ble_send_message (ble_cmd_connection_raw_tx_idx,connection,data_len,data_data) | |
| /**Discover attributes by type and value**/ | |
| #define ble_cmd_attclient_find_by_type_value(connection,start,end,uuid,value_len,value_data) ble_send_message (ble_cmd_attclient_find_by_type_value_idx,connection,start,end,uuid,value_len,value_data) | |
| /**Discover attributes by type and value**/ | |
| #define ble_cmd_attclient_read_by_group_type(connection,start,end,uuid_len,uuid_data) ble_send_message (ble_cmd_attclient_read_by_group_type_idx,connection,start,end,uuid_len,uuid_data) | |
| /**Read all attributes where type matches**/ | |
| #define ble_cmd_attclient_read_by_type(connection,start,end,uuid_len,uuid_data) ble_send_message (ble_cmd_attclient_read_by_type_idx,connection,start,end,uuid_len,uuid_data) | |
| /**Discover Attribute handle and type mappings**/ | |
| #define ble_cmd_attclient_find_information(connection,start,end) ble_send_message (ble_cmd_attclient_find_information_idx,connection,start,end) | |
| /**Read Characteristic value using handle**/ | |
| #define ble_cmd_attclient_read_by_handle(connection,chrhandle) ble_send_message (ble_cmd_attclient_read_by_handle_idx,connection,chrhandle) | |
| /**write data to attribute**/ | |
| #define ble_cmd_attclient_attribute_write(connection,atthandle,data_len,data_data) ble_send_message (ble_cmd_attclient_attribute_write_idx,connection,atthandle,data_len,data_data) | |
| /**write data to attribute using ATT write command**/ | |
| #define ble_cmd_attclient_write_command(connection,atthandle,data_len,data_data) ble_send_message (ble_cmd_attclient_write_command_idx,connection,atthandle,data_len,data_data) | |
| /**Send confirmation for received indication, use only if manual indications are enabled**/ | |
| #define ble_cmd_attclient_indicate_confirm(connection) ble_send_message (ble_cmd_attclient_indicate_confirm_idx,connection) | |
| /**Read Long Characteristic value**/ | |
| #define ble_cmd_attclient_read_long(connection,chrhandle) ble_send_message (ble_cmd_attclient_read_long_idx,connection,chrhandle) | |
| /**Send prepare write request to remote host**/ | |
| #define ble_cmd_attclient_prepare_write(connection,atthandle,offset,data_len,data_data) ble_send_message (ble_cmd_attclient_prepare_write_idx,connection,atthandle,offset,data_len,data_data) | |
| /**Send prepare write request to remote host**/ | |
| #define ble_cmd_attclient_execute_write(connection,commit) ble_send_message (ble_cmd_attclient_execute_write_idx,connection,commit) | |
| /**Read multiple attributes from server**/ | |
| #define ble_cmd_attclient_read_multiple(connection,handles_len,handles_data) ble_send_message (ble_cmd_attclient_read_multiple_idx,connection,handles_len,handles_data) | |
| /**Enable encryption on link**/ | |
| #define ble_cmd_sm_encrypt_start(handle,bonding) ble_send_message (ble_cmd_sm_encrypt_start_idx,handle,bonding) | |
| /**Set device to bondable mode**/ | |
| #define ble_cmd_sm_set_bondable_mode(bondable) ble_send_message (ble_cmd_sm_set_bondable_mode_idx,bondable) | |
| /**delete bonding information from ps store**/ | |
| #define ble_cmd_sm_delete_bonding(handle) ble_send_message (ble_cmd_sm_delete_bonding_idx,handle) | |
| /**set pairing requirements**/ | |
| #define ble_cmd_sm_set_parameters(mitm,min_key_size,io_capabilities) ble_send_message (ble_cmd_sm_set_parameters_idx,mitm,min_key_size,io_capabilities) | |
| /**Passkey entered**/ | |
| #define ble_cmd_sm_passkey_entry(handle,passkey) ble_send_message (ble_cmd_sm_passkey_entry_idx,handle,passkey) | |
| /**List all bonded devices**/ | |
| #define ble_cmd_sm_get_bonds() ble_send_message (ble_cmd_sm_get_bonds_idx) | |
| /** | |
| Set out-of-band encryption data for device | |
| Device does not allow any other kind of pairing except oob if oob data is set. | |
| **/ | |
| #define ble_cmd_sm_set_oob_data(oob_len,oob_data) ble_send_message (ble_cmd_sm_set_oob_data_idx,oob_len,oob_data) | |
| /**Set GAP central/peripheral privacy flags | |
| **/ | |
| #define ble_cmd_gap_set_privacy_flags(peripheral_privacy,central_privacy) ble_send_message (ble_cmd_gap_set_privacy_flags_idx,peripheral_privacy,central_privacy) | |
| /**Set discoverable and connectable mode**/ | |
| #define ble_cmd_gap_set_mode(discover,connect) ble_send_message (ble_cmd_gap_set_mode_idx,discover,connect) | |
| /**start or stop discover procedure**/ | |
| #define ble_cmd_gap_discover(mode) ble_send_message (ble_cmd_gap_discover_idx,mode) | |
| /**Direct connection**/ | |
| #define ble_cmd_gap_connect_direct(address,addr_type,conn_interval_min,conn_interval_max,timeout,latency) ble_send_message (ble_cmd_gap_connect_direct_idx,address,addr_type,conn_interval_min,conn_interval_max,timeout,latency) | |
| /**End current GAP procedure**/ | |
| #define ble_cmd_gap_end_procedure() ble_send_message (ble_cmd_gap_end_procedure_idx) | |
| /**Connect to any device on whitelist**/ | |
| #define ble_cmd_gap_connect_selective(conn_interval_min,conn_interval_max,timeout,latency) ble_send_message (ble_cmd_gap_connect_selective_idx,conn_interval_min,conn_interval_max,timeout,latency) | |
| /**Set scan and advertising filtering parameters**/ | |
| #define ble_cmd_gap_set_filtering(scan_policy,adv_policy,scan_duplicate_filtering) ble_send_message (ble_cmd_gap_set_filtering_idx,scan_policy,adv_policy,scan_duplicate_filtering) | |
| /**Set scan parameters**/ | |
| #define ble_cmd_gap_set_scan_parameters(scan_interval,scan_window,active) ble_send_message (ble_cmd_gap_set_scan_parameters_idx,scan_interval,scan_window,active) | |
| /**Set advertising parameters**/ | |
| #define ble_cmd_gap_set_adv_parameters(adv_interval_min,adv_interval_max,adv_channels) ble_send_message (ble_cmd_gap_set_adv_parameters_idx,adv_interval_min,adv_interval_max,adv_channels) | |
| /**Set advertisement or scan response data. Use broadcast mode to advertise data**/ | |
| #define ble_cmd_gap_set_adv_data(set_scanrsp,adv_data_len,adv_data_data) ble_send_message (ble_cmd_gap_set_adv_data_idx,set_scanrsp,adv_data_len,adv_data_data) | |
| /**Sets device to Directed Connectable Mode | |
| Uses fast advertisement procedure for 1.28s after which device enters nonconnectable mode. | |
| If device has valid reconnection characteristic value, it is used for connection | |
| otherwise passed address and address type are used | |
| **/ | |
| #define ble_cmd_gap_set_directed_connectable_mode(address,addr_type) ble_send_message (ble_cmd_gap_set_directed_connectable_mode_idx,address,addr_type) | |
| /**Configure I/O-port interrupts**/ | |
| #define ble_cmd_hardware_io_port_config_irq(port,enable_bits,falling_edge) ble_send_message (ble_cmd_hardware_io_port_config_irq_idx,port,enable_bits,falling_edge) | |
| /**Set soft timer to send events**/ | |
| #define ble_cmd_hardware_set_soft_timer(time,handle,single_shot) ble_send_message (ble_cmd_hardware_set_soft_timer_idx,time,handle,single_shot) | |
| /**Read A/D conversion**/ | |
| #define ble_cmd_hardware_adc_read(input,decimation,reference_selection) ble_send_message (ble_cmd_hardware_adc_read_idx,input,decimation,reference_selection) | |
| /**Configure I/O-port direction**/ | |
| #define ble_cmd_hardware_io_port_config_direction(port,direction) ble_send_message (ble_cmd_hardware_io_port_config_direction_idx,port,direction) | |
| /**Configure I/O-port function**/ | |
| #define ble_cmd_hardware_io_port_config_function(port,function) ble_send_message (ble_cmd_hardware_io_port_config_function_idx,port,function) | |
| /**Configure I/O-port pull-up/pull-down**/ | |
| #define ble_cmd_hardware_io_port_config_pull(port,tristate_mask,pull_up) ble_send_message (ble_cmd_hardware_io_port_config_pull_idx,port,tristate_mask,pull_up) | |
| /**Write I/O-port**/ | |
| #define ble_cmd_hardware_io_port_write(port,mask,data) ble_send_message (ble_cmd_hardware_io_port_write_idx,port,mask,data) | |
| /**Read I/O-port**/ | |
| #define ble_cmd_hardware_io_port_read(port,mask) ble_send_message (ble_cmd_hardware_io_port_read_idx,port,mask) | |
| /**Configure SPI**/ | |
| #define ble_cmd_hardware_spi_config(channel,polarity,phase,bit_order,baud_e,baud_m) ble_send_message (ble_cmd_hardware_spi_config_idx,channel,polarity,phase,bit_order,baud_e,baud_m) | |
| /**Transfer SPI data**/ | |
| #define ble_cmd_hardware_spi_transfer(channel,data_len,data_data) ble_send_message (ble_cmd_hardware_spi_transfer_idx,channel,data_len,data_data) | |
| /**Read data from I2C bus using bit-bang in cc2540. I2C clk is in P1.7 data in P1.6. Pull-up must be enabled on pins**/ | |
| #define ble_cmd_hardware_i2c_read(address,stop,length) ble_send_message (ble_cmd_hardware_i2c_read_idx,address,stop,length) | |
| /**Write data to I2C bus using bit-bang in cc2540. I2C clk is in P1.7 data in P1.6. Pull-up must be enabled on pins**/ | |
| #define ble_cmd_hardware_i2c_write(address,stop,data_len,data_data) ble_send_message (ble_cmd_hardware_i2c_write_idx,address,stop,data_len,data_data) | |
| /**Set TX Power**/ | |
| #define ble_cmd_hardware_set_txpower(power) ble_send_message (ble_cmd_hardware_set_txpower_idx,power) | |
| /**Set comparator for timer channel**/ | |
| #define ble_cmd_hardware_timer_comparator(timer,channel,mode,comparator_value) ble_send_message (ble_cmd_hardware_timer_comparator_idx,timer,channel,mode,comparator_value) | |
| /**Start packet transmission, send one packet at every 625us**/ | |
| #define ble_cmd_test_phy_tx(channel,length,type) ble_send_message (ble_cmd_test_phy_tx_idx,channel,length,type) | |
| /**Start receive test**/ | |
| #define ble_cmd_test_phy_rx(channel) ble_send_message (ble_cmd_test_phy_rx_idx,channel) | |
| /**End test, and report received packets**/ | |
| #define ble_cmd_test_phy_end() ble_send_message (ble_cmd_test_phy_end_idx) | |
| /**Reset test**/ | |
| #define ble_cmd_test_phy_reset() ble_send_message (ble_cmd_test_phy_reset_idx) | |
| /**Get current channel quality map**/ | |
| #define ble_cmd_test_get_channel_map() ble_send_message (ble_cmd_test_get_channel_map_idx) | |
| /**Debug command**/ | |
| #define ble_cmd_test_debug(input_len,input_data) ble_send_message (ble_cmd_test_debug_idx,input_len,input_data) | |
| /**Reset system**/ | |
| #define ble_cmd_dfu_reset(dfu) ble_send_message (ble_cmd_dfu_reset_idx,dfu) | |
| /**set address for flashing**/ | |
| #define ble_cmd_dfu_flash_set_address(address) ble_send_message (ble_cmd_dfu_flash_set_address_idx,address) | |
| /**Upload binary for flashing. Address will be updated automatically.**/ | |
| #define ble_cmd_dfu_flash_upload(data_len,data_data) ble_send_message (ble_cmd_dfu_flash_upload_idx,data_len,data_data) | |
| /**Uploading is finished.**/ | |
| #define ble_cmd_dfu_flash_upload_finish() ble_send_message (ble_cmd_dfu_flash_upload_finish_idx) | |
| /**Reset device**/ | |
| void ble_rsp_system_reset(const void *nul); | |
| /**Hello - command for testing**/ | |
| void ble_rsp_system_hello(const void *nul); | |
| /**Get device bluetooth address**/ | |
| void ble_rsp_system_address_get(const struct ble_msg_system_address_get_rsp_t *msg); | |
| /**write register**/ | |
| void ble_rsp_system_reg_write(const struct ble_msg_system_reg_write_rsp_t *msg); | |
| /**read register**/ | |
| void ble_rsp_system_reg_read(const struct ble_msg_system_reg_read_rsp_t *msg); | |
| /**get and reset packet counters**/ | |
| void ble_rsp_system_get_counters(const struct ble_msg_system_get_counters_rsp_t *msg); | |
| /**Get status from all connections**/ | |
| void ble_rsp_system_get_connections(const struct ble_msg_system_get_connections_rsp_t *msg); | |
| /**Read Memory**/ | |
| void ble_rsp_system_read_memory(const struct ble_msg_system_read_memory_rsp_t *msg); | |
| /**Get Device info**/ | |
| void ble_rsp_system_get_info(const struct ble_msg_system_get_info_rsp_t *msg); | |
| /**Send data to endpoint, error is returned if endpoint does not have enough space**/ | |
| void ble_rsp_system_endpoint_tx(const struct ble_msg_system_endpoint_tx_rsp_t *msg); | |
| /**Add entry to whitelist**/ | |
| void ble_rsp_system_whitelist_append(const struct ble_msg_system_whitelist_append_rsp_t *msg); | |
| /**Remove entry from whitelist**/ | |
| void ble_rsp_system_whitelist_remove(const struct ble_msg_system_whitelist_remove_rsp_t *msg); | |
| /**Add entry to whitelist**/ | |
| void ble_rsp_system_whitelist_clear(const void *nul); | |
| /**Read data from endpoint, error is returned if endpoint does not have enough data.**/ | |
| void ble_rsp_system_endpoint_rx(const struct ble_msg_system_endpoint_rx_rsp_t *msg); | |
| /**Set watermarks on both input and output side**/ | |
| void ble_rsp_system_endpoint_set_watermarks(const struct ble_msg_system_endpoint_set_watermarks_rsp_t *msg); | |
| /**Defragment persistent store**/ | |
| void ble_rsp_flash_ps_defrag(const void *nul); | |
| /**Dump all ps keys**/ | |
| void ble_rsp_flash_ps_dump(const void *nul); | |
| /**erase all ps keys**/ | |
| void ble_rsp_flash_ps_erase_all(const void *nul); | |
| /**save ps key**/ | |
| void ble_rsp_flash_ps_save(const struct ble_msg_flash_ps_save_rsp_t *msg); | |
| /**load ps key**/ | |
| void ble_rsp_flash_ps_load(const struct ble_msg_flash_ps_load_rsp_t *msg); | |
| /**erase ps key**/ | |
| void ble_rsp_flash_ps_erase(const void *nul); | |
| /**erase flash page**/ | |
| void ble_rsp_flash_erase_page(const struct ble_msg_flash_erase_page_rsp_t *msg); | |
| /**write words to flash | |
| word size is 32bits**/ | |
| void ble_rsp_flash_write_words(const void *nul); | |
| /**Write to attribute database**/ | |
| void ble_rsp_attributes_write(const struct ble_msg_attributes_write_rsp_t *msg); | |
| /**Read from attribute database**/ | |
| void ble_rsp_attributes_read(const struct ble_msg_attributes_read_rsp_t *msg); | |
| /**Read attribute type from database**/ | |
| void ble_rsp_attributes_read_type(const struct ble_msg_attributes_read_type_rsp_t *msg); | |
| /**Respond to user attribute read request**/ | |
| void ble_rsp_attributes_user_read_response(const void *nul); | |
| /**Response to attribute_changed event where reason is user-attribute write.**/ | |
| void ble_rsp_attributes_user_write_response(const void *nul); | |
| /**Disconnect connection, starts a disconnection procedure on connection**/ | |
| void ble_rsp_connection_disconnect(const struct ble_msg_connection_disconnect_rsp_t *msg); | |
| /**Get Link RSSI**/ | |
| void ble_rsp_connection_get_rssi(const struct ble_msg_connection_get_rssi_rsp_t *msg); | |
| /**Update connection parameters**/ | |
| void ble_rsp_connection_update(const struct ble_msg_connection_update_rsp_t *msg); | |
| /**Request version exchange**/ | |
| void ble_rsp_connection_version_update(const struct ble_msg_connection_version_update_rsp_t *msg); | |
| /**Get Current channel map**/ | |
| void ble_rsp_connection_channel_map_get(const struct ble_msg_connection_channel_map_get_rsp_t *msg); | |
| /**Set Channel map**/ | |
| void ble_rsp_connection_channel_map_set(const struct ble_msg_connection_channel_map_set_rsp_t *msg); | |
| /**Remote feature request**/ | |
| void ble_rsp_connection_features_get(const struct ble_msg_connection_features_get_rsp_t *msg); | |
| /**Get Connection Status Parameters**/ | |
| void ble_rsp_connection_get_status(const struct ble_msg_connection_get_status_rsp_t *msg); | |
| /**Raw TX**/ | |
| void ble_rsp_connection_raw_tx(const struct ble_msg_connection_raw_tx_rsp_t *msg); | |
| /**Discover attributes by type and value**/ | |
| void ble_rsp_attclient_find_by_type_value(const struct ble_msg_attclient_find_by_type_value_rsp_t *msg); | |
| /**Discover attributes by type and value**/ | |
| void ble_rsp_attclient_read_by_group_type(const struct ble_msg_attclient_read_by_group_type_rsp_t *msg); | |
| /**Read all attributes where type matches**/ | |
| void ble_rsp_attclient_read_by_type(const struct ble_msg_attclient_read_by_type_rsp_t *msg); | |
| /**Discover Attribute handle and type mappings**/ | |
| void ble_rsp_attclient_find_information(const struct ble_msg_attclient_find_information_rsp_t *msg); | |
| /**Read Characteristic value using handle**/ | |
| void ble_rsp_attclient_read_by_handle(const struct ble_msg_attclient_read_by_handle_rsp_t *msg); | |
| /**write data to attribute**/ | |
| void ble_rsp_attclient_attribute_write(const struct ble_msg_attclient_attribute_write_rsp_t *msg); | |
| /**write data to attribute using ATT write command**/ | |
| void ble_rsp_attclient_write_command(const struct ble_msg_attclient_write_command_rsp_t *msg); | |
| /**Send confirmation for received indication, use only if manual indications are enabled**/ | |
| void ble_rsp_attclient_indicate_confirm(const struct ble_msg_attclient_indicate_confirm_rsp_t *msg); | |
| /**Read Long Characteristic value**/ | |
| void ble_rsp_attclient_read_long(const struct ble_msg_attclient_read_long_rsp_t *msg); | |
| /**Send prepare write request to remote host**/ | |
| void ble_rsp_attclient_prepare_write(const struct ble_msg_attclient_prepare_write_rsp_t *msg); | |
| /**Send prepare write request to remote host**/ | |
| void ble_rsp_attclient_execute_write(const struct ble_msg_attclient_execute_write_rsp_t *msg); | |
| /**Read multiple attributes from server**/ | |
| void ble_rsp_attclient_read_multiple(const struct ble_msg_attclient_read_multiple_rsp_t *msg); | |
| /**Enable encryption on link**/ | |
| void ble_rsp_sm_encrypt_start(const struct ble_msg_sm_encrypt_start_rsp_t *msg); | |
| /**Set device to bondable mode**/ | |
| void ble_rsp_sm_set_bondable_mode(const void *nul); | |
| /**delete bonding information from ps store**/ | |
| void ble_rsp_sm_delete_bonding(const struct ble_msg_sm_delete_bonding_rsp_t *msg); | |
| /**set pairing requirements**/ | |
| void ble_rsp_sm_set_parameters(const void *nul); | |
| /**Passkey entered**/ | |
| void ble_rsp_sm_passkey_entry(const struct ble_msg_sm_passkey_entry_rsp_t *msg); | |
| /**List all bonded devices**/ | |
| void ble_rsp_sm_get_bonds(const struct ble_msg_sm_get_bonds_rsp_t *msg); | |
| /** | |
| Set out-of-band encryption data for device | |
| Device does not allow any other kind of pairing except oob if oob data is set. | |
| **/ | |
| void ble_rsp_sm_set_oob_data(const void *nul); | |
| /**Set GAP central/peripheral privacy flags | |
| **/ | |
| void ble_rsp_gap_set_privacy_flags(const void *nul); | |
| /**Set discoverable and connectable mode**/ | |
| void ble_rsp_gap_set_mode(const struct ble_msg_gap_set_mode_rsp_t *msg); | |
| /**start or stop discover procedure**/ | |
| void ble_rsp_gap_discover(const struct ble_msg_gap_discover_rsp_t *msg); | |
| /**Direct connection**/ | |
| void ble_rsp_gap_connect_direct(const struct ble_msg_gap_connect_direct_rsp_t *msg); | |
| /**End current GAP procedure**/ | |
| void ble_rsp_gap_end_procedure(const struct ble_msg_gap_end_procedure_rsp_t *msg); | |
| /**Connect to any device on whitelist**/ | |
| void ble_rsp_gap_connect_selective(const struct ble_msg_gap_connect_selective_rsp_t *msg); | |
| /**Set scan and advertising filtering parameters**/ | |
| void ble_rsp_gap_set_filtering(const struct ble_msg_gap_set_filtering_rsp_t *msg); | |
| /**Set scan parameters**/ | |
| void ble_rsp_gap_set_scan_parameters(const struct ble_msg_gap_set_scan_parameters_rsp_t *msg); | |
| /**Set advertising parameters**/ | |
| void ble_rsp_gap_set_adv_parameters(const struct ble_msg_gap_set_adv_parameters_rsp_t *msg); | |
| /**Set advertisement or scan response data. Use broadcast mode to advertise data**/ | |
| void ble_rsp_gap_set_adv_data(const struct ble_msg_gap_set_adv_data_rsp_t *msg); | |
| /**Sets device to Directed Connectable Mode | |
| Uses fast advertisement procedure for 1.28s after which device enters nonconnectable mode. | |
| If device has valid reconnection characteristic value, it is used for connection | |
| otherwise passed address and address type are used | |
| **/ | |
| void ble_rsp_gap_set_directed_connectable_mode(const struct ble_msg_gap_set_directed_connectable_mode_rsp_t *msg); | |
| /**Configure I/O-port interrupts**/ | |
| void ble_rsp_hardware_io_port_config_irq(const struct ble_msg_hardware_io_port_config_irq_rsp_t *msg); | |
| /**Set soft timer to send events**/ | |
| void ble_rsp_hardware_set_soft_timer(const struct ble_msg_hardware_set_soft_timer_rsp_t *msg); | |
| /**Read A/D conversion**/ | |
| void ble_rsp_hardware_adc_read(const struct ble_msg_hardware_adc_read_rsp_t *msg); | |
| /**Configure I/O-port direction**/ | |
| void ble_rsp_hardware_io_port_config_direction(const struct ble_msg_hardware_io_port_config_direction_rsp_t *msg); | |
| /**Configure I/O-port function**/ | |
| void ble_rsp_hardware_io_port_config_function(const struct ble_msg_hardware_io_port_config_function_rsp_t *msg); | |
| /**Configure I/O-port pull-up/pull-down**/ | |
| void ble_rsp_hardware_io_port_config_pull(const struct ble_msg_hardware_io_port_config_pull_rsp_t *msg); | |
| /**Write I/O-port**/ | |
| void ble_rsp_hardware_io_port_write(const struct ble_msg_hardware_io_port_write_rsp_t *msg); | |
| /**Read I/O-port**/ | |
| void ble_rsp_hardware_io_port_read(const struct ble_msg_hardware_io_port_read_rsp_t *msg); | |
| /**Configure SPI**/ | |
| void ble_rsp_hardware_spi_config(const struct ble_msg_hardware_spi_config_rsp_t *msg); | |
| /**Transfer SPI data**/ | |
| void ble_rsp_hardware_spi_transfer(const struct ble_msg_hardware_spi_transfer_rsp_t *msg); | |
| /**Read data from I2C bus using bit-bang in cc2540. I2C clk is in P1.7 data in P1.6. Pull-up must be enabled on pins**/ | |
| void ble_rsp_hardware_i2c_read(const struct ble_msg_hardware_i2c_read_rsp_t *msg); | |
| /**Write data to I2C bus using bit-bang in cc2540. I2C clk is in P1.7 data in P1.6. Pull-up must be enabled on pins**/ | |
| void ble_rsp_hardware_i2c_write(const struct ble_msg_hardware_i2c_write_rsp_t *msg); | |
| /**Set TX Power**/ | |
| void ble_rsp_hardware_set_txpower(const void *nul); | |
| /**Set comparator for timer channel**/ | |
| void ble_rsp_hardware_timer_comparator(const struct ble_msg_hardware_timer_comparator_rsp_t *msg); | |
| /**Start packet transmission, send one packet at every 625us**/ | |
| void ble_rsp_test_phy_tx(const void *nul); | |
| /**Start receive test**/ | |
| void ble_rsp_test_phy_rx(const void *nul); | |
| /**End test, and report received packets**/ | |
| void ble_rsp_test_phy_end(const struct ble_msg_test_phy_end_rsp_t *msg); | |
| /**Reset test**/ | |
| void ble_rsp_test_phy_reset(const void *nul); | |
| /**Get current channel quality map**/ | |
| void ble_rsp_test_get_channel_map(const struct ble_msg_test_get_channel_map_rsp_t *msg); | |
| /**Debug command**/ | |
| void ble_rsp_test_debug(const struct ble_msg_test_debug_rsp_t *msg); | |
| /**Reset system**/ | |
| void ble_rsp_dfu_reset(const void *nul); | |
| /**set address for flashing**/ | |
| void ble_rsp_dfu_flash_set_address(const struct ble_msg_dfu_flash_set_address_rsp_t *msg); | |
| /**Upload binary for flashing. Address will be updated automatically.**/ | |
| void ble_rsp_dfu_flash_upload(const struct ble_msg_dfu_flash_upload_rsp_t *msg); | |
| /**Uploading is finished.**/ | |
| void ble_rsp_dfu_flash_upload_finish(const struct ble_msg_dfu_flash_upload_finish_rsp_t *msg); | |
| /**Device booted up, and is ready to receive commands**/ | |
| void ble_evt_system_boot(const struct ble_msg_system_boot_evt_t *msg); | |
| /**Debug data output**/ | |
| void ble_evt_system_debug(const struct ble_msg_system_debug_evt_t *msg); | |
| /**Endpoint receive size crossed watermark**/ | |
| void ble_evt_system_endpoint_watermark_rx(const struct ble_msg_system_endpoint_watermark_rx_evt_t *msg); | |
| /**Endpoint transmit size crossed watermark**/ | |
| void ble_evt_system_endpoint_watermark_tx(const struct ble_msg_system_endpoint_watermark_tx_evt_t *msg); | |
| /**Script failure detected**/ | |
| void ble_evt_system_script_failure(const struct ble_msg_system_script_failure_evt_t *msg); | |
| /**No valid license key found**/ | |
| void ble_evt_system_no_license_key(const void *nul); | |
| /**Dump key result**/ | |
| void ble_evt_flash_ps_key(const struct ble_msg_flash_ps_key_evt_t *msg); | |
| /**Attribute value has changed**/ | |
| void ble_evt_attributes_value(const struct ble_msg_attributes_value_evt_t *msg); | |
| /**User-backed attribute data requested**/ | |
| void ble_evt_attributes_user_read_request(const struct ble_msg_attributes_user_read_request_evt_t *msg); | |
| /**attribute status flags has changed**/ | |
| void ble_evt_attributes_status(const struct ble_msg_attributes_status_evt_t *msg); | |
| /**Connection opened**/ | |
| void ble_evt_connection_status(const struct ble_msg_connection_status_evt_t *msg); | |
| /**Remote version information**/ | |
| void ble_evt_connection_version_ind(const struct ble_msg_connection_version_ind_evt_t *msg); | |
| /**Remote feature information**/ | |
| void ble_evt_connection_feature_ind(const struct ble_msg_connection_feature_ind_evt_t *msg); | |
| /**Raw RX**/ | |
| void ble_evt_connection_raw_rx(const struct ble_msg_connection_raw_rx_evt_t *msg); | |
| /**Link Disconnected**/ | |
| void ble_evt_connection_disconnected(const struct ble_msg_connection_disconnected_evt_t *msg); | |
| /**Attribute indication has been acknowledged**/ | |
| void ble_evt_attclient_indicated(const struct ble_msg_attclient_indicated_evt_t *msg); | |
| /**GATT procedure completed**/ | |
| void ble_evt_attclient_procedure_completed(const struct ble_msg_attclient_procedure_completed_evt_t *msg); | |
| /**group discovery return**/ | |
| void ble_evt_attclient_group_found(const struct ble_msg_attclient_group_found_evt_t *msg); | |
| /**characteristics found**/ | |
| void ble_evt_attclient_attribute_found(const struct ble_msg_attclient_attribute_found_evt_t *msg); | |
| /**Handle type mapping found**/ | |
| void ble_evt_attclient_find_information_found(const struct ble_msg_attclient_find_information_found_evt_t *msg); | |
| /**attribute value returned**/ | |
| void ble_evt_attclient_attribute_value(const struct ble_msg_attclient_attribute_value_evt_t *msg); | |
| /**Response to read multiple request**/ | |
| void ble_evt_attclient_read_multiple_response(const struct ble_msg_attclient_read_multiple_response_evt_t *msg); | |
| /**SMP data output**/ | |
| void ble_evt_sm_smp_data(const struct ble_msg_sm_smp_data_evt_t *msg); | |
| /**Link bonding has failed**/ | |
| void ble_evt_sm_bonding_fail(const struct ble_msg_sm_bonding_fail_evt_t *msg); | |
| /**Passkey to be entered to remote device**/ | |
| void ble_evt_sm_passkey_display(const struct ble_msg_sm_passkey_display_evt_t *msg); | |
| /**Passkey Requested**/ | |
| void ble_evt_sm_passkey_request(const struct ble_msg_sm_passkey_request_evt_t *msg); | |
| /**Bond status information**/ | |
| void ble_evt_sm_bond_status(const struct ble_msg_sm_bond_status_evt_t *msg); | |
| /**Scan Response**/ | |
| void ble_evt_gap_scan_response(const struct ble_msg_gap_scan_response_evt_t *msg); | |
| /**Not used**/ | |
| void ble_evt_gap_mode_changed(const struct ble_msg_gap_mode_changed_evt_t *msg); | |
| /**I/O-port state**/ | |
| void ble_evt_hardware_io_port_status(const struct ble_msg_hardware_io_port_status_evt_t *msg); | |
| /**soft timer event**/ | |
| void ble_evt_hardware_soft_timer(const struct ble_msg_hardware_soft_timer_evt_t *msg); | |
| /**adc result**/ | |
| void ble_evt_hardware_adc_result(const struct ble_msg_hardware_adc_result_evt_t *msg); | |
| /**Device booted up in dfu, and is ready to receive commands**/ | |
| void ble_evt_dfu_boot(const struct ble_msg_dfu_boot_evt_t *msg); | |
| struct ble_class_handler_t | |
| { | |
| const struct ble_msg **msgs; | |
| uint8 maxhandlers; | |
| }; | |
| extern struct ble_class_handler_t ble_class_rsp_handlers[ble_cls_last]; | |
| extern struct ble_class_handler_t ble_class_evt_handlers[ble_cls_last]; | |
| void ble_default(const void*); | |
| #ifdef __cplusplus | |
| } | |
| #endif | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Bluegiga’s Bluetooth Smart Demo Application | |
| // Contact: support@bluegiga.com. | |
| // | |
| // This is free software distributed under the terms of the MIT license reproduced below. | |
| // | |
| // Copyright (c) 2012, Bluegiga Technologies | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
| // software and associated documentation files (the "Software"), | |
| // to deal in the Software without restriction, including without limitation | |
| // the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| // and/or sell copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included | |
| // in all copies or substantial portions of the Software. | |
| // | |
| // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | |
| // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF | |
| // MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | |
| // | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include "cmd_def.h" | |
| static void _ble_debug_output(char * print) | |
| { | |
| printf(print); | |
| } | |
| void ble_default(const void*v) | |
| { | |
| _ble_debug_output("-ble_default\n"); | |
| } | |
| void ble_evt_system_no_license_key(const void*nul) | |
| { | |
| _ble_debug_output("-ble_evt_system_no_license_key\n"); | |
| } | |
| void ble_evt_attributes_status(const struct ble_msg_attributes_status_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attributes_status\n"); | |
| } | |
| void ble_rsp_attclient_indicate_confirm(const struct ble_msg_attclient_indicate_confirm_rsp_t*msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_indicate_confirm\n"); | |
| } | |
| void ble_rsp_test_debug(const struct ble_msg_test_debug_rsp_t*msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_set_txpower(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_attclient_read_multiple(const struct ble_msg_attclient_read_multiple_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_read_multiple\n"); | |
| } | |
| void ble_evt_attclient_read_multiple_response(const struct ble_msg_attclient_read_multiple_response_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attclient_read_multiple_response\n"); | |
| } | |
| void ble_rsp_attclient_prepare_write(const struct ble_msg_attclient_prepare_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_prepare_write\n"); | |
| } | |
| void ble_rsp_attclient_execute_write(const struct ble_msg_attclient_execute_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_execute_write\n"); | |
| } | |
| void ble_evt_attributes_user_read_request(const struct ble_msg_attributes_user_read_request_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attributes_user_read_request\n"); | |
| } | |
| void ble_rsp_attributes_user_read_response(const void * nul) | |
| { | |
| _ble_debug_output("-ble_rsp_attributes_user_read_response\n"); | |
| } | |
| void ble_rsp_attributes_user_write_response(const void * nul) | |
| { | |
| _ble_debug_output("-ble_rsp_attributes_user_write_response\n"); | |
| } | |
| void ble_rsp_system_whitelist_clear(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_attclient_write_command(const struct ble_msg_attclient_write_command_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_write_command\n"); | |
| } | |
| void ble_rsp_attclient_reserved(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_attclient_read_long(const struct ble_msg_attclient_read_long_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_read_long\n"); | |
| } | |
| void ble_rsp_system_whitelist_append(const struct ble_msg_system_whitelist_append_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_set_parameters(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_passkey_entry(const struct ble_msg_sm_passkey_entry_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_get_bonds(const struct ble_msg_sm_get_bonds_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_set_oob_data(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_set_security_mode(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_set_filtering(const struct ble_msg_gap_set_filtering_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_set_filtering\n"); | |
| } | |
| void ble_rsp_gap_set_adv_parameters(const struct ble_msg_gap_set_adv_parameters_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_io_port_write(const struct ble_msg_hardware_io_port_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_io_port_read(const struct ble_msg_hardware_io_port_read_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_timer_comparator(const struct ble_msg_hardware_timer_comparator_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_spi_config(const struct ble_msg_hardware_spi_config_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_spi_transfer(const struct ble_msg_hardware_spi_transfer_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_i2c_read(const struct ble_msg_hardware_i2c_read_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_i2c_write(const struct ble_msg_hardware_i2c_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_test_get_channel_map(const struct ble_msg_test_get_channel_map_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_attributes_value(const struct ble_msg_attributes_value_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attributes_value\n"); | |
| } | |
| void ble_evt_sm_bonding_fail(const struct ble_msg_sm_bonding_fail_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_sm_passkey_display(const struct ble_msg_sm_passkey_display_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_sm_passkey_request(const struct ble_msg_sm_passkey_request_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_sm_bond_status(const struct ble_msg_sm_bond_status_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_set_adv_data(const struct ble_msg_gap_set_adv_data_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_set_adv_data\n"); | |
| } | |
| void ble_rsp_gap_set_scan_parameters(const struct ble_msg_gap_set_scan_parameters_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_set_scan_parameters\n"); | |
| } | |
| void ble_rsp_gap_set_directed_connectable_mode(const struct ble_msg_gap_set_directed_connectable_mode_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_set_directed_connectable_mode\n"); | |
| } | |
| void ble_rsp_hardware_io_port_config_direction(const struct ble_msg_hardware_io_port_config_direction_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_io_port_config_pull(const struct ble_msg_hardware_io_port_config_pull_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_io_port_config_function(const struct ble_msg_hardware_io_port_config_function_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_set_privacy_flags(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_connect_selective(const struct ble_msg_gap_connect_selective_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_connect_selective(\n"); | |
| } | |
| void ble_rsp_system_whitelist_remove(const struct ble_msg_system_whitelist_remove_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_system_reset(const void* nul) | |
| { | |
| _ble_debug_output("-ble_rsp_system_reset\n"); | |
| } | |
| void ble_rsp_system_hello(const void* nul) | |
| { | |
| _ble_debug_output("-ble_rsp_system_hello\n"); | |
| } | |
| void ble_rsp_system_address_get(const struct ble_msg_system_address_get_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_address_get\n"); | |
| } | |
| void ble_rsp_system_reg_write(const struct ble_msg_system_reg_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_reg_write\n"); | |
| } | |
| void ble_rsp_system_reg_read(const struct ble_msg_system_reg_read_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_reg_READ\n"); | |
| } | |
| void ble_rsp_system_get_counters(const struct ble_msg_system_get_counters_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_system_get_connections(const struct ble_msg_system_get_connections_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_get_connections\n"); | |
| } | |
| void ble_rsp_system_read_memory(const struct ble_msg_system_read_memory_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**************** moved to main | |
| void ble_rsp_system_get_info(const struct ble_msg_system_get_info_rsp_t *msg) | |
| { | |
| } | |
| ****************/ | |
| void ble_rsp_system_endpoint_tx(const struct ble_msg_system_endpoint_tx_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_defrag(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_dump(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_erase_all(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_save(const struct ble_msg_flash_ps_save_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_load(const struct ble_msg_flash_ps_load_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_ps_erase(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_erase_page(const struct ble_msg_flash_erase_page_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_flash_write_words(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_attributes_write(const struct ble_msg_attributes_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attributes_write\n"); | |
| } | |
| void ble_rsp_attributes_read(const struct ble_msg_attributes_read_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attributes_read\n"); | |
| } | |
| void ble_rsp_attributes_read_type(const struct ble_msg_attributes_read_type_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attributes_read_type\n"); | |
| } | |
| void ble_rsp_connection_disconnect(const struct ble_msg_connection_disconnect_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_disconnect\n"); | |
| } | |
| void ble_rsp_connection_get_rssi(const struct ble_msg_connection_get_rssi_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_disconnect\n"); | |
| } | |
| void ble_rsp_connection_update(const struct ble_msg_connection_update_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_update\n"); | |
| } | |
| void ble_rsp_connection_version_update(const struct ble_msg_connection_version_update_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_connection_channel_map_get(const struct ble_msg_connection_channel_map_get_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_connection_channel_map_set(const struct ble_msg_connection_channel_map_set_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_connection_features_get(const struct ble_msg_connection_features_get_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_features_get\n"); | |
| } | |
| void ble_rsp_connection_get_status(const struct ble_msg_connection_get_status_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_get_status\n"); | |
| } | |
| void ble_rsp_connection_raw_tx(const struct ble_msg_connection_raw_tx_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_connection_raw_tx\n"); | |
| } | |
| void ble_rsp_attclient_find_by_type_value(const struct ble_msg_attclient_find_by_type_value_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_find_by_type_value\n"); | |
| } | |
| void ble_rsp_attclient_read_by_group_type(const struct ble_msg_attclient_read_by_group_type_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_read_by_group_type\n"); | |
| } | |
| void ble_rsp_attclient_read_by_type(const struct ble_msg_attclient_read_by_type_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_read_by_type\n"); | |
| } | |
| void ble_rsp_attclient_find_information(const struct ble_msg_attclient_find_information_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_find_information\n"); | |
| } | |
| void ble_rsp_attclient_read_by_handle(const struct ble_msg_attclient_read_by_handle_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_read_by_handle\n"); | |
| } | |
| void ble_rsp_attclient_attribute_write(const struct ble_msg_attclient_attribute_write_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_attclient_attribute_write\n"); | |
| } | |
| void ble_rsp_sm_encrypt_start(const struct ble_msg_sm_encrypt_start_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_set_bondable_mode(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_sm_delete_bonding(const struct ble_msg_sm_delete_bonding_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_set_address_mode(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_gap_set_mode(const struct ble_msg_gap_set_mode_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_set_mode\n"); | |
| } | |
| void ble_rsp_gap_discover(const struct ble_msg_gap_discover_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_discover\n"); | |
| } | |
| void ble_rsp_gap_end_procedure(const struct ble_msg_gap_end_procedure_rsp_t *msg) | |
| { | |
| _ble_debug_output("-ble_rsp_gap_end_procedure\n"); | |
| } | |
| void ble_rsp_hardware_io_port_config_irq(const struct ble_msg_hardware_io_port_config_irq_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_set_soft_timer(const struct ble_msg_hardware_set_soft_timer_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_hardware_adc_read(const struct ble_msg_hardware_adc_read_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_test_phy_tx(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_test_phy_rx(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_test_phy_end(const struct ble_msg_test_phy_end_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_rsp_test_phy_reset(const void* nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_system_boot(const struct ble_msg_system_boot_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_system_debug(const struct ble_msg_system_debug_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_system_endpoint_watermark_rx(const struct ble_msg_system_endpoint_watermark_rx_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_system_endpoint_watermark_rx\n"); | |
| } | |
| void ble_evt_system_endpoint_watermark_tx(const struct ble_msg_system_endpoint_watermark_tx_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_system_endpoint_watermark_tx\n"); | |
| } | |
| void ble_rsp_system_endpoint_set_watermarks(const struct ble_msg_system_endpoint_set_watermarks_rsp_t*msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_endpoint_set_watermarks\n"); | |
| } | |
| void ble_rsp_system_endpoint_rx(const struct ble_msg_system_endpoint_rx_rsp_t*msg) | |
| { | |
| _ble_debug_output("-ble_rsp_system_endpoint_rx\n"); | |
| } | |
| void ble_evt_system_script_failure(const struct ble_msg_system_script_failure_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_system_script_failure\n"); | |
| } | |
| void ble_evt_flash_ps_key(const struct ble_msg_flash_ps_key_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_connection_version_ind(const struct ble_msg_connection_version_ind_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_connection_version_ind\n"); | |
| } | |
| void ble_evt_connection_feature_ind(const struct ble_msg_connection_feature_ind_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_connection_feature_ind\n"); | |
| } | |
| void ble_evt_connection_raw_rx(const struct ble_msg_connection_raw_rx_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_connection_raw_rx\n"); | |
| } | |
| void ble_evt_attclient_indicated(const struct ble_msg_attclient_indicated_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attclient_indicated\n"); | |
| } | |
| void ble_evt_attclient_attribute_found(const struct ble_msg_attclient_attribute_found_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_attclient_attribute_found\n"); | |
| } | |
| void ble_evt_sm_smp_data(const struct ble_msg_sm_smp_data_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_sm_smp_data\n"); | |
| } | |
| void ble_evt_gap_mode_changed(const struct ble_msg_gap_mode_changed_evt_t *msg) | |
| { | |
| _ble_debug_output("-ble_evt_gap_mode_changed\n"); | |
| } | |
| void ble_evt_hardware_io_port_status(const struct ble_msg_hardware_io_port_status_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_hardware_soft_timer(const struct ble_msg_hardware_soft_timer_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| void ble_evt_hardware_adc_result(const struct ble_msg_hardware_adc_result_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**Reset system**/ | |
| void ble_rsp_dfu_reset(const void *nul) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**set address for flashing**/ | |
| void ble_rsp_dfu_flash_set_address(const struct ble_msg_dfu_flash_set_address_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**Upload binary for flashing. Address will be updated automatically.**/ | |
| void ble_rsp_dfu_flash_upload(const struct ble_msg_dfu_flash_upload_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**Uploading is finished.**/ | |
| void ble_rsp_dfu_flash_upload_finish(const struct ble_msg_dfu_flash_upload_finish_rsp_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| /**Device booted up in dfu, and is ready to receive commands**/ | |
| void ble_evt_dfu_boot(const struct ble_msg_dfu_boot_evt_t *msg) | |
| { | |
| _ble_debug_output("-\n"); | |
| } | |
| //EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Description : Simple test program that listens to the bluegiga cable replacement | |
| // service displaying notifications and counting bytes received. | |
| // | |
| // Usage : "test001.exe <com port>" | |
| // | |
| // This file is a modified version of "scan_example" and "thermometer-demo" given in | |
| // Bluegiga distribution "ble-1.1.1-71": | |
| // | |
| // Bluegiga’s Bluetooth Smart Demo Application "scan_example" and "thermometer-demo" | |
| // Contact: support@bluegiga.com. | |
| // | |
| // This is free software distributed under the terms of the MIT license reproduced below. | |
| // | |
| // Copyright (c) 2012, Bluegiga Technologies | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
| // software and associated documentation files (the "Software"), | |
| // to deal in the Software without restriction, including without limitation | |
| // the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| // and/or sell copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included | |
| // in all copies or substantial portions of the Software. | |
| // | |
| // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | |
| // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF | |
| // MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | |
| // | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <windows.h> | |
| #include "cmd_def.h" | |
| // connetion parameters, consider making these parameters | |
| #define CONNECTION_INTERVAL_MIN 6 | |
| #define CONNECTION_INTERVAL_MAX 6 | |
| #define CONNECTION_LATENCY 10 | |
| #define FIRST_HANDLE 0x0001 | |
| #define LAST_HANDLE 0xffff | |
| uint8 primary_service_uuid[] = {0x00, 0x28}; | |
| #define TEST_SERVICE_UUID 0x077cc | |
| //#define TEST_SERVICE_UUID 0x0a961 | |
| #define MAX_DEVICES 64 | |
| int found_devices_count = 0; | |
| int found_duplicate_devices_count = 0; | |
| bd_addr found_devices[MAX_DEVICES]; | |
| uint8 g_connection_handle = 0x0ff; | |
| // simple state definition, developed as we go along for this test | |
| enum main_state_t | |
| { | |
| main_state_none, | |
| main_state_got_info, | |
| main_state_scanning, | |
| main_state_scanned, | |
| main_state_connecting, | |
| main_state_connected, | |
| main_state_service_discovery, | |
| main_state_end_service_discovery, | |
| main_state_info_discovery, | |
| main_state_info, | |
| }; | |
| enum main_state_t main_state = main_state_none; | |
| uint16 g_test_handle_start = 0; | |
| uint16 g_test_handle_end = 0; | |
| uint16 g_test_characteristic_handle = 0; | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| // some utility functions relating to Bluegiga data types, move elsewhere | |
| void _showUint8array(const uint8array *value) | |
| { | |
| printf("len %d : ", value->len); | |
| int i; | |
| for(i=(value->len - 1); i >= 0; i--) | |
| { | |
| printf("%02x ", value->data[i]); | |
| } | |
| } | |
| void _showUint8arrayAsChar(const uint8array *value) | |
| { | |
| int i; | |
| //printf("["); | |
| for(i=0; i < value->len; i++) | |
| { | |
| printf("%c", value->data[i]); | |
| } | |
| //printf("]"); | |
| } | |
| /** | |
| * Compare Bluetooth addresses | |
| * | |
| * @param first First address | |
| * @param second Second address | |
| * @return Zero if addresses are equal | |
| */ | |
| int cmp_bdaddr(bd_addr first, bd_addr second) | |
| { | |
| int i; | |
| for (i = 0; i < sizeof(bd_addr); i++) | |
| { | |
| if (first.addr[i] != second.addr[i]) | |
| return 1; | |
| } | |
| return 0; | |
| } | |
| void print_bdaddr(bd_addr bdaddr) | |
| { | |
| printf("%02x:%02x:%02x:%02x:%02x:%02x", | |
| bdaddr.addr[5], | |
| bdaddr.addr[4], | |
| bdaddr.addr[3], | |
| bdaddr.addr[2], | |
| bdaddr.addr[1], | |
| bdaddr.addr[0]); | |
| } | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| // Event and response functions taken from "command.c" that are used by this demo | |
| // in this test they share the state of the program, as it is thrown together | |
| // "command.c" now only contains stubs, some of which are instrumented during testing | |
| // see Bluegiga's sparce documentation for more details | |
| void ble_evt_connection_status(const struct ble_msg_connection_status_evt_t *msg) | |
| { | |
| printf("ble_evt_connection_status: flags %02x, address: ", msg->flags); | |
| print_bdaddr(msg->address); | |
| printf(" address type %d, interval %d, timeout %d, latency %d, bonding %d\n", | |
| msg->address_type, | |
| msg->conn_interval, | |
| msg->timeout, | |
| msg->latency, | |
| msg->bonding); | |
| if(msg->flags & connection_connected) | |
| { | |
| if (main_state == main_state_got_info) | |
| { | |
| printf("#connected so call-> disconnect\n"); | |
| ble_cmd_connection_disconnect(msg->connection); | |
| } | |
| else | |
| { | |
| printf("#connected now\n"); | |
| main_state = main_state_connected; | |
| g_connection_handle = msg->connection; | |
| } | |
| } | |
| else | |
| { | |
| if (main_state == main_state_got_info) | |
| { | |
| printf("#Not connected so scan -> Scan\n"); | |
| g_connection_handle = 0x0ff; | |
| ble_cmd_gap_end_procedure(); | |
| found_duplicate_devices_count = 0; | |
| main_state = main_state_scanning; | |
| ble_cmd_gap_discover(1); | |
| } | |
| else | |
| { | |
| printf("Connection has dropped, we wont try again (for now), so please exit and re-run\n"); | |
| // we could exit here, or reset the state model | |
| // however I want to investigate why this is happening first | |
| } | |
| } | |
| } | |
| void ble_evt_gap_scan_response(const struct ble_msg_gap_scan_response_evt_t *msg) | |
| { | |
| if (found_devices_count >= MAX_DEVICES) | |
| { | |
| return; | |
| } | |
| int i; | |
| char *name = NULL; | |
| // Check if this device already found | |
| for (i = 0; i < found_devices_count; i++) | |
| { | |
| if (!cmp_bdaddr(msg->sender, found_devices[i])) | |
| { | |
| printf("already found device (%d) :",found_duplicate_devices_count); | |
| print_bdaddr(msg->sender); | |
| printf("\n"); | |
| found_duplicate_devices_count++; | |
| if (found_duplicate_devices_count > 3) | |
| { | |
| // stop scanning and do something else | |
| printf("stop now ! \n"); | |
| ble_cmd_gap_end_procedure(); | |
| main_state = main_state_scanned; | |
| } | |
| return; | |
| } | |
| else | |
| { | |
| // reset duplicate counter | |
| found_duplicate_devices_count = 0; | |
| } | |
| } | |
| found_devices_count++; | |
| memcpy(found_devices[i].addr, msg->sender.addr, sizeof(bd_addr)); | |
| printf("scan data payload : "); | |
| _showUint8array(&(msg->data)); | |
| printf("\n"); | |
| // Parse data | |
| for (i = 0; i < msg->data.len; ) | |
| { | |
| int8 len = msg->data.data[i++]; | |
| if (!len) | |
| { | |
| printf("interpreted data len zero, continue\n"); | |
| continue; | |
| } | |
| if (i + len > msg->data.len) | |
| { | |
| printf("interpreted data len not enought, break\n"); | |
| break; // not enough data | |
| } | |
| uint8 type = msg->data.data[i++]; | |
| switch (type) | |
| { | |
| case 0x09: | |
| name = malloc(len); | |
| memcpy(name, msg->data.data + i, len - 1); | |
| name[len - 1] = '\0'; | |
| break; | |
| default : | |
| printf("name type : %d (not 9) : ", type); | |
| } | |
| i += len - 1; | |
| } | |
| print_bdaddr(msg->sender); | |
| printf(" RSSI:%u", msg->rssi); | |
| printf(" Name:"); | |
| if (name) | |
| { | |
| printf("%s", name); | |
| } | |
| else | |
| { | |
| printf("Unknown"); | |
| } | |
| printf("\n"); | |
| free(name); | |
| } | |
| void ble_rsp_gap_connect_direct(const struct ble_msg_gap_connect_direct_rsp_t *msg) | |
| { | |
| /*0 : procedure was succesfully started, Non-zero: An error occurred */ | |
| if (msg->result == 0) | |
| { | |
| printf("connection %d, result %d\n", msg->connection_handle, msg->result); | |
| } | |
| else | |
| { | |
| printf("err\n"); | |
| } | |
| } | |
| void | |
| ble_evt_attclient_group_found(const struct ble_msg_attclient_group_found_evt_t *msg) | |
| { | |
| if (msg->uuid.len != 0) | |
| { | |
| uint16 uuid = (msg->uuid.data[1] << 8) | msg->uuid.data[0]; | |
| printf("found %x\n", uuid); | |
| if ((main_state == main_state_service_discovery) | |
| && (uuid == TEST_SERVICE_UUID)) | |
| { | |
| g_test_handle_start = msg->start; | |
| g_test_handle_end = msg->end; | |
| printf("Test handle for UUID %x, start %x end %x\n", | |
| TEST_SERVICE_UUID, | |
| g_test_handle_start, | |
| g_test_handle_end ); | |
| } | |
| } | |
| } | |
| void | |
| enable_indications(uint8 connection_handle, | |
| uint16 characteristic_handle) | |
| { | |
| uint8 configuration_value[] = {0x03, 0x00}; // enable indications, why two bytes in example? documentation says one? | |
| printf("writing attribute value %d\n", configuration_value[0]); | |
| ble_cmd_attclient_attribute_write(connection_handle, characteristic_handle, 1, &configuration_value); | |
| } | |
| void | |
| ble_evt_attclient_procedure_completed(const struct ble_msg_attclient_procedure_completed_evt_t *msg) | |
| { | |
| if (main_state == main_state_service_discovery) | |
| { | |
| printf("end of service discovery\n"); | |
| main_state = main_state_end_service_discovery; | |
| } | |
| else if (main_state == main_state_info_discovery) | |
| { | |
| printf("end of info discovery\n"); | |
| main_state = main_state_info; | |
| if (g_test_characteristic_handle == 0) | |
| { | |
| printf("no characteristic handle found for uuid.\n"); | |
| } | |
| else | |
| { | |
| printf("enable indications\n"); | |
| enable_indications(g_connection_handle, g_test_characteristic_handle); | |
| } | |
| } | |
| else | |
| { | |
| printf("ble_evt_attclient_procedure_completed \n"); | |
| } | |
| } | |
| void ble_evt_attclient_find_information_found(const struct ble_msg_attclient_find_information_found_evt_t *msg) | |
| { | |
| if (msg->connection == g_connection_handle) | |
| { | |
| //uint8 len_uuid = msg->uuid[0]; | |
| printf("chrhandle %x, uuid : ", msg->chrhandle); | |
| _showUint8array(&(msg->uuid)); | |
| // test for g_test_characteristic_handle | |
| // we cheat here and just check length and first two bytes | |
| // uuid expected is : e7 ad d7 80 b0 42 48 76 aa e1 11 28 55 35 3c c1 | |
| // client characteristics configuration is 2902, how do we discover this? | |
| if((msg->uuid.len == 2) | |
| && (msg->uuid.data[0] == 0x02) | |
| && (msg->uuid.data[1] == 0x29)) | |
| { | |
| printf("<---- use this one"); | |
| g_test_characteristic_handle = msg->chrhandle; | |
| } | |
| printf("\n"); | |
| } | |
| else | |
| { | |
| printf("unexpected ble_evt_attclient_find_information_found\n"); | |
| } | |
| } | |
| void ble_rsp_system_get_info(const struct ble_msg_system_get_info_rsp_t *msg) | |
| { | |
| printf("Build: %u, protocol_version: %u, hardware: %u (1=BLE112, 2=BLED112)\n\n", | |
| msg->build, | |
| msg->protocol_version, | |
| msg->hw); | |
| printf("\n"); | |
| main_state = main_state_got_info; | |
| } | |
| void ble_evt_connection_disconnected(const struct ble_msg_connection_disconnected_evt_t *msg) | |
| { | |
| ble_cmd_connection_get_status(0); | |
| // this puts it straight back into connected mode state should also change! | |
| // for the moment we assume this only happens at begining but not the case | |
| } | |
| // Gobals and constants used in counting and timing, kept as simple as possible for this demo | |
| // threshold here describes the number of bytes to recieve before displaying a timestamp | |
| #define _DISPLAY_THRESHOLD 660 | |
| long g_total_rx = 0; | |
| long g_total_last = 0; | |
| long g_total_rx_display_next = _DISPLAY_THRESHOLD; | |
| int g_incomplete_pkts = 0; | |
| int g_pkts_display_next = 0; | |
| int g_error_pkts = -1; | |
| int g_total_pkts = 0; | |
| DWORD g_last_tick = 0; | |
| char buff[400]; | |
| int buff_idx = 0; | |
| void parseDataPacket() { | |
| int i; | |
| int len = buff_idx; | |
| char pkt[400]; | |
| char cksum = 0; | |
| memcpy(pkt, buff, sizeof(pkt)); | |
| buff_idx = 0; | |
| printf("\tRecvd %d bytes, msg# %u ", len, pkt[0]&0xFF); | |
| for (i=0;i<len-1;i++) { | |
| cksum += pkt[i]; | |
| } | |
| if ((pkt[len-1] & 0xFF) != (cksum & 0xFF)) { | |
| printf("Checksum Mismatch: %x != %x\n", pkt[len-1] & 0xFF, cksum & 0xFF); | |
| g_error_pkts++; | |
| } else { | |
| printf("\n"); | |
| } | |
| } | |
| void processIncomingData(const uint8array *value) | |
| { | |
| int i; | |
| char c; | |
| //printf("["); | |
| for(i=0; i < value->len; i++) | |
| { | |
| c = value->data[i]; | |
| if (c != '\n' && buff_idx < sizeof(buff)-1) { | |
| buff[buff_idx++] = c; | |
| } else { | |
| parseDataPacket(); | |
| } | |
| } | |
| //printf("]"); | |
| } | |
| void ble_evt_attclient_attribute_value(const struct ble_msg_attclient_attribute_value_evt_t *msg) | |
| { | |
| if (msg->connection == g_connection_handle) | |
| { | |
| //_showUint8arrayAsChar(&(msg->value)); | |
| processIncomingData(&(msg->value)); | |
| g_pkts_display_next++; | |
| g_total_pkts++; | |
| // extra indicator if payload is not max of 20 | |
| if (msg->value.len != 20) | |
| { | |
| g_incomplete_pkts++; | |
| } | |
| g_total_rx += msg->value.len; | |
| if (g_total_rx >= g_total_rx_display_next) | |
| { | |
| DWORD tick = GetTickCount(); | |
| printf("\n>%ld> %ld -> Rate: %.2f, Full packets: %.2f%% Error packets: %.4f%%\n", | |
| (tick - g_last_tick ), | |
| (g_total_rx - g_total_last), | |
| (float)(g_total_rx - g_total_last)/((float)(tick - g_last_tick )/1000.0), | |
| ((float)(g_pkts_display_next - g_incomplete_pkts)/(float)g_pkts_display_next)*100.0, | |
| ((float)g_error_pkts/(float)g_total_pkts)); | |
| g_last_tick = tick; | |
| g_total_rx_display_next += _DISPLAY_THRESHOLD; | |
| g_total_last = g_total_rx; | |
| g_pkts_display_next = 0; | |
| g_incomplete_pkts = 0; | |
| } | |
| } | |
| else | |
| { | |
| printf("unexpected ble_evt_attclient_attribute_value "); | |
| } | |
| } | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| // message handling routines to USB device | |
| volatile HANDLE serial_handle; | |
| void output(uint8 len1,uint8* data1,uint16 len2,uint8* data2) | |
| { | |
| DWORD written; | |
| if(!WriteFile (serial_handle, | |
| data1, | |
| len1, | |
| &written, | |
| NULL | |
| )) | |
| { | |
| printf("ERROR: Writing data. %d\n",(int)GetLastError()); | |
| exit(-1); | |
| } | |
| if(!WriteFile (serial_handle, | |
| data2, | |
| len2, | |
| &written, | |
| NULL | |
| )) | |
| { | |
| printf("ERROR: Writing data. %d\n",(int)GetLastError()); | |
| exit(-1); | |
| } | |
| } | |
| int read_message() | |
| { | |
| DWORD rread; | |
| const struct ble_msg *apimsg; | |
| struct ble_header apihdr; | |
| unsigned char data[256];//enough for BLE | |
| //read header | |
| if(!ReadFile(serial_handle, | |
| (unsigned char*)&apihdr, | |
| 4, | |
| &rread, | |
| NULL)) | |
| { | |
| return GetLastError(); | |
| } | |
| if(!rread) | |
| { | |
| printf("(rread=%d) so ending read_message early\n", (int)rread); | |
| return 0; | |
| } | |
| //read rest if needed | |
| if(apihdr.lolen) | |
| { | |
| if(!ReadFile(serial_handle, | |
| data, | |
| apihdr.lolen, | |
| &rread, | |
| NULL)) | |
| { | |
| return GetLastError(); | |
| } | |
| } | |
| apimsg=ble_get_msg_hdr(apihdr); | |
| if(!apimsg) | |
| { | |
| printf("ERROR: Message not found:%d:%d\n",(int)apihdr.cls,(int)apihdr.command); | |
| return -1; | |
| } | |
| apimsg->handler(data); | |
| return 0; | |
| } | |
| void print_help() | |
| { | |
| printf("Demo application to scan devices\n"); | |
| printf("\ttest001\tCOM-port\n"); | |
| } | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////////////////////////// | |
| // main | |
| int main(int argc, char *argv[] ) | |
| { | |
| char str[80]; | |
| ble_cmd_system_reset(0); | |
| usleep(2000000); // 2s | |
| if(argc<2) | |
| { | |
| print_help(); | |
| exit(-1); | |
| } | |
| snprintf(str,sizeof(str)-1,"\\\\.\\%s",argv[1]); | |
| serial_handle = CreateFileA(str, | |
| GENERIC_READ | GENERIC_WRITE, | |
| FILE_SHARE_READ|FILE_SHARE_WRITE, | |
| NULL, | |
| OPEN_EXISTING, | |
| 0, | |
| NULL); | |
| if (serial_handle == INVALID_HANDLE_VALUE) | |
| { | |
| printf("Error opening serialport %s. %d\n",argv[1],(int)GetLastError()); | |
| return -1; | |
| } | |
| printf("!!! BLE port opened, begin test\n\n"); | |
| bglib_output=output; | |
| //stop previous operation | |
| ble_cmd_gap_end_procedure(); | |
| ble_cmd_system_get_info(); | |
| //Message loop | |
| while(1) | |
| { | |
| int read_result = read_message(); | |
| if(read_result) | |
| { | |
| printf("Error reading message (%d)\n", read_result); | |
| break; | |
| } | |
| else | |
| { | |
| // message read | |
| } | |
| // action loop from other example | |
| if (main_state == main_state_none) | |
| { | |
| //get connection status,current command will be handled in response | |
| ble_cmd_connection_get_status(0); | |
| printf("Getting connection info\n"); | |
| } | |
| else if (main_state == main_state_scanned) | |
| { | |
| if (found_devices_count > 0) | |
| { | |
| /* void ble_cmd_gap_connect_direct(bd_addr address , | |
| uint8 addr_type , | |
| uint16 conn_interval_min , | |
| uint16 conn_interval_max , | |
| uint16 timeout, | |
| latency) */ | |
| // connect to first for now, but probably should use other mechanism to decide | |
| ble_cmd_gap_connect_direct(&found_devices[0], | |
| gap_address_type_public, | |
| CONNECTION_INTERVAL_MIN, | |
| CONNECTION_INTERVAL_MAX, | |
| CONNECTION_LATENCY, | |
| 0); | |
| main_state = main_state_connecting; | |
| printf("connecting to first found : "); | |
| print_bdaddr(found_devices[0]); | |
| printf("\n"); | |
| } | |
| } | |
| else if (main_state == main_state_connected) | |
| { | |
| printf("connected, so search for services on connection %d\n", g_connection_handle); | |
| ble_cmd_attclient_read_by_group_type(g_connection_handle, | |
| FIRST_HANDLE, | |
| LAST_HANDLE, | |
| 2, | |
| primary_service_uuid); | |
| main_state = main_state_service_discovery; | |
| } | |
| else if (main_state == main_state_end_service_discovery) | |
| { | |
| main_state = main_state_info_discovery; | |
| ble_cmd_attclient_find_information(g_connection_handle, | |
| g_test_handle_start, | |
| g_test_handle_end); | |
| } | |
| } | |
| return 0; | |
| } | |
| // EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC = gcc | |
| TARGET = test001 | |
| MACHINE = $(shell $(CC) -dumpmachine) | |
| # Windows | |
| ifneq (,$(or $(findstring mingw, $(MACHINE)), $(findstring cygwin, $(MACHINE)))) | |
| PLATFORM = WIN | |
| LIBS = -lm -lsetupapi | |
| RM = del | |
| # POSIX | |
| else | |
| PLATFORM = POSIX | |
| LIBS = -lm | |
| endif | |
| SRCS := $(wildcard *.c) | |
| OBJS := $(SRCS:.c=.o) | |
| DEPS := $(SRCS:.c=.d) | |
| all: $(TARGET) | |
| %.o: %.c | |
| $(CC) -O3 -Wall -c -fmessage-length=0 -DPLATFORM_$(PLATFORM) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" | |
| $(TARGET): $(OBJS) | |
| @echo 'Building target: $@' | |
| $(CC) -o"$(TARGET)" $(OBJS) $(LIBS) | |
| @echo 'Finished building target: $@' | |
| clean: | |
| -$(RM) $(OBJS) $(DEPS) $(TARGET) | |
| .PHONY: all clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment