Bug 177

Summary: Multiple srd_decoder_load() calls for the same PD seem to have issues.
Product: libsigrokdecode Reporter: Uwe Hermann <uwe>
Component: OtherAssignee: Nobody <nobody>
Status: RESOLVED FIXED    
Severity: normal CC: bert
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

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