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: ext_fota/SerialManager.cpp
- Revision:
- 9:fcf91f563147
- Parent:
- 6:8dd20294b2aa
diff -r 9eec2c246a85 -r fcf91f563147 ext_fota/SerialManager.cpp --- a/ext_fota/SerialManager.cpp Thu Aug 20 05:16:55 2015 +0000 +++ b/ext_fota/SerialManager.cpp Mon Aug 24 02:29:16 2015 +0000 @@ -1,8 +1,29 @@ +/** + * @file SerialManager.cpp + * @brief Serial Communication Management + * Copyright 2015 SEVENCORE Co., Ltd. + * + * @author HyeongJun Kim + * @version 1.0.0 + * @date 2015-08-19 +*/ #include "SerialManager.h" - +/** + **************************************************************************************** + * @addtogroup ext_fota module + * @brief Serial Manager Class Method Definition. + * + * @{ + **************************************************************************************** + */ namespace sevencore_fota{ - +/** + **************************************************************************************** + * @brief Serial Manager constructor only connected Device. + * @param[in] mbed serial class reference to device. + **************************************************************************************** + */ SerialManager::SerialManager(Serial *_device) { print_flag = 0; @@ -15,7 +36,13 @@ bHdrBytesRead = 0; memset(bReceiveElementArr,0,512); } - +/** + **************************************************************************************** + * @brief Serial Manager constructor with connected Device & HostPC. + * @param[in] mbed serial class reference to device. + * @param[in] mbed serial class reference to hostpc. + **************************************************************************************** + */ SerialManager::SerialManager(Serial *_device, Serial *_hostpc) { print_flag = 1; @@ -30,17 +57,31 @@ memset(bReceiveElementArr,0,512); PrintSerialManager(); } - +/** + **************************************************************************************** + * @brief Serial Manager destructor. + **************************************************************************************** + */ SerialManager::~SerialManager(void) { } - +/** + **************************************************************************************** + * @brief Serial Manager Start title print function. + **************************************************************************************** + */ void SerialManager::PrintSerialManager(void) { if(print_flag == 1) hostpc->printf("\nSerialManager Start!!\n"); } - +/** + **************************************************************************************** + * @brief Send ble message to serial port. + * @param[in] Sending data pointer. + * @param[in] Sending data size. + **************************************************************************************** + */ int SerialManager::SendToSerial(uint8_t *data,unsigned short size) { int cnt = 0; @@ -59,8 +100,13 @@ } return cnt; } - -// return boolean : msg_size (receive complete) or -1 (receive not complete) +/** + **************************************************************************************** + * @brief Receive ble message from serial port. + * @param[in] Storing data pointer. + * @return Boolean - msg_size (receive complete) or -1 (receive not complete) + **************************************************************************************** + */ int SerialManager::ReceiveToSerial(unsigned char *receive_msg) { int ret = -1; @@ -158,7 +204,13 @@ return ret; } - +/** + **************************************************************************************** + * @brief Receive data for size. + * @param[in] Storing data pointer. + * @param[in] transmision data size. + **************************************************************************************** + */ void SerialManager::DataReceive(uint8_t *databuf, unsigned short size) { int i; @@ -168,7 +220,11 @@ databuf[i] = (uint8_t)device->getc(); } } - +/** + **************************************************************************************** + * @brief Receive data test function. + **************************************************************************************** + */ void SerialManager::ReceiveToSerialTest(void) { unsigned char tmp; @@ -213,3 +269,4 @@ } }//namespace +/// @} ext_fota module