ATSC3  24.10.0
atsc_mw.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  *
4  * This file is part of a DTVKit Software Component
5  * You are permitted to copy, modify or distribute this file subject to the terms
6  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
7  *
8  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
10  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11  *
12  * If you or your organisation is not a member of DTVKit then you have access
13  * to this source code outside of the terms of the licence agreement
14  * and you are expected to delete this and any associated files immediately.
15  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
16  *******************************************************************************/
17 
18 #ifndef ATSC_MW_H
19 #define ATSC_MW_H
20 
21 #include <thread>
22 #include <iostream>
23 #include <list>
24 using namespace std;
25 #include <inttypes.h>
26 #include <stdio.h>
27 #include <sys/socket.h>
28 
29 #include <atsc_types.h>
30 
39 class CAtscMw{
40 public:
41 
42  std::thread *mServerThread=nullptr;
43  bool mRunning;
51  CAtscMw();
52 
59  ~CAtscMw();
60 
67  int32_t GetSupportedStandards(void);
68 
75  int32_t GetAvailNoOfFrontendInstances(void);
76 
83  eATSCResult_t SetRegion(eRegion_t iRegion);
84 
91  eRegion_t GetRegion(void);
92 
99  eATSCResult_t SetDemod(eDemod_t iDemod);
100 
107  eDemod_t GetDemod(void);
108 
116  eATSCResult_t TuneToChannel(int32_t iId,int32_t iCh,int32_t iPlp,
117  eDemod_t iDemod,eRegion_t iRegion);
118 
125  eATSCResult_t TuneToChannel( int32_t iId, int32_t iCh,int32_t iPlp);
126 
135  eATSCResult_t ScanChannels(int32_t iTunerId, int32_t iStartCh,
136  int32_t iEndCh, int32_t iDemod , int32_t iPlpId);
137 
145  eATSCResult_t ScanChannels(int32_t iId, int32_t iStartCh,
146  int32_t iEndCh,int32_t iPlp,
147  eDemod_t iDemod,eRegion_t iRegion);
154  eATSCResult_t StopChannelScan(int32_t iId);
155 
162  eATSCResult_t StartFrontend(int32_t iId);
163 
170  eATSCResult_t StopFrontend(int32_t iId);
171 
178  eATSCResult_t GetFrontendProps(int32_t iId,sFeProp_t *pParams);
179 
180 
187  eATSCResult_t GetFrontendStatus(int32_t iId,sFeStatus_t *pStatus);
188 
189 
196  eATSCResult_t RegisterFrontendStatusCbEvents(FeStatusCbFunc fstatus);
197 
204  eATSCResult_t RegisterFrontendParamCbEvents(FeParamsCbFunc ptrfunc);
205 
212  sServiceListTable_t GetSltData( void );
213 
220  std::string GetSystemTime( void );
221 
228  sRrtDataTable_t GetRrt( void );
229 
236  void RegisterOnsnMsgEventNotify(OnScreenNotify fParamsPtr);
237 
244  std::string GetMwGuideInfo(char *pUri);
245 
252  std::string GetMwTunerInfo(sFeStatus_t *pStatus,int32_t iTunerId);
253 
260  std::string GetMwTunersInfo( void );
261 
268  std::string GetQueryHttpResponse( std::string sContentData );
269 
276  std::string GetVersion(char *pFwVersion);
277 
284  std::string GetMwPrepareTunerInfo(void);
285 
292  std::string GetDumpHistory(void);
293 
300  std::string RequestService(std::string sUri, char *pContentData);
301 
308  std::string RequestDump(std::string sUri, int32_t iType);
309 
316  std::string RequestTuners(std::string sUri, char *pContentData );
317 
324  std::string RequestUserService(std::string sUri, char *pContentData );
325 
332  std::string RequestScan(std::string sUri, char *pContentData );
333 
340  std::list<sScanResult_t> GetScanningResult( void );
341 
348  void CancelChannelScan( void );
349 
356  int32_t Start(int32_t iPort);
357 
364  void ThreadServer(void *pArg, int32_t iPort);
365 
373  void Connection(int32_t iClientSock, struct sockaddr_in *pClientAddr, socklen_t stClientAddrLen);
374 
381  int32_t ParserHttpProtocol(eHttpType_t eHttpType, int32_t iSock, sHttpHeader_t stHttpHeader);
382 
389  std::string ParserHttpProtocolFromNative(int32_t iTunerId , int32_t iType ,int32_t iSock, sHttpHeader_t stHttpHeader);
390 
397  void Join(void);
398 
405  std::string GetFrontendConfiguration( void );
406 };
407 #endif /* ATSC_MW_H */
408 
eDemod_t
Definition: atsc_types.h:215
eHttpType_t
Definition: atsc_types.h:253
eRegion_t
Definition: atsc_types.h:227
eATSCResult_t
Definition: atsc_types.h:203
Definition: atsc_mw.h:39
bool mRunning
Definition: atsc_mw.h:43
Definition: atsc_types.h:338
Definition: atsc_types.h:302
Definition: atsc_types.h:448
Definition: atsc_types.h:507
Definition: atsc_types.h:651