BLE fota Lamp Demo

Dependencies:   mbed-rtos mbed mbed_fota_fan_control

Fork of mbed_fota_fan_control by KIM HyoengJun

ext_fota/SerialManager.h

Committer:
dudnwjs
Date:
2015-07-17
Revision:
6:8dd20294b2aa
Parent:
5:e11b23f9aacc
Child:
9:fcf91f563147

File content as of revision 6:8dd20294b2aa:

#ifndef SERIALMANAGER_H
#define SERIALMANAGER_H

#include "mbed.h"

namespace sevencore_fota{
    
class SerialManager
{
public:
    SerialManager(Serial *_device);
    SerialManager(Serial *_device,Serial *_hostpc);
    ~SerialManager(void);
    int SendToSerial(uint8_t *data,unsigned short size);
    int ReceiveToSerial(unsigned char *receive_msg);
    void ReceiveToSerialTest(void);
    void DataReceive(uint8_t *databuf, unsigned short size);
    
private:
    void PrintSerialManager(void);
    
    bool print_flag;
    Serial *device;
    Serial *hostpc;
    uint8_t FE_MSG_PACKET_TYPE;
    int MAX_PACKET_LENGTH;
    unsigned char bReceiveState;
    unsigned short wDataLength;
    unsigned short wReceivePos;
    unsigned char bHdrBytesRead;
    unsigned char bReceiveElementArr[512];

};

}//namespace

#endif//SERIALMANAGER_H