@@ -63,7 +63,13 @@ struct dvb_desc {
} __attribute__((packed));
void dvb_desc_default_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_desc *desc);
+#ifdef __cplusplus
+extern "C" {
+#endif
void dvb_desc_default_print (struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc);
+#ifdef __cplusplus
+}
+#endif
#define dvb_desc_foreach( _desc, _tbl ) \
for( struct dvb_desc *_desc = _tbl->descriptor; _desc; _desc = _desc->next ) \
@@ -119,6 +119,8 @@ struct dvb_v5_fe_parms {
extern "C" {
#endif
+struct dvb_v5_fe_parms *dvb_fe_dummy();
+
struct dvb_v5_fe_parms *dvb_fe_open(int adapter, int frontend,
unsigned verbose, unsigned use_legacy_call);
struct dvb_v5_fe_parms *dvb_fe_open2(int adapter, int frontend,
@@ -69,6 +69,8 @@ void dvb_desc_default_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, st
void dvb_desc_default_print(struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
{
+ if (!parms)
+ parms = dvb_fe_dummy();
dvb_log("| %s (%#02x)", dvb_descriptors[desc->type].name, desc->type);
hexdump(parms, "| ", desc->data, desc->length);
}
@@ -35,6 +35,13 @@ static void dvb_v5_free(struct dvb_v5_fe_parms *parms)
free(parms);
}
+struct dvb_v5_fe_parms dummy_fe;
+struct dvb_v5_fe_parms *dvb_fe_dummy()
+{
+ dummy_fe.logfunc = dvb_default_log;
+ return &dummy_fe;
+}
+
struct dvb_v5_fe_parms *dvb_fe_open(int adapter, int frontend, unsigned verbose,
unsigned use_legacy_call)
{
The dvbv5 functions use the dvb_v5_fe_parms struct for logging. This struct is normally obtained by opening a dvb device. For situations where the opening of a dvb device is not desired, the dvb_fe_dummy can be used. Signed-off-by: André Roth <neolynx@gmail.com> --- lib/include/descriptors.h | 6 ++++++ lib/include/dvb-fe.h | 2 ++ lib/libdvbv5/descriptors.c | 2 ++ lib/libdvbv5/dvb-fe.c | 7 +++++++ 4 files changed, 17 insertions(+)