You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
#ifndef __MEKOROT_KERNEL_HEADER__
|
|
#define __MEKOROT_KERNEL_HEADER__
|
|
|
|
#include "../../lib/components/base/basicLogCollection.h"
|
|
#include "../../lib/components/base/basicSettingsProvider.h"
|
|
#include "../../lib/components/base/basicEngine.h"
|
|
#include "../../lib/components/base/basicThread.h"
|
|
#include "../../lib/data/protocol/protocolLGS.h"
|
|
#include "../../lib/hardware/uart/serialPort.h"
|
|
|
|
#define MEKOROT_KRNL_SERIAL_LINE_TAG "SERIAL_LINE"
|
|
#define MEKOROT_KRNL_SERIAL_SPEED_TAG "SERIAL_SPEED"
|
|
#define MEKOROT_KRNL_DEVICE_0_ID_TAG "DEVICE_LEFT_ID"
|
|
#define MEKOROT_KRNL_DEVICE_1_ID_TAG "DEVICE_CENTER_ID"
|
|
#define MEKOROT_KRNL_DEVICE_2_ID_TAG "DEVICE_RIGHT_ID"
|
|
|
|
#define MEKOROT_KRNL_STG_INIT 0
|
|
#define MEKOROT_KRNL_STG_CONNECT 1
|
|
#define MEKOROT_KRNL_STG_PING_DEVICES 2
|
|
#define MEKOROT_KRNL_STG_WORKING 3
|
|
|
|
class mekorotKernel: public protocolLGS_CLIENT, public basicThread, basicEngine {
|
|
private:
|
|
basicLogCollection *m_pLog;
|
|
config_setting_t *m_pSettings;
|
|
serialPort *m_pSerial;
|
|
uint8_t m_bStage;
|
|
char m_pSerialDevice[128];
|
|
uint32_t m_nSerialSpeed;
|
|
int8_t m_bDeviceID[3];
|
|
uint32_t m_bDeviceTO[3];
|
|
bool m_bDeviceFlags[3];
|
|
protected:
|
|
void m_fThreadProc(void);
|
|
virtual bool packetHandler(protocolPackage* Package);
|
|
public:
|
|
explicit mekorotKernel( config_setting_t *ptr=NULL );
|
|
virtual ~mekorotKernel();
|
|
virtual bool init(void);
|
|
|
|
};
|
|
|
|
#endif
|