From c50c2888ce23b4220ff3e8808ab80166fa08cb11 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 18 Jun 2012 11:13:33 +0200 Subject: [PATCH] move dummy cCA implementation to commmon/ directory --- Makefile.am | 3 +- common/Makefile.am | 1 + {libspark => common}/ca.cpp | 0 {libspark => common}/ca.h | 0 include/ca_cs.h | 9 +-- libspark/ca_cs.h | 1 - libtriple/ca.cpp | 110 ------------------------------------ libtriple/ca.h | 97 ------------------------------- libtriple/ca_cs.h | 1 - 9 files changed, 3 insertions(+), 219 deletions(-) rename {libspark => common}/ca.cpp (100%) rename {libspark => common}/ca.h (100%) delete mode 100644 libspark/ca_cs.h delete mode 100644 libtriple/ca.cpp delete mode 100644 libtriple/ca.h delete mode 100644 libtriple/ca_cs.h diff --git a/Makefile.am b/Makefile.am index a94453a..9d1d212 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,7 @@ SUBDIRS = common tools bin_PROGRAMS = libstb-hal-test libstb_hal_a_LIBADD = \ + common/ca.o \ common/lt_debug.o libstb_hal_test_SOURCES = libtest.cpp @@ -21,7 +22,6 @@ if BOXTYPE_TRIPLE SUBDIRS += libtriple libstb_hal_a_LIBADD += \ libtriple/audio_td.o \ - libtriple/ca.o \ libtriple/dmx_td.o \ libtriple/init_td.o \ libtriple/lt_dfbinput.o \ @@ -34,7 +34,6 @@ if BOXTYPE_SPARK SUBDIRS += libspark libeplayer3 libstb_hal_a_LIBADD += \ libspark/audio.o \ - libspark/ca.o \ libspark/dmx.o \ libspark/init.o \ libspark/irmp.o \ diff --git a/common/Makefile.am b/common/Makefile.am index 077bc81..3a89fe0 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -3,4 +3,5 @@ noinst_LIBRARIES = libcommon.a AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing libcommon_a_SOURCES = \ + ca.cpp \ lt_debug.cpp diff --git a/libspark/ca.cpp b/common/ca.cpp similarity index 100% rename from libspark/ca.cpp rename to common/ca.cpp diff --git a/libspark/ca.h b/common/ca.h similarity index 100% rename from libspark/ca.h rename to common/ca.h diff --git a/include/ca_cs.h b/include/ca_cs.h index b3e7e5c..f05f210 100644 --- a/include/ca_cs.h +++ b/include/ca_cs.h @@ -1,8 +1 @@ -#include -#if HAVE_TRIPLEDRAGON -#include "../libtriple/ca_cs.h" -#elif HAVE_SPARK_HARDWARE -#include "../libspark/ca_cs.h" -#else -#error neither HAVE_TRIPLEDRAGON nor HAVE_SPARK_HARDWARE defined -#endif +#include "../common/ca.h" diff --git a/libspark/ca_cs.h b/libspark/ca_cs.h deleted file mode 100644 index dae70d6..0000000 --- a/libspark/ca_cs.h +++ /dev/null @@ -1 +0,0 @@ -#include "ca.h" diff --git a/libtriple/ca.cpp b/libtriple/ca.cpp deleted file mode 100644 index f6ebea2..0000000 --- a/libtriple/ca.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include - -#include "ca.h" -#include "lt_debug.h" -#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_CA, this, args) - - -static cCA *inst = NULL; - -/* those are all dummies for now.. */ -cCA::cCA(void) -{ - lt_debug("%s\n", __FUNCTION__); -} - -cCA::~cCA() -{ - lt_debug("%s\n", __FUNCTION__); -} - -cCA *cCA::GetInstance() -{ - _lt_debug(TRIPLE_DEBUG_CA, NULL, "%s\n", __FUNCTION__); - if (inst == NULL) - inst = new cCA(); - - return inst; -} - -void cCA::MenuEnter(enum CA_SLOT_TYPE, uint32_t p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -void cCA::MenuAnswer(enum CA_SLOT_TYPE, uint32_t p, uint32_t /*choice*/) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -void cCA::InputAnswer(enum CA_SLOT_TYPE, uint32_t p, uint8_t * /*Data*/, int /*Len*/) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -void cCA::MenuClose(enum CA_SLOT_TYPE, uint32_t p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -uint32_t cCA::GetNumberCISlots(void) -{ - lt_debug("%s\n", __FUNCTION__); - return 0; -} - -uint32_t cCA::GetNumberSmartCardSlots(void) -{ - lt_debug("%s\n", __FUNCTION__); - return 0; -} - -void cCA::ModuleName(enum CA_SLOT_TYPE, uint32_t p, char * /*Name*/) -{ - /* TODO: waht to do with *Name? */ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -bool cCA::ModulePresent(enum CA_SLOT_TYPE, uint32_t p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); - return false; -} - -void cCA::ModuleReset(enum CA_SLOT_TYPE, uint32_t p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -bool cCA::SendPMT(int, unsigned char *, int, CA_SLOT_TYPE) -{ - lt_debug("%s\n", __FUNCTION__); - return true; -} - -bool cCA::SendMessage(const CA_MESSAGE *) -{ - lt_debug("%s\n", __FUNCTION__); - return true; -} - -bool cCA::Start(void) -{ - lt_debug("%s\n", __FUNCTION__); - return true; -} - -void cCA::Stop(void) -{ - lt_debug("%s\n", __FUNCTION__); -} - -void cCA::Ready(bool p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} - -void cCA::SetInitMask(enum CA_INIT_MASK p) -{ - lt_debug("%s param:%d\n", __FUNCTION__, (int)p); -} diff --git a/libtriple/ca.h b/libtriple/ca.h deleted file mode 100644 index 8a29e56..0000000 --- a/libtriple/ca.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * dummy functions to implement ca_cs.h interface - */ -#ifndef __CA_LIBTRIPLE_H_ -#define __CA_LIBTRIPLE_H_ - -#include -/* used in cam_menu.cpp */ -typedef uint32_t u32; - -enum CA_INIT_MASK { - CA_INIT_SC = 1, - CA_INIT_CI, - CA_INIT_BOTH -}; - -enum CA_SLOT_TYPE { - CA_SLOT_TYPE_SMARTCARD, - CA_SLOT_TYPE_CI, - CA_SLOT_TYPE_ALL, -}; - -enum CA_MESSAGE_FLAGS { - CA_MESSAGE_EMPTY = (1 << 0), - CA_MESSAGE_HAS_PARAM1_DATA = (1 << 1), // Free after use! - CA_MESSAGE_HAS_PARAM1_INT = (1 << 2), - CA_MESSAGE_HAS_PARAM1_PTR = (1 << 3), - CA_MESSAGE_HAS_PARAM2_INT = (1 << 4), - CA_MESSAGE_HAS_PARAM2_PTR = (1 << 5), - CA_MESSAGE_HAS_PARAM2_DATA = (1 << 6), - CA_MESSAGE_HAS_PARAM3_DATA = (1 << 7), // Free after use! - CA_MESSAGE_HAS_PARAM3_INT = (1 << 8), - CA_MESSAGE_HAS_PARAM3_PTR = (1 << 9), - CA_MESSAGE_HAS_PARAM4_INT = (1 << 10), - CA_MESSAGE_HAS_PARAM4_PTR = (1 << 11), - CA_MESSAGE_HAS_PARAM4_DATA = (1 << 12), - CA_MESSAGE_HAS_PARAM_LONG = (1 << 13), -}; - -enum CA_MESSAGE_MSGID { - CA_MESSAGE_MSG_INSERTED, - CA_MESSAGE_MSG_REMOVED, - CA_MESSAGE_MSG_INIT_OK, - CA_MESSAGE_MSG_INIT_FAILED, - CA_MESSAGE_MSG_MMI_MENU, - CA_MESSAGE_MSG_MMI_MENU_ENTER, - CA_MESSAGE_MSG_MMI_MENU_ANSWER, - CA_MESSAGE_MSG_MMI_LIST, - CA_MESSAGE_MSG_MMI_TEXT, - CA_MESSAGE_MSG_MMI_REQ_INPUT, - CA_MESSAGE_MSG_MMI_CLOSE, - CA_MESSAGE_MSG_INTERNAL, - CA_MESSAGE_MSG_PMT_ARRIVED, - CA_MESSAGE_MSG_CAT_ARRIVED, - CA_MESSAGE_MSG_ECM_ARRIVED, - CA_MESSAGE_MSG_EMM_ARRIVED, - CA_MESSAGE_MSG_CHANNEL_CHANGE, - CA_MESSAGE_MSG_EXIT, -}; - -typedef struct CA_MESSAGE { - uint32_t MsgId; - enum CA_SLOT_TYPE SlotType; - int Slot; - uint32_t Flags; - union { - uint8_t *Data[4]; - uint32_t Param[4]; - void *Ptr[4]; - uint64_t ParamLong; - } Msg; -} CA_MESSAGE; - -class cCA { -private: - cCA(void); -public: - uint32_t GetNumberCISlots(void); - uint32_t GetNumberSmartCardSlots(void); - static cCA *GetInstance(void); - bool SendPMT(int Unit, unsigned char *Data, int Len, CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL); - bool SendMessage(const CA_MESSAGE *Msg); - void SetInitMask(enum CA_INIT_MASK InitMask); - bool Start(void); - void Stop(void); - void Ready(bool Set); - void ModuleReset(enum CA_SLOT_TYPE, uint32_t Slot); - bool ModulePresent(enum CA_SLOT_TYPE, uint32_t Slot); - void ModuleName(enum CA_SLOT_TYPE, uint32_t Slot, char *Name); - void MenuEnter(enum CA_SLOT_TYPE, uint32_t Slot); - void MenuAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint32_t choice); - void InputAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint8_t * Data, int Len); - void MenuClose(enum CA_SLOT_TYPE, uint32_t Slot); - virtual ~cCA(); -}; - -#endif // __CA_LIBTRIPLE_H_ diff --git a/libtriple/ca_cs.h b/libtriple/ca_cs.h deleted file mode 100644 index dae70d6..0000000 --- a/libtriple/ca_cs.h +++ /dev/null @@ -1 +0,0 @@ -#include "ca.h"