summaryrefslogtreecommitdiffstats
path: root/K2LABI/IPC/Ipc.h
blob: 1775ebf9a9db3d9b54beb32532c65b2d96aaa4fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once
#include "K2LIPC.h"
#include "SLock.h"

using namespace K2L::Automotive::IPC;

class CIpc : public IIpc
{
public:
    CIpc();
    virtual ~CIpc();

    int             Init(IIPCListener* pListener);
    int             Deinit();
    int             FormatRequest(BYTE channel, BYTE ifaceId, BYTE funId, DWORD dwSenderID, const BYTE *pData, DWORD dataLen, BYTE* pResult, int nResultLen, int* nResultLenNeeded);
    IIPCListener*   GetListener();
    void            OnPacket(CIpcPacket* pPacket);
    void            Decode(BYTE* pBuffer, DWORD nLen);
    IIPCListener*   CreateListener(FCT_OnMessageEvent callback, FCT_OnEvent error, FCT_OnEvent overflow);
    void            DestroyListener();

private:
    CIPCFlowDecoder* m_pFlowDecoder;
    BYTE*            m_pResultBuffer;
    int              m_nResultLen;
    int              m_errorCode;
    IIPCListener*    m_pIpcListener;
    CLock            m_lock;
};