return SRD_OK;
}
-SRD_API int srd_register_callback(int output_type, srd_pd_output_callback_t cb)
+SRD_API int srd_register_callback(int output_type,
+ srd_pd_output_callback_t cb, void *data)
{
struct srd_pd_callback *pd_cb;
pd_cb->output_type = output_type;
pd_cb->callback = cb;
+ pd_cb->data = data;
callbacks = g_slist_append(callbacks, pd_cb);
return SRD_OK;
void *data;
};
+typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata,
+ void *data);
+
struct srd_pd_callback {
int output_type;
- void (*callback)(struct srd_proto_data *);
+ srd_pd_output_callback_t callback;
+ void *data;
};
/* custom python types */
SRD_API int srd_session_feed(uint64_t start_samplenum, uint8_t *inbuf,
uint64_t inbuflen);
SRD_API struct srd_decoder_inst *get_di_by_decobject(void *decobject);
-typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata);
-SRD_API int srd_register_callback(int output_type, srd_pd_output_callback_t cb);
+SRD_API int srd_register_callback(int output_type,
+ srd_pd_output_callback_t cb, void *data);
SRD_API void *srd_find_callback(int output_type);
/*--- decoder.c -------------------------------------------------------------*/