Age | Commit message (Collapse) | Author |
|
|
|
All decoder class options are automatically copied to a newly created
instance with their default value, which can be overridden with the
GHashTable passed to srd_instance_new().
Currently, only strings and integers are supported as option value
types. The type is set by the default value in the decoder class, and
enforced when overriding them. Integers can be specified in any
format python allows: 10, 0x0a and so on.
|
|
|
|
PDs are now checked for a proper Decoder object, with at least the
required attributes.
The author, long_desc and func attributes in the decoder object are gone.
|
|
|
|
In the PDs (Python code), the 'annotation' variable/attribute is a list
of annotation formats. Use the plural 'annotations' as we do for other
lists such as 'inputs', 'outputs', 'probes', 'options', and so on.
|
|
|
|
The DDC decoder takes input from the I2C PD.
|
|
|
|
|
|
|
|
|
|
|
|
This is in preparation for passing annotation data back to the calling
frontend, and python data up to the next protocol in the stack.
|
|
|
|
|
|
PD decode() call now takes 3 arguments: timeoffset, duration, data
as per the current API specification.
|
|
|
|
This is done to be consistent with libsigrok's SR_ERR_ARG (nicer that way).
|
|
This includes the (private) functions srd_err() and friends, the
(public) SRD_LOG_ERR macros and friends, and the (public) API functions
srd_set_loglevel() and srd_get_loglevel().
|
|
Restored some prototypes in sigrokdecode.h.
Abort sigrok-cli on error while decoding (includes KeyboardInterrupt).
Fixed passing metadata to Decoder.start() method.
|
|
This uses the new python unified type/class object API to construct
an object for PDs to subclass. The sigrok.Decoder class has a method
put() which is implemented as a C function, and receives the PD's
object instance as its first parameter.
|
|
|
|
Functions changed to srd_session_start() to initialise the session,
and srd_session_feed() to feed sample data to the decoders.
|
|
|
|
Before this was passed to the decoder's constuctor, but the parameters
may not all be known at construction. Decoders now have a method start()
which is called at the start of the capture, and metadata is passed as
an arg to this function.
|
|
|
|
There is currently no way to configure options or probes, so they'll
always be the same, but it's a start.
|
|
|
|
|
|
|
|
|
|
Get the following string fields from the .py decoders' register()
function and store them in the respective 'struct srd_decoder':
- longname
- longdesc
- author
- email
- license
|
|
|
|
Do the same for sigrokdecode_ -> srd_ in struct names and function names.
|
|
Let sigrokdecode_init() always load all decoders it can find in the
decoders directory, i.e., the user doesn't need to manually load decoders.
Instead he can just look up the list via sigrokdecode_list_decoders()
after sigrokdecode_init() has run.
This is not a problem, as sigrokdecode_init() is only run once per
sigrok-cli or sigrok-gui invocation, and even with many decoders this
should not take too long.
The list of decoders within libsigrokdecode is no longer a string, but
rather a list of 'struct sigrokdecode_decoder *' pointers.
Add sigrokdecode_get_decoder_by_id() API function which returns the
decoder with the specified ID (file name without ".py" suffix, for now),
or NULL if it cannot be found.
sigrokdecode_load_decoder() is now a private function and not exported
via the lib, i.e. not available to users of libsigrokdecode.
|
|
|
|
Instead, add a libsigrokdecode_list_decoders() API call which gives you
the list of known protocol decoders.
|
|
Add a new -A | --list-protocol-decoders option to show the list of
protocol decoders we could find.
Add -a | --protocol-decoders to specify a list of decoders that shall
be applied to the datastream. Currently only works for one decoder.
Define DECODERS_DIR, which is the directory where the decoders will be
installed upon 'make install', and where libsigrokdecode_init() will
search for them.
Thanks Olivier Fauchon <olivier@aixmarseille.com> for the initial patch,
merged in slightly different form.
|
|
- Introduce 'struct sigrokdecode_decoder'.
- Decoders are now handled via two C functions:
- sigrokdecode_load_decoder(): Fills a 'struct sigrokdecode_decoder'.
- sigrokdecode_run_decoder(): Runs a decoder function.
- There are now two decoder API functions a script needs to implement:
- register(): Returns a Python dict with certain metadata.
- decode(): Runs the actual decoder code.
- libsigrokdecode: Add and use some more #defines for errors:
- SIGROKDECODE_ERR_ARGS
- SIGROKDECODE_ERR_PYTHON
- Various other smaller Python decode script infrastructure issues.
|
|
|
|
|
|
|
|
|
|
|