Partial implementation of BlueGiga's BGAPI for use with the BLE112/3 modules over UART.
Embed:
(wiki syntax)
Show/hide line numbers
api_datatypes.h
Go to the documentation of this file.
00001 #ifndef API_DATATYPES_H 00002 #define API_DATATYPES_H 00003 /** @file api_datatypes.h 00004 * @brief Data structures that the API uses for responses and commands. */ 00005 00006 /** Data structure returned from Get Info command. */ 00007 typedef struct { 00008 uint16_t major; ///< Major version (e.g. 1) 00009 uint16_t minor; ///< Minor version (e.g. 3) 00010 uint16_t patch; ///< Patch version (e.g. 2) 00011 uint16_t build; ///< Build number (e.g. 122) 00012 uint16_t ll_version; ///< Link Layer Version 00013 uint8_t protocol_version; ///< BGAPI Version 00014 uint8_t hw; ///< Hardware Version 00015 } ble_msg_system_get_info_rsp_t; 00016 00017 00018 /** Data structure passed into the Reset command. */ 00019 typedef struct { 00020 uint8_t boot_in_dfu; ///< Determine whether or not to boot into Device Firmware Update (DFU) mode. 1 for booting into DFU, 0 otherwise. 00021 } ble_msg_system_reset_t; 00022 00023 /** Data structure returned from Boot event. */ 00024 typedef struct { 00025 uint16_t major; ///< Major version (e.g. 1) 00026 uint16_t minor; ///< Minor version (e.g. 3) 00027 uint16_t patch; ///< Patch version (e.g. 2) 00028 uint16_t build; ///< Build number (e.g. 122) 00029 uint16_t ll_version; ///< Link Layer Version 00030 uint8_t protocol_version; ///< BGAPI Version 00031 uint8_t hw; ///< Hardware Version 00032 } ble_msg_system_boot_evt_t; 00033 00034 /** Data structure returned from Discover command. */ 00035 typedef struct { 00036 uint16_t result; ///< Result. Non-zero value indicates an error. 00037 } ble_msg_gap_discover_rsp_t; 00038 00039 00040 00041 /** Data structure representing a scan result */ 00042 typedef struct { 00043 int8_t rssi; ///< RSSI value (dBm). 00044 uint8_t packet_type; ///< Scan response header. 00045 uint8_t hw_addr[6]; ///< BLE Hardware Address. 00046 uint8_t address_type; ///< Address type. 1 for random, 0 for public. 00047 uint8_t bond; ///< Bond handle if known bond for device, 0xff otherwise. 00048 uint8_t *data; ///< Service data. 00049 uint8_t data_len; ///< Service data length (in bytes). 00050 } ble_msg_gap_scan_result_evt_t; 00051 00052 #endif
Generated on Tue Jul 12 2022 20:21:19 by 1.7.2