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 KIM HyoengJun

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MsgQueue.h Source File

MsgQueue.h

Go to the documentation of this file.
00001 /**
00002  * @file MsgQueue.h
00003  * @brief Ble message queue 
00004  * Copyright 2015 SEVENCORE Co., Ltd.
00005  *
00006  * @author HyeongJun Kim 
00007  * @version 1.0.0  
00008  * @date 2015-08-19
00009 */
00010 
00011 #ifndef MSGQUEUE_H
00012 #define MSGQUEUE_H
00013 /**
00014  ****************************************************************************************
00015  * @addtogroup ext_fota module
00016  * @brief Ble message Queue Class Header.
00017  *
00018  * @{
00019  ****************************************************************************************
00020  */
00021 namespace sevencore_fota{    
00022 
00023 struct Element
00024 {
00025     void *Data;
00026     struct Element *Next;
00027 };
00028 
00029 class MsgQueue
00030 {
00031 public:
00032     /**
00033      ****************************************************************************************
00034      * @brief Ble message queue constructor
00035      ****************************************************************************************
00036      */   
00037     MsgQueue(int MaxSize = 512);
00038     /**
00039      ****************************************************************************************
00040      * @brief Ble message queue destructor
00041      ****************************************************************************************
00042      */
00043     ~MsgQueue(void);
00044     /**
00045      ****************************************************************************************
00046      * @brief Add message in queue
00047      ****************************************************************************************
00048      */
00049     void EnQueue(void *vData);
00050     /**
00051      ****************************************************************************************
00052      * @brief Remove message in queue
00053      ****************************************************************************************
00054      */
00055     void *DeQueue(void);
00056     /**
00057      ****************************************************************************************
00058      * @brief Return queue element count
00059      ****************************************************************************************
00060      */
00061     int GetElementCount(void);
00062     /**
00063      ****************************************************************************************
00064      * @brief Boolean that queue is empty
00065      ****************************************************************************************
00066      */
00067     bool IsEmpty(void);
00068 
00069 private:
00070     Element *Front;
00071     Element *Rear;
00072     const int MaxNum;
00073     int ElemCnt;
00074    
00075 };
00076 
00077 }//namespace
00078 
00079 /// @} ext_fota module
00080 
00081 #endif //MSG_QUEUE_H
00082