mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
add libduckbox
Origin commit data
------------------
Branch: master
Commit: 4dc1171253
Author: max_10 <max_10@gmx.de>
Date: 2014-04-27 (Sun, 27 Apr 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
17
libdvbci/Makefile.am
Normal file
17
libdvbci/Makefile.am
Normal file
@@ -0,0 +1,17 @@
|
||||
noinst_LTLIBRARIES = libdvbci.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = -lpthread
|
||||
|
||||
libdvbci_la_SOURCES = \
|
||||
dvbci_session.cpp \
|
||||
dvbci_mmi.cpp \
|
||||
dvbci_camgr.cpp \
|
||||
dvbci_appmgr.cpp \
|
||||
dvbci_datetimemgr.cpp \
|
||||
dvbci_resmgr.cpp
|
||||
|
632
libdvbci/Makefile.in
Normal file
632
libdvbci/Makefile.in
Normal file
@@ -0,0 +1,632 @@
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = libdvbci
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libdvbci_la_LIBADD =
|
||||
am_libdvbci_la_OBJECTS = dvbci_session.lo dvbci_mmi.lo dvbci_camgr.lo \
|
||||
dvbci_appmgr.lo dvbci_datetimemgr.lo dvbci_resmgr.lo
|
||||
libdvbci_la_OBJECTS = $(am_libdvbci_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_CXX = $(am__v_CXX_@AM_V@)
|
||||
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
|
||||
am__v_CXX_0 = @echo " CXX " $@;
|
||||
am__v_CXX_1 =
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
|
||||
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
|
||||
am__v_CXXLD_0 = @echo " CXXLD " $@;
|
||||
am__v_CXXLD_1 =
|
||||
SOURCES = $(libdvbci_la_SOURCES)
|
||||
DIST_SOURCES = $(libdvbci_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AVCODEC_CFLAGS = @AVCODEC_CFLAGS@
|
||||
AVCODEC_LIBS = @AVCODEC_LIBS@
|
||||
AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@
|
||||
AVFORMAT_LIBS = @AVFORMAT_LIBS@
|
||||
AVUTIL_CFLAGS = @AVUTIL_CFLAGS@
|
||||
AVUTIL_LIBS = @AVUTIL_LIBS@
|
||||
AWK = @AWK@
|
||||
BOXMODEL = @BOXMODEL@
|
||||
BOXTYPE = @BOXTYPE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIGDIR = @CONFIGDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIR = @DATADIR@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
|
||||
DIRECTFB_LIBS = @DIRECTFB_LIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FONTDIR = @FONTDIR@
|
||||
GAMESDIR = @GAMESDIR@
|
||||
GREP = @GREP@
|
||||
GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
|
||||
GSTREAMER_INTERFACES_CFLAGS = @GSTREAMER_INTERFACES_CFLAGS@
|
||||
GSTREAMER_INTERFACES_LIBS = @GSTREAMER_INTERFACES_LIBS@
|
||||
GSTREAMER_LIBS = @GSTREAMER_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PLUGINDIR = @PLUGINDIR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
SWRESAMPLE_CFLAGS = @SWRESAMPLE_CFLAGS@
|
||||
SWRESAMPLE_LIBS = @SWRESAMPLE_LIBS@
|
||||
SWSCALE_CFLAGS = @SWSCALE_CFLAGS@
|
||||
SWSCALE_LIBS = @SWSCALE_LIBS@
|
||||
TARGET_CONFIGDIR = @TARGET_CONFIGDIR@
|
||||
TARGET_DATADIR = @TARGET_DATADIR@
|
||||
TARGET_FONTDIR = @TARGET_FONTDIR@
|
||||
TARGET_GAMESDIR = @TARGET_GAMESDIR@
|
||||
TARGET_LIBDIR = @TARGET_LIBDIR@
|
||||
TARGET_PLUGINDIR = @TARGET_PLUGINDIR@
|
||||
TARGET_THEMESDIR = @TARGET_THEMESDIR@
|
||||
TARGET_UCODEDIR = @TARGET_UCODEDIR@
|
||||
THEMESDIR = @THEMESDIR@
|
||||
UCODEDIR = @UCODEDIR@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
noinst_LTLIBRARIES = libdvbci.la
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/common \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
AM_LDFLAGS = -lpthread
|
||||
libdvbci_la_SOURCES = \
|
||||
dvbci_session.cpp \
|
||||
dvbci_mmi.cpp \
|
||||
dvbci_camgr.cpp \
|
||||
dvbci_appmgr.cpp \
|
||||
dvbci_datetimemgr.cpp \
|
||||
dvbci_resmgr.cpp
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdvbci/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign libdvbci/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libdvbci.la: $(libdvbci_la_OBJECTS) $(libdvbci_la_DEPENDENCIES) $(EXTRA_libdvbci_la_DEPENDENCIES)
|
||||
$(AM_V_CXXLD)$(CXXLINK) $(libdvbci_la_OBJECTS) $(libdvbci_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_appmgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_camgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_datetimemgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_mmi.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_resmgr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvbci_session.Plo@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
104
libdvbci/dvbci_appmgr.cpp
Normal file
104
libdvbci/dvbci_appmgr.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
/* DVB CI Application Manager */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dvbci_appmgr.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_appmgr]";
|
||||
|
||||
eDVBCIApplicationManagerSession::eDVBCIApplicationManagerSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
slot->hasAppManager = true;
|
||||
slot->appSession = this;
|
||||
}
|
||||
|
||||
eDVBCIApplicationManagerSession::~eDVBCIApplicationManagerSession()
|
||||
{
|
||||
slot->hasAppManager = false;
|
||||
slot->appSession = NULL;
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x21:
|
||||
{
|
||||
int dl;
|
||||
printf("application info:\n");
|
||||
printf(" len: %d\n", len);
|
||||
printf(" application_type: %d\n", ((unsigned char*)data)[0]);
|
||||
printf(" application_manufacturer: %02x %02x\n", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
|
||||
printf(" manufacturer_code: %02x %02x\n", ((unsigned char*)data)[4], ((unsigned char*)data)[3]);
|
||||
printf(" menu string: \n");
|
||||
dl = ((unsigned char*)data)[5];
|
||||
if ((dl + 6) > len)
|
||||
{
|
||||
printf("warning, invalid length (%d vs %d)\n", dl + 6, len);
|
||||
dl = len - 6;
|
||||
}
|
||||
char str[dl + 1];
|
||||
memcpy(str, ((char*)data) + 6, dl);
|
||||
str[dl] = '\0';
|
||||
for (int i = 0; i < dl; ++i)
|
||||
printf("%c", ((unsigned char*)data)[i + 6]);
|
||||
printf("\n");
|
||||
|
||||
strcpy(slot->name, str);
|
||||
printf("%s set cam name %s on slot %d, %p\n", FILENAME, slot->name, slot->slot, slot);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("%s unknown APDU tag 9F 80 %02x\n", FILENAME, tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x20};
|
||||
sendAPDU(tag);
|
||||
state = stateFinal;
|
||||
return 1;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("in final state.");
|
||||
wantmenu = 0;
|
||||
if (wantmenu)
|
||||
{
|
||||
printf("%s wantmenu: sending Tenter_menu\n", FILENAME);
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x22};
|
||||
sendAPDU(tag);
|
||||
wantmenu = 0;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCIApplicationManagerSession::startMMI()
|
||||
{
|
||||
printf("%s -> %s\n", FILENAME, __func__);
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x22};
|
||||
sendAPDU(tag);
|
||||
slot->mmiOpened = true;
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_appmgr.h
Normal file
24
libdvbci/dvbci_appmgr.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_appmgr_h
|
||||
#define __dvbci_dvbci_appmgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIApplicationManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate
|
||||
};
|
||||
|
||||
tSlot *slot;
|
||||
|
||||
int wantmenu;
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCIApplicationManagerSession(tSlot *tslot);
|
||||
~eDVBCIApplicationManagerSession();
|
||||
int enterMenu();
|
||||
int startMMI();
|
||||
};
|
||||
|
||||
#endif
|
81
libdvbci/dvbci_camgr.cpp
Normal file
81
libdvbci/dvbci_camgr.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
/* DVB CI CA Manager */
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "dvbci_camgr.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
eDVBCICAManagerSession::eDVBCICAManagerSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
}
|
||||
|
||||
eDVBCICAManagerSession::~eDVBCICAManagerSession()
|
||||
{
|
||||
slot->hasCAManager = false;
|
||||
slot->camgrSession = NULL;
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/CA %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x31:
|
||||
{
|
||||
printf("ca info:\n");
|
||||
for (int i = 0; i < len; i += 2)
|
||||
{
|
||||
printf("%04x ", (((const unsigned char*)data)[i] << 8) | (((const unsigned char*)data)[i + 1]));
|
||||
caids.push_back((((const unsigned char*)data)[i] << 8) | (((const unsigned char*)data)[i + 1]));
|
||||
}
|
||||
sort(caids.begin(), caids.end());
|
||||
printf("\n");
|
||||
|
||||
slot->pollConnection = false;
|
||||
slot->hasCAManager = true;
|
||||
slot->camgrSession = this;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("unknown APDU tag 9F 80 %02x\n", tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x30}; // ca info enq
|
||||
sendAPDU(tag);
|
||||
state = stateFinal;
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCICAManagerSession::sendCAPMT(unsigned char *data, int len)
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x32}; // ca_pmt
|
||||
|
||||
sendAPDU(tag, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_camgr.h
Normal file
24
libdvbci/dvbci_camgr.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_camgr_h
|
||||
#define __dvbci_dvbci_camgr_h
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCICAManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate
|
||||
};
|
||||
std::vector<uint16_t> caids;
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCICAManagerSession(tSlot *tslot);
|
||||
~eDVBCICAManagerSession();
|
||||
|
||||
const std::vector<uint16_t> &getCAIDs() const { return caids; }
|
||||
int sendCAPMT(unsigned char *pmt, int len);
|
||||
};
|
||||
|
||||
#endif
|
59
libdvbci/dvbci_datetimemgr.cpp
Normal file
59
libdvbci/dvbci_datetimemgr.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
/* DVB CI DateTime Manager */
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dvbci_datetimemgr.h"
|
||||
|
||||
eDVBCIDateTimeSession::eDVBCIDateTimeSession(tSlot *tslot)
|
||||
{
|
||||
slot = tslot;
|
||||
slot->hasDateTime = true;
|
||||
slot->pollConnection = true;
|
||||
}
|
||||
|
||||
eDVBCIDateTimeSession::~eDVBCIDateTimeSession()
|
||||
{
|
||||
slot->hasDateTime = false;
|
||||
}
|
||||
|
||||
int eDVBCIDateTimeSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/DATETIME %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x84))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x40:
|
||||
state = stateSendDateTime;
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
printf("unknown APDU tag 9F 84 %02x\n", tag[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIDateTimeSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
return 0;
|
||||
case stateSendDateTime:
|
||||
{
|
||||
unsigned char tag[3] = {0x9f, 0x84, 0x41}; // date_time_response
|
||||
unsigned char msg[7] = {0, 0, 0, 0, 0, 0, 0};
|
||||
sendAPDU(tag, msg, 7);
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
18
libdvbci/dvbci_datetimemgr.h
Normal file
18
libdvbci/dvbci_datetimemgr.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef __dvbci_dvbci_datetimemgr_h
|
||||
#define __dvbci_dvbci_datetimemgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIDateTimeSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFinal=statePrivate, stateSendDateTime
|
||||
};
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
eDVBCIDateTimeSession(tSlot *tslot);
|
||||
~eDVBCIDateTimeSession();
|
||||
};
|
||||
|
||||
#endif
|
282
libdvbci/dvbci_mmi.cpp
Normal file
282
libdvbci/dvbci_mmi.cpp
Normal file
@@ -0,0 +1,282 @@
|
||||
/* DVB CI MMI */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dvbci_mmi.h"
|
||||
#include <ca_cs.h>
|
||||
|
||||
static const char * FILENAME = "[dvbci_mmi]";
|
||||
|
||||
eDVBCIMMISession::eDVBCIMMISession(tSlot *tslot)
|
||||
{
|
||||
printf("%s:%s\n", FILENAME, __func__);
|
||||
slot = tslot;
|
||||
slot->hasMMIManager = true;
|
||||
slot->mmiSession = this;
|
||||
}
|
||||
|
||||
eDVBCIMMISession::~eDVBCIMMISession()
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_CLOSE;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
|
||||
slot->hasMMIManager = false;
|
||||
slot->mmiSession = NULL;
|
||||
slot->mmiOpened = false;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x88))
|
||||
{
|
||||
/* from e2 mmi_ui.cpp */
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x00: /* close */
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_CLOSE;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
break;
|
||||
case 0x01: /* display control */
|
||||
state = stateDisplayReply;
|
||||
return 1;
|
||||
break;
|
||||
case 0x07: /* menu enq */
|
||||
{
|
||||
MMI_ENQUIRY_INFO* enquiry = (MMI_ENQUIRY_INFO*) malloc(sizeof(MMI_ENQUIRY_INFO));
|
||||
memset(enquiry, 0, sizeof(MMI_ENQUIRY_INFO));
|
||||
unsigned char *d = (unsigned char*)data;
|
||||
unsigned char *max = ((unsigned char*)d) + len;
|
||||
|
||||
int textlen = len - 2;
|
||||
if ((d + 2) > max)
|
||||
break;
|
||||
|
||||
int blind = *d++ & 1;
|
||||
int alen = *d++;
|
||||
printf("%d bytes text\n", textlen);
|
||||
if ((d + textlen) > max)
|
||||
break;
|
||||
|
||||
char str[textlen + 1];
|
||||
memcpy(str, ((char*)d), textlen);
|
||||
str[textlen] = '\0';
|
||||
printf("enq-text: %s", str);
|
||||
enquiry->slot = slot->slot;
|
||||
enquiry->blind = blind;
|
||||
enquiry->answerlen = alen;
|
||||
strcpy(enquiry->enquiryText, str);
|
||||
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_REQ_INPUT;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)enquiry;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
|
||||
slot->mmiOpened = true;
|
||||
}
|
||||
break;
|
||||
case 0x09: /* menu last */
|
||||
case 0x0c: /* list last */
|
||||
{
|
||||
MMI_MENU_LIST_INFO* listInfo = (MMI_MENU_LIST_INFO*) malloc(sizeof(MMI_MENU_LIST_INFO));
|
||||
memset(listInfo, 0, sizeof(MMI_MENU_LIST_INFO));
|
||||
|
||||
listInfo->slot = slot->slot;
|
||||
listInfo->choice_nb = 0;
|
||||
|
||||
unsigned char *d = (unsigned char*)data;
|
||||
unsigned char *max = ((unsigned char*)d) + len;
|
||||
int pos = 0;
|
||||
|
||||
if (tag[2] == 0x09)
|
||||
printf("menu_last\n");
|
||||
else
|
||||
printf("list_last\n");
|
||||
|
||||
if (d > max)
|
||||
break;
|
||||
|
||||
int n = *d++;
|
||||
|
||||
if (n == 0xFF)
|
||||
n = 0;
|
||||
else
|
||||
n++;
|
||||
|
||||
for (int i = 0; i < (n + 3); ++i)
|
||||
{
|
||||
int textlen;
|
||||
if ((d + 3) > max)
|
||||
break;
|
||||
|
||||
printf("text tag: %02x %02x %02x\n", d[0], d[1], d[2]);
|
||||
d += 3;
|
||||
d += eDVBCISession::parseLengthField(d, textlen);
|
||||
|
||||
printf("%d bytes text", textlen);
|
||||
if ((d + textlen) > max)
|
||||
break;
|
||||
|
||||
char str[textlen + 1];
|
||||
memcpy(str, ((char*)d), textlen);
|
||||
str[textlen] = '\0';
|
||||
|
||||
int type = pos++;
|
||||
|
||||
if (type == 0) /* title */
|
||||
strcpy(listInfo->title, str);
|
||||
else if (type == 1) /* subtitle */
|
||||
strcpy(listInfo->subtitle, str);
|
||||
else if (type == 2) /* bottom */
|
||||
strcpy(listInfo->bottom, str);
|
||||
else /* text */
|
||||
{
|
||||
strcpy(listInfo->choice_item[listInfo->choice_nb], str);
|
||||
listInfo->choice_nb++;
|
||||
printf("%d. %s\n", listInfo->choice_nb, listInfo->choice_item[listInfo->choice_nb - 1]);
|
||||
}
|
||||
while (textlen--)
|
||||
printf("%c", *d++);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (tag[2] == 0x09)
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_MENU;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)listInfo;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send a message to Neutrino cam_menu handler */
|
||||
CA_MESSAGE* pMsg = (CA_MESSAGE*) malloc(sizeof(CA_MESSAGE));
|
||||
memset(pMsg, 0, sizeof(CA_MESSAGE));
|
||||
|
||||
pMsg->MsgId = CA_MESSAGE_MSG_MMI_LIST;
|
||||
pMsg->SlotType = CA_SLOT_TYPE_CI;
|
||||
pMsg->Slot = slot->slot;
|
||||
pMsg->Flags = CA_MESSAGE_HAS_PARAM1_DATA;
|
||||
pMsg->Msg.Data[0] = (uint8_t*)listInfo;
|
||||
cCA::GetInstance()->SendMessage(pMsg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
state = stateIdle;
|
||||
break;
|
||||
case stateDisplayReply:
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x02};
|
||||
unsigned char data[] = {0x01, 0x01};
|
||||
sendAPDU(tag, data, 2);
|
||||
state = stateIdle;
|
||||
break;
|
||||
}
|
||||
case stateFakeOK:
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x0b};
|
||||
unsigned char data[] = {5};
|
||||
sendAPDU(tag, data, 1);
|
||||
state = stateIdle;
|
||||
break;
|
||||
}
|
||||
case stateIdle:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::stopMMI()
|
||||
{
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x00};
|
||||
unsigned char data[] = {0x00};
|
||||
sendAPDU(tag, data, 1);
|
||||
|
||||
slot->mmiOpened = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::answerText(int answer)
|
||||
{
|
||||
printf("eDVBCIMMISession::answerText(%d)\n", answer);
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x0B};
|
||||
unsigned char data[] = {0x00};
|
||||
data[0] = answer & 0xff;
|
||||
sendAPDU(tag, data, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::answerEnq(char * answer, int len)
|
||||
{
|
||||
printf("eDVBCIMMISession::answerEnq(%d bytes)\n", len);
|
||||
|
||||
unsigned char data[len + 1];
|
||||
data[0] = 0x01; // answer ok
|
||||
memcpy(data + 1, answer, len);
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x08};
|
||||
sendAPDU(tag, data, len + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIMMISession::cancelEnq()
|
||||
{
|
||||
printf("eDVBCIMMISession::cancelEnq()\n");
|
||||
|
||||
unsigned char tag[] = {0x9f, 0x88, 0x08};
|
||||
unsigned char data[] = {0x00}; // canceled
|
||||
sendAPDU(tag, data, 1);
|
||||
slot->mmiOpened = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
24
libdvbci/dvbci_mmi.h
Normal file
24
libdvbci/dvbci_mmi.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __dvbci_dvbci_mmi_h
|
||||
#define __dvbci_dvbci_mmi_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIMMISession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateDisplayReply=statePrivate, stateFakeOK, stateIdle
|
||||
};
|
||||
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
tSlot *slot;
|
||||
public:
|
||||
eDVBCIMMISession(tSlot *tslot);
|
||||
~eDVBCIMMISession();
|
||||
int stopMMI();
|
||||
int answerText(int answer);
|
||||
int answerEnq(char *answer, int len);
|
||||
int cancelEnq();
|
||||
};
|
||||
|
||||
#endif
|
91
libdvbci/dvbci_resmgr.cpp
Normal file
91
libdvbci/dvbci_resmgr.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/* DVB CI Resource Manager */
|
||||
#include <stdio.h>
|
||||
#include "dvbci_resmgr.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_resmgr]";
|
||||
|
||||
int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
printf("SESSION(%d) %02x %02x %02x (len = %d): \n", session_nb, tag[0], tag[1], tag[2], len);
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
if ((tag[0] == 0x9f) && (tag[1] == 0x80))
|
||||
{
|
||||
switch (tag[2])
|
||||
{
|
||||
case 0x10: // profile enquiry
|
||||
printf("cam fragt was ich kann.");
|
||||
state = stateProfileEnquiry;
|
||||
return 1;
|
||||
break;
|
||||
case 0x11: // Tprofile
|
||||
printf("mein cam kann: ");
|
||||
if (!len)
|
||||
printf("nichts\n");
|
||||
else
|
||||
for (int i = 0; i < len; i++)
|
||||
printf("%02x ", ((const unsigned char*)data)[i]);
|
||||
printf("\n");
|
||||
|
||||
if (state == stateFirstProfileEnquiry)
|
||||
{
|
||||
// profile change
|
||||
return 1;
|
||||
}
|
||||
state = stateFinal;
|
||||
break;
|
||||
default:
|
||||
printf("%s %s unknown APDU tag 9F 80 %02x\n", tag[2], FILENAME, __FUNCTION__);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eDVBCIResourceManagerSession::doAction()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case stateStarted:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x10}; // profile enquiry
|
||||
sendAPDU(tag);
|
||||
state = stateFirstProfileEnquiry;
|
||||
return 0;
|
||||
}
|
||||
case stateFirstProfileEnquiry:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x12}; // profile change
|
||||
sendAPDU(tag);
|
||||
state = stateProfileChange;
|
||||
return 0;
|
||||
}
|
||||
case stateProfileChange:
|
||||
{
|
||||
printf("bla kaputt\n");
|
||||
break;
|
||||
}
|
||||
case stateProfileEnquiry:
|
||||
{
|
||||
const unsigned char tag[3] = {0x9F, 0x80, 0x11};
|
||||
const unsigned char data[][4] =
|
||||
{
|
||||
{0x00, 0x01, 0x00, 0x41},
|
||||
{0x00, 0x02, 0x00, 0x41},
|
||||
{0x00, 0x03, 0x00, 0x41},
|
||||
// {0x00, 0x20, 0x00, 0x41}, // host control
|
||||
{0x00, 0x40, 0x00, 0x41},
|
||||
{0x00, 0x24, 0x00, 0x41}
|
||||
// {0x00, 0x10, 0x00, 0x41} // auth.
|
||||
};
|
||||
sendAPDU(tag, data, sizeof(data));
|
||||
state = stateFinal;
|
||||
return 0;
|
||||
}
|
||||
case stateFinal:
|
||||
printf("stateFinal und action! kann doch garnicht sein ;)\n");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
20
libdvbci/dvbci_resmgr.h
Normal file
20
libdvbci/dvbci_resmgr.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __dvbci_dvbci_resmgr_h
|
||||
#define __dvbci_dvbci_resmgr_h
|
||||
|
||||
#include "dvbci_session.h"
|
||||
|
||||
class eDVBCIResourceManagerSession: public eDVBCISession
|
||||
{
|
||||
enum {
|
||||
stateFirstProfileEnquiry=statePrivate,
|
||||
stateProfileChange,
|
||||
stateProfileEnquiry,
|
||||
stateFinal
|
||||
};
|
||||
int receivedAPDU(const unsigned char *tag, const void *data, int len);
|
||||
int doAction();
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
348
libdvbci/dvbci_session.cpp
Normal file
348
libdvbci/dvbci_session.cpp
Normal file
@@ -0,0 +1,348 @@
|
||||
/* DVB CI Transport Connection */
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "dvbci_session.h"
|
||||
#include "dvbci_resmgr.h"
|
||||
#include "dvbci_appmgr.h"
|
||||
#include "dvbci_camgr.h"
|
||||
#include "dvbci_datetimemgr.h"
|
||||
#include "dvbci_mmi.h"
|
||||
|
||||
static const char * FILENAME = "[dvbci_session]";
|
||||
|
||||
eDVBCISession* eDVBCISession::sessions[SLMS];
|
||||
|
||||
int eDVBCISession::buildLengthField(unsigned char *pkt, int len)
|
||||
{
|
||||
if (len < 127)
|
||||
{
|
||||
*pkt++ = len;
|
||||
return 1;
|
||||
}
|
||||
else if (len < 256)
|
||||
{
|
||||
*pkt++ = 0x81;
|
||||
*pkt++ = len;
|
||||
return 2;
|
||||
}
|
||||
else if (len < 65535)
|
||||
{
|
||||
*pkt++ = 0x82;
|
||||
*pkt++ = len >> 8;
|
||||
*pkt++ = len;
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("too big length\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
int eDVBCISession::parseLengthField(const unsigned char *pkt, int &len)
|
||||
{
|
||||
len = 0;
|
||||
if (!(*pkt & 0x80))
|
||||
{
|
||||
len = *pkt;
|
||||
return 1;
|
||||
}
|
||||
for (int i = 0; i < (pkt[0] & 0x7F); ++i)
|
||||
{
|
||||
len <<= 8;
|
||||
len |= pkt[i + 1];
|
||||
}
|
||||
return (pkt[0] & 0x7F) + 1;
|
||||
}
|
||||
|
||||
void eDVBCISession::sendAPDU(const unsigned char *tag, const void *data, int len)
|
||||
{
|
||||
unsigned char pkt[len + 3 + 4];
|
||||
int l;
|
||||
memcpy(pkt, tag, 3);
|
||||
l = buildLengthField(pkt + 3, len);
|
||||
if (data)
|
||||
memcpy(pkt + 3 + l, data, len);
|
||||
sendSPDU(0x90, 0, 0, pkt, len + 3 + l);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendSPDU(unsigned char tag, const void *data, int len, const void *apdu, int alen)
|
||||
{
|
||||
sendSPDU(slot, tag, data, len, session_nb, apdu, alen);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendSPDU(tSlot *slot, unsigned char tag, const void *data, int len, unsigned short session_nb, const void *apdu, int alen)
|
||||
{
|
||||
unsigned char pkt[4096];
|
||||
unsigned char *ptr = pkt;
|
||||
|
||||
*ptr++ = tag;
|
||||
ptr += buildLengthField(ptr, len + 2);
|
||||
if (data)
|
||||
memcpy(ptr, data, len);
|
||||
ptr += len;
|
||||
*ptr++ = session_nb >> 8;
|
||||
*ptr++ = session_nb;
|
||||
|
||||
if (apdu)
|
||||
memcpy(ptr, apdu, alen);
|
||||
ptr += alen;
|
||||
sendData(slot, pkt, ptr - pkt);
|
||||
}
|
||||
|
||||
void eDVBCISession::sendOpenSessionResponse(tSlot *slot, unsigned char session_status, const unsigned char *resource_identifier, unsigned short session_nb)
|
||||
{
|
||||
char pkt[6];
|
||||
pkt[0] = session_status;
|
||||
memcpy(pkt + 1, resource_identifier, 4);
|
||||
sendSPDU(slot, 0x92, pkt, 5, session_nb);
|
||||
}
|
||||
|
||||
void eDVBCISession::recvCreateSessionResponse(const unsigned char *data)
|
||||
{
|
||||
status = data[0];
|
||||
state = stateStarted;
|
||||
action = 1;
|
||||
printf("create Session Response, status %x\n", status);
|
||||
}
|
||||
|
||||
void eDVBCISession::recvCloseSessionRequest(const unsigned char *data)
|
||||
{
|
||||
state = stateInDeletion;
|
||||
action = 1;
|
||||
printf("close Session Request\n");
|
||||
}
|
||||
|
||||
void eDVBCISession::deleteSessions(const tSlot *slot)
|
||||
{
|
||||
for (unsigned short session_nb = 0; session_nb < SLMS; ++session_nb)
|
||||
{
|
||||
if (sessions[session_nb] && sessions[session_nb]->slot == slot)
|
||||
sessions[session_nb] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
eDVBCISession* eDVBCISession::createSession(tSlot *slot, const unsigned char *resource_identifier, unsigned char &status)
|
||||
{
|
||||
unsigned long tag;
|
||||
unsigned short session_nb;
|
||||
|
||||
for (session_nb = 1; session_nb < SLMS; ++session_nb)
|
||||
if (!sessions[session_nb - 1])
|
||||
break;
|
||||
|
||||
printf("use session_nb = %d\n", session_nb);
|
||||
if (session_nb == SLMS)
|
||||
{
|
||||
status = 0xF3;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tag = resource_identifier[0] << 24;
|
||||
tag |= resource_identifier[1] << 16;
|
||||
tag |= resource_identifier[2] << 8;
|
||||
tag |= resource_identifier[3];
|
||||
|
||||
printf("Tag: %08X\n", tag);
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case 0x00010041:
|
||||
sessions[session_nb - 1] = new eDVBCIResourceManagerSession;
|
||||
printf("RESOURCE MANAGER\n");
|
||||
break;
|
||||
case 0x00020041:
|
||||
sessions[session_nb - 1] = new eDVBCIApplicationManagerSession(slot);
|
||||
printf("APPLICATION MANAGER\n");
|
||||
break;
|
||||
case 0x00030041:
|
||||
sessions[session_nb - 1] = new eDVBCICAManagerSession(slot);
|
||||
printf("CA MANAGER\n");
|
||||
break;
|
||||
case 0x00240041:
|
||||
sessions[session_nb - 1] = new eDVBCIDateTimeSession(slot);
|
||||
printf("DATE-TIME\n");
|
||||
break;
|
||||
case 0x00400041:
|
||||
sessions[session_nb - 1] = new eDVBCIMMISession(slot);
|
||||
printf("MMI - create session\n");
|
||||
break;
|
||||
case 0x00100041:
|
||||
// session=new eDVBCIAuthSession;
|
||||
printf("AuthSession\n");
|
||||
// break;
|
||||
case 0x00200041:
|
||||
default:
|
||||
printf("unknown resource type %02x %02x %02x %02x\n", resource_identifier[0], resource_identifier[1], resource_identifier[2], resource_identifier[3]);
|
||||
sessions[session_nb - 1] = 0;
|
||||
status = 0xF0;
|
||||
}
|
||||
|
||||
if (!sessions[session_nb - 1])
|
||||
{
|
||||
printf("unknown session.. expect crash\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("new session nb %d %p\n", session_nb, sessions[session_nb - 1]);
|
||||
sessions[session_nb - 1]->session_nb = session_nb;
|
||||
|
||||
if (sessions[session_nb - 1])
|
||||
{
|
||||
sessions[session_nb - 1]->slot = slot;
|
||||
status = 0;
|
||||
}
|
||||
sessions[session_nb - 1]->state = stateInCreation;
|
||||
return sessions[session_nb - 1];
|
||||
}
|
||||
|
||||
void eDVBCISession::handleClose()
|
||||
{
|
||||
printf("%s %s\n", FILENAME, __FUNCTION__);
|
||||
|
||||
unsigned char data[1] = {0x00};
|
||||
sendSPDU(0x96, data, 1, 0, 0);
|
||||
}
|
||||
|
||||
int eDVBCISession::pollAll()
|
||||
{
|
||||
for (int session_nb = 1; session_nb < SLMS; ++session_nb)
|
||||
{
|
||||
if (sessions[session_nb - 1])
|
||||
{
|
||||
int r;
|
||||
if (sessions[session_nb - 1]->state == stateInDeletion)
|
||||
{
|
||||
sessions[session_nb - 1]->handleClose();
|
||||
sessions[session_nb - 1] = 0;
|
||||
r = 1;
|
||||
}
|
||||
else
|
||||
r = sessions[session_nb - 1]->poll();
|
||||
|
||||
if (r)
|
||||
{
|
||||
printf("%s <\n", __func__);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void eDVBCISession::receiveData(tSlot *slot, const unsigned char *ptr, size_t len)
|
||||
{
|
||||
printf("slot: %p\n", slot);
|
||||
|
||||
for(unsigned int i = 0; i < len; i++)
|
||||
printf("%02x ", ptr[i]);
|
||||
printf("\n");
|
||||
|
||||
if ((ptr[0] == 0x90 || ptr[0] == 0x95) && (ptr[3] == 0 ))
|
||||
{
|
||||
printf("****Mist: %02x %02x %02x %02x\n", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
}
|
||||
const unsigned char *pkt = (const unsigned char*)ptr;
|
||||
unsigned char tag = *pkt++;
|
||||
int llen, hlen;
|
||||
|
||||
|
||||
llen = parseLengthField(pkt, hlen);
|
||||
pkt += llen;
|
||||
|
||||
eDVBCISession* session = NULL;
|
||||
|
||||
if(tag == 0x91)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
session = createSession(slot, pkt, status);
|
||||
sendOpenSessionResponse(slot, status, pkt, session ? session->session_nb : 0);
|
||||
|
||||
if (session)
|
||||
{
|
||||
session->state = stateStarted;
|
||||
session->action = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned session_nb;
|
||||
printf("hlen = %d, %d, %d\n", hlen, pkt[hlen - 2], pkt[hlen - 1]);
|
||||
session_nb = pkt[hlen - 2] << 8;
|
||||
session_nb |= pkt[hlen - 1] & 0xFF;
|
||||
|
||||
if ((!session_nb) || (session_nb >= SLMS))
|
||||
{
|
||||
printf("PROTOCOL: illegal session number %x\n", session_nb);
|
||||
return;
|
||||
}
|
||||
|
||||
session = sessions[session_nb - 1];
|
||||
if (!session)
|
||||
{
|
||||
printf("PROTOCOL: data on closed session %x\n", session_nb);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case 0x90:
|
||||
break;
|
||||
case 0x94:
|
||||
session->recvCreateSessionResponse(pkt);
|
||||
break;
|
||||
case 0x95:
|
||||
session->recvCloseSessionRequest(pkt);
|
||||
break;
|
||||
default:
|
||||
printf("INTERNAL: nyi, tag %02x.\n", tag);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hlen += llen + 1; // lengthfield and tag
|
||||
|
||||
pkt = ((const unsigned char*)ptr) + hlen;
|
||||
len -= hlen;
|
||||
|
||||
if (session)
|
||||
{
|
||||
printf("len %d\n", len);
|
||||
while (len > 0)
|
||||
{
|
||||
int alen;
|
||||
const unsigned char *tag = pkt;
|
||||
pkt += 3; // tag
|
||||
len -= 3;
|
||||
hlen = parseLengthField(pkt, alen);
|
||||
pkt += hlen;
|
||||
len -= hlen;
|
||||
|
||||
printf("len = %d, hlen = %d, alen = %d\n", len, hlen, alen);
|
||||
|
||||
if (((len - alen) > 0) && ((len - alen) < 3))
|
||||
{
|
||||
printf("WORKAROUND: applying work around MagicAPDULength\n");
|
||||
alen = len;
|
||||
}
|
||||
|
||||
printf("1. Call receivedAPDU tag = 0x%2x, len = %d\n", (int) tag, alen);
|
||||
|
||||
if (session->receivedAPDU(tag, pkt, alen))
|
||||
session->action = 1;
|
||||
pkt += alen;
|
||||
len -= alen;
|
||||
}
|
||||
}
|
||||
if (len)
|
||||
printf("PROTOCOL: warning, TL-Data has invalid length\n");
|
||||
}
|
||||
|
||||
eDVBCISession::~eDVBCISession()
|
||||
{
|
||||
// printf("destroy %p", this);
|
||||
}
|
||||
|
46
libdvbci/dvbci_session.h
Normal file
46
libdvbci/dvbci_session.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef __dvbci_dvbci_tc_h
|
||||
#define __dvbci_dvbci_tc_h
|
||||
|
||||
#include <ca_ci.h>
|
||||
|
||||
#define SLMS 256
|
||||
|
||||
class eDVBCISession
|
||||
{
|
||||
static eDVBCISession* sessions[SLMS];
|
||||
static eDVBCISession* createSession(tSlot *slot, const unsigned char *resource_identifier, unsigned char &status);
|
||||
static void sendSPDU(tSlot *slot, unsigned char tag,const void *data, int len, unsigned short session_nb, const void *apdu = 0, int alen = 0);
|
||||
static void sendOpenSessionResponse(tSlot *slot,unsigned char session_status, const unsigned char *resource_identifier, unsigned short session_nb);
|
||||
void recvCreateSessionResponse(const unsigned char *data);
|
||||
void recvCloseSessionRequest(const unsigned char *data);
|
||||
protected:
|
||||
int state;
|
||||
int status;
|
||||
int action;
|
||||
tSlot *slot;
|
||||
unsigned short session_nb;
|
||||
virtual int receivedAPDU(const unsigned char *tag, const void *data, int len) = 0;
|
||||
void sendAPDU(const unsigned char *tag, const void *data=0,int len=0);
|
||||
virtual int doAction() = 0;
|
||||
void handleClose();
|
||||
public:
|
||||
virtual ~eDVBCISession();
|
||||
|
||||
static void deleteSessions(const tSlot *slot);
|
||||
void sendSPDU(unsigned char tag, const void *data, int len, const void *apdu = 0, int alen = 0);
|
||||
|
||||
int poll() { if (action) { action=doAction(); return 1; } return 0; }
|
||||
enum { stateInCreation, stateBusy, stateInDeletion, stateStarted, statePrivate};
|
||||
|
||||
static int parseLengthField(const unsigned char *pkt, int &len);
|
||||
static int buildLengthField(unsigned char *pkt, int len);
|
||||
|
||||
static void receiveData(tSlot *slot, const unsigned char *ptr, size_t len);
|
||||
|
||||
int getState() { return state; }
|
||||
int getStatus() { return status; }
|
||||
|
||||
static int pollAll();
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user