1 /*
2  * Copyright (C) 2017-2018 NXP Semiconductors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NCIPARSER_H_
18 #define NCIPARSER_H_
19 
20 #include "NCIDecoderProp.h"
21 #include "NCIDecoderStandard.h"
22 #include "NCIParserInterface.h"
23 #include "phOsal_Adaptation.h"
24 
25 #ifdef __cplusplus
26 extern "C" { /* Assume C declarations for C++ */
27 #endif       /* __cplusplus */
28 class NCI_Parser : public NCI_Parser_Interface {
29  private:
30   NCI_Parser();
31   volatile bool mTaskRunning;
32   static NCI_Parser* mpNciParser;
33   NCI_Decoder_Prop* mpNciPropDecoder = nullptr;
34   // NCI_Decoder_Standard *mpNciStandardDecoder;
35   void decodeNciPacket(psQueueData_t nciPacket);
36 
37  public:
38   ~NCI_Parser();
39   void initParser();
40   void deinitParser();
41   static NCI_Parser* getInstance();
42   static void resetInstance();
43   friend void* parsingTask(void*);
44   void parseNciPacket(unsigned char* pMsg, unsigned short len);
45 };
46 #ifdef __cplusplus
47 } /* Assume C declarations for C++ */
48 #endif /* __cplusplus */
49 
50 #endif /* NCIPARSER_H_ */
51