Partial implementation of BlueGiga's BGAPI for use with the BLE112/3 modules over UART.
Hi there! I recently started using BLE112 modules with the mbed LPC1768 MCU, and I realized there was no implementation of BlueGiga's BGAPI available for mbed. This library implements only a few commands, but if you're looking to get started, this is a good place to look.
This was developed against BGAPI v1.3.2. I make no guarantees as to how well it will work with newer revisions of the software.
api_datatypes.h@6:23d9a99dcde0, 2015-05-19 (annotated)
- Committer:
- dishbreak
- Date:
- Tue May 19 05:49:00 2015 +0000
- Revision:
- 6:23d9a99dcde0
- Parent:
- 5:7c7220a316ed
- Child:
- 7:63daf39f20e1
Fixed up documentation. Added GAP Discover command.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dishbreak | 2:3ce9a31a6a7e | 1 | #ifndef API_DATATYPES_H |
dishbreak | 2:3ce9a31a6a7e | 2 | #define API_DATATYPES_H |
dishbreak | 6:23d9a99dcde0 | 3 | /** @file api_datatypes.h |
dishbreak | 6:23d9a99dcde0 | 4 | * @brief Data structures that the API uses for responses and commands. */ |
dishbreak | 2:3ce9a31a6a7e | 5 | |
dishbreak | 2:3ce9a31a6a7e | 6 | /** Data structure returned from Get Info command. */ |
dishbreak | 2:3ce9a31a6a7e | 7 | typedef struct { |
dishbreak | 6:23d9a99dcde0 | 8 | uint16_t major; ///< Major version (e.g. 1) |
dishbreak | 6:23d9a99dcde0 | 9 | uint16_t minor; ///< Minor version (e.g. 3) |
dishbreak | 6:23d9a99dcde0 | 10 | uint16_t patch; ///< Patch version (e.g. 2) |
dishbreak | 6:23d9a99dcde0 | 11 | uint16_t build; ///< Build number (e.g. 122) |
dishbreak | 6:23d9a99dcde0 | 12 | uint16_t ll_version; ///< Link Layer Version |
dishbreak | 6:23d9a99dcde0 | 13 | uint8_t protocol_version; ///< BGAPI Version |
dishbreak | 6:23d9a99dcde0 | 14 | uint8_t hw; ///< Hardware Version |
dishbreak | 2:3ce9a31a6a7e | 15 | } ble_msg_system_get_info_rsp_t; |
dishbreak | 2:3ce9a31a6a7e | 16 | |
dishbreak | 2:3ce9a31a6a7e | 17 | |
dishbreak | 5:7c7220a316ed | 18 | /** Data structure passed into the Reset command. */ |
dishbreak | 3:8f43af513d87 | 19 | typedef struct { |
dishbreak | 6:23d9a99dcde0 | 20 | uint8_t boot_in_dfu; ///< Determine whether or not to boot into Device Firmware Update (DFU) mode. 1 for booting into DFU, 0 otherwise. |
dishbreak | 3:8f43af513d87 | 21 | } ble_msg_system_reset_t; |
dishbreak | 3:8f43af513d87 | 22 | |
dishbreak | 6:23d9a99dcde0 | 23 | /** Data structure returned from Boot event. */ |
dishbreak | 3:8f43af513d87 | 24 | typedef struct { |
dishbreak | 6:23d9a99dcde0 | 25 | uint16_t major; ///< Major version (e.g. 1) |
dishbreak | 6:23d9a99dcde0 | 26 | uint16_t minor; ///< Minor version (e.g. 3) |
dishbreak | 6:23d9a99dcde0 | 27 | uint16_t patch; ///< Patch version (e.g. 2) |
dishbreak | 6:23d9a99dcde0 | 28 | uint16_t build; ///< Build number (e.g. 122) |
dishbreak | 6:23d9a99dcde0 | 29 | uint16_t ll_version; ///< Link Layer Version |
dishbreak | 6:23d9a99dcde0 | 30 | uint8_t protocol_version; ///< BGAPI Version |
dishbreak | 6:23d9a99dcde0 | 31 | uint8_t hw; ///< Hardware Version |
dishbreak | 3:8f43af513d87 | 32 | } ble_msg_system_boot_evt_t; |
dishbreak | 3:8f43af513d87 | 33 | |
dishbreak | 6:23d9a99dcde0 | 34 | /** Data structure returned from Discover command. */ |
dishbreak | 6:23d9a99dcde0 | 35 | typedef struct { |
dishbreak | 6:23d9a99dcde0 | 36 | uint16_t result; ///< Result. Non-zero value indicates an error. |
dishbreak | 6:23d9a99dcde0 | 37 | } ble_msg_gap_discover_rsp_t; |
dishbreak | 6:23d9a99dcde0 | 38 | |
dishbreak | 2:3ce9a31a6a7e | 39 | #endif |