Bug 177 - Multiple srd_decoder_load() calls for the same PD seem to have issues.
Summary: Multiple srd_decoder_load() calls for the same PD seem to have issues.
Status: RESOLVED FIXED
Alias: None
Product: libsigrokdecode
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-17 23:44 CEST by Uwe Hermann
Modified: 2013-11-18 10:21 CET (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2013-10-17 23:44:32 CEST
Running
  srd_decoder_load("uart"); srd_decoder_load("uart");
seems to cause issues.

srd: libsigrokdecode loglevel set to 5.
srd: Loading protocol decoder 'uart'.
srd: option 'parity_type'
srd: option 'baudrate'
srd: option 'bit_order'
srd: option 'parity_check'
srd: option 'format'
srd: option 'num_stop_bits'
srd: option 'num_data_bits'
srd: Loading protocol decoder 'uart'.
srd: option 'parity_type'
srd: option 'baudrate'
srd: option 'bit_order'
srd: option 'parity_check'
srd: option 'format'
srd: option 'num_stop_bits'
srd: option 'num_data_bits'
srd: Dictionary has no attribute 'id'.

The second call returns SRD_ERR_PYTHON. However, "Dictionary has no attribute 'id'" sounds like an issue, loading a PD should not make the "id" field vanish(?)

It is also not defined/documented whether srd_decoder_load()ing a PD that has been loaded already (via srd_decoder_load or implicitly via srd_decoder_load_all) is supposed to return SRD_OK and be a NOP, or SRD_ERR_* and be a forbidden thing to do.

This was exposed by the libsigrokdecode testsuite.
Comment 1 Bert Vermeulen 2013-11-18 10:21:55 CET
Fixed in 22c9bc2a4e958fccf498f4480965ec03884bc058