123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- #ifndef _PIPE_H_
- #define _PIPE_H_
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <stdint.h>
- #include "linux/msm_ipa.h"
- #include "Constants.h"
- #include "Logger.h"
- using namespace std;
- class Pipe
- {
- public:
-
- Pipe(enum ipa_client_type nClientType,
- IPATestConfiguration eConfiguration);
-
- Pipe(IPATestConfiguration eConfiguration);
- ~Pipe();
-
- bool Init();
-
- void Destroy();
-
- int AddHeaderAndSend(
- unsigned char *pBuffer,
- size_t nIPPacketSize);
-
- int Send(
- unsigned char *pBuffer,
- size_t nBytesToSend);
-
- int ReceiveAndRemoveHeader(
- unsigned char *pBuffer,
- size_t nIPPacketSize);
-
- int Receive(unsigned char *pBuffer, size_t nBytesToReceive);
-
- enum ipa_client_type GetClientType();
-
- int GetHeaderLengthAdd();
-
- int GetHeaderLengthRemove();
- bool EnableHolb(unsigned timerValue);
- bool DisableHolb();
- private:
- void SetSpecificClientParameters(
- enum ipa_client_type nClientType,
- IPATestConfiguration eConfiguration);
- bool ConfigureHolb(unsigned short enable, unsigned timerValue);
- public:
-
- static unsigned char m_pUsbHeader[];
- static unsigned char m_pHSICHeader[];
- static unsigned char m_pA2DUNHeader[];
- static unsigned char m_pA2NDUNHeader[];
- static unsigned char m_pQ6LANHeader[];
- private:
- int m_Fd;
-
- enum ipa_client_type m_nClientType;
- int m_nHeaderLengthRemove;
-
- int m_nHeaderLengthAdd;
-
- unsigned char *m_pHeader;
-
- const char *m_pInodePath;
-
- bool m_bInitialized;
- IPATestConfiguration m_eConfiguration;
-
- bool m_ExceptionPipe;
-
- };
- #endif
|