Bluetooth Low Energy based Firmware Over The Air with Mbed. Mbed part is a external processor of the IoT devices and communicate with a Bluetooth module. The Bluetooth module have to support BLE and implement BLE FOTA profile designed by ours. BLE FOTA profile specification is available from our GIT hub wiki(https://github.com/sevencore/BLEFOTA).
Dependencies: mbed
Fork of mbed_fota by
Bluetooth Low Energy based Firmware Over The Air with Mbed. Mbed part is a external processor of the IoT devices and communicate with a Bluetooth module. The Bluetooth module have to support BLE and implement BLE FOTA profile designed by ours. BLE FOTA profile specification is available from our GIT hub wiki.
Diff: dialog_fota/gapm_task.h
- Revision:
- 3:1e70387e1337
- Child:
- 4:60be78a172c2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dialog_fota/gapm_task.h Tue Jun 23 06:32:40 2015 +0000 @@ -0,0 +1,211 @@ +#ifndef GAPM_TASK_H +#define GAPM_TASK_H + +namespace sevencore_fota{ + +/// Reset link layer and the host command +struct gapm_reset_cmd +{ + /// GAPM requested operation: + /// - GAPM_RESET: Reset BLE subsystem: LL and HL. + uint8_t operation; +}; + + +/// GAP Manager Message Interface +enum gapm_msg_id +{ + /* Default event */ + /// Command Complete event + GAPM_CMP_EVT = 13312, + /// Event triggered to inform that lower layers are ready + GAPM_DEVICE_READY_IND, + + /* Default commands */ + /// Reset link layer and the host command + GAPM_RESET_CMD, + /// Cancel ongoing operation + GAPM_CANCEL_CMD, + + /* Device Configuration */ + /// Set device configuration command + GAPM_SET_DEV_CONFIG_CMD, + /// Set device name command + GAPM_SET_DEV_NAME_CMD, + /// Set device channel map + GAPM_SET_CHANNEL_MAP_CMD, + + /* Local device information */ + /// Get local device info command + GAPM_GET_DEV_INFO_CMD, + /// Local device name indication event + GAPM_DEV_NAME_IND, + /// Local device appearance indication event + GAPM_APPEARANCE_IND, + /// Local device version indication event + GAPM_DEV_VERSION_IND, + /// Local device BD Address indication event + GAPM_DEV_BDADDR_IND, + + /* White List */ + /// White List Management Command + GAPM_WHITE_LIST_MGT_CMD, + /// White List Size indication event + GAPM_WHITE_LIST_SIZE_IND, + + /* Air Operations */ + /// Set advertising mode Command + GAPM_START_ADVERTISE_CMD, + + /// Set Scan mode Command + GAPM_START_SCAN_CMD, + /// Advertising or scanning report information event + GAPM_ADV_REPORT_IND, + + /// Set connection initialization Command + GAPM_START_CONNECTION_CMD, + /// Name of peer device indication + GAPM_PEER_NAME_IND, + /// Confirm connection to a specific device (Connection Operation in Selective mode) + GAPM_CONNECTION_CFM, + + /* Privacy update events */ + /// Privacy flag value has been updated + GAPM_UPDATED_PRIVACY_IND, + /// Reconnection address has been updated + GAPM_UPDATED_RECON_ADDR_IND, + + /* Security / Encryption Toolbox */ + /// Resolve address command + GAPM_RESOLV_ADDR_CMD, + /// Indicate that resolvable random address has been solved + GAPM_ADDR_SOLVED_IND, + /// Generate a random address. + GAPM_GEN_RAND_ADDR_CMD, + /// Use the AES-128 block in the controller + GAPM_USE_ENC_BLOCK_CMD, + /// AES-128 block result indication + GAPM_USE_ENC_BLOCK_IND, + /// Generate a 8-byte random number + GAPM_GEN_RAND_NB_CMD, + /// Random Number Indication + GAPM_GEN_RAND_NB_IND, + + /* Debug */ + /// Indication containing information about memory usage. + GAPM_DBG_MEM_INFO_IND, + + /* Local device information -cont */ + /// Advertising channel Tx power level + GAPM_DEV_ADV_TX_POWER_IND, + + /* Internal messages for timer events, not part of API*/ + /// Limited discoverable timeout indication + GAPM_LIM_DISC_TO_IND, + /// Scan timeout indication + GAPM_SCAN_TO_IND, + /// Address renewal timeout indication + GAPM_ADDR_RENEW_TO_IND, +}; + +/// GAP Manager operation type - application interface +enum gapm_operation +{ + /* No Operation (if nothing has been requested) */ + /* ************************************************ */ + /// No operation. + GAPM_NO_OP = 0x00, + + /* Default operations */ + /* ************************************************ */ + /// Reset BLE subsystem: LL and HL. + GAPM_RESET, + /// Cancel currently executed operation. + GAPM_CANCEL, + + /* Configuration operations */ + /* ************************************************ */ + /// Set device configuration + GAPM_SET_DEV_CONFIG, + /// Set device name + GAPM_SET_DEV_NAME, + /// Set device channel map + GAPM_SET_CHANNEL_MAP, + + /* Retrieve device information */ + /* ************************************************ */ + /// Get Local device name + GAPM_GET_DEV_NAME, + /// Get Local device version + GAPM_GET_DEV_VERSION, + /// Get Local device BD Address + GAPM_GET_DEV_BDADDR, + + /* Operation on White list */ + /* ************************************************ */ + /// Get White List Size. + GAPM_GET_WLIST_SIZE, + /// Add devices in white list. + GAPM_ADD_DEV_IN_WLIST, + /// Remove devices form white list. + GAPM_RMV_DEV_FRM_WLIST, + /// Clear all devices from white list. + GAPM_CLEAR_WLIST, + + /* Advertise mode operations */ + /* ************************************************ */ + /// Start non connectable advertising + GAPM_ADV_NON_CONN, + /// Start undirected connectable advertising + GAPM_ADV_UNDIRECT, + /// Start directed connectable advertising + GAPM_ADV_DIRECT, + + /* Scan mode operations */ + /* ************************************************ */ + /// Start active scan operation + GAPM_SCAN_ACTIVE, + /// Start passive scan operation + GAPM_SCAN_PASSIVE, + + /* Connection mode operations */ + /* ************************************************ */ + /// Direct connection operation + GAPM_CONNECTION_DIRECT, + /// Automatic connection operation + GAPM_CONNECTION_AUTO, + /// Selective connection operation + GAPM_CONNECTION_SELECTIVE, + /// Name Request operation (requires to start a direct connection) + GAPM_CONNECTION_NAME_REQUEST, + + /* Security / Encryption Toolbox */ + /* ************************************************ */ + /// Resolve device address + GAPM_RESOLV_ADDR, + /// Generate a random address + GAPM_GEN_RAND_ADDR, + /// Use the controller's AES-128 block + GAPM_USE_ENC_BLOCK, + /// Generate a 8-byte random number + GAPM_GEN_RAND_NB, + + /* DEBUG */ + /* ************************************************ */ + /// Get memory usage + GAPM_DBG_GET_MEM_INFO, + /// Perform a platform reset + GAPM_PLF_RESET, + + /* Retrieve device information - cont */ + /* ************************************************ */ + /// Get device advertising power level + GAPM_GET_DEV_ADV_TX_POWER, + + /// Last GAPM operation flag + GAPM_LAST +}; + +}//namespace + +#endif//GAPM_TASK_H