Fix: The CAN decoder AND CAN_FD

This commit is contained in:
dreamsourcelabTAI 2023-06-14 18:43:17 +08:00
parent 5d36d0654b
commit dd95035331
3 changed files with 15 additions and 7 deletions

View File

@ -141,7 +141,15 @@
},
{
"id": "dec_can_opt_bitrate",
"text": "比特率"
"text": "波特率"
},
{
"id": "dec_can_opt_nominal_bitrate",
"text": "低波特率"
},
{
"id": "dec_can_opt_fast_bitrate",
"text": "高波特率"
},
{
"id": "dec_can_opt_sample_point",

View File

@ -39,12 +39,12 @@ class Decoder(srd.Decoder):
outputs = ['can']
tags = ['Automotive']
channels = (
{'id': 'can_rx', 'name': 'CAN FD', 'desc': 'CAN FD bus line', 'idn':'dec_can_fd_chan_can_rx'},
{'id': 'can_rx', 'name': 'CAN FD', 'desc': 'CAN FD bus line', 'idn':'dec_can_chan_can_rx'},
)
options = (
{'id': 'nominal_bitrate', 'desc': 'Nominal bitrate (bits/s)', 'default': 1000000, 'idn':'dec_can_fd_opt_nominal_bitrate'},
{'id': 'fast_bitrate', 'desc': 'Fast bitrate (bits/s)', 'default': 2000000, 'idn':'dec_can_fd_opt_fast_bitrate'},
{'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0, 'idn':'dec_can_fd_opt_sample_point'},
{'id': 'nominal_bitrate', 'desc': 'Nominal bitrate (bits/s)', 'default': 1000000, 'idn':'dec_can_opt_nominal_bitrate'},
{'id': 'fast_bitrate', 'desc': 'Fast bitrate (bits/s)', 'default': 2000000, 'idn':'dec_can_opt_fast_bitrate'},
{'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0, 'idn':'dec_can_opt_sample_point'},
)
annotations = (
('data', 'CAN payload data'),

View File

@ -42,8 +42,8 @@ class Decoder(srd.Decoder):
{'id': 'can_rx', 'name': 'CAN', 'desc': 'CAN bus line', 'idn':'dec_can_chan_can_rx'},
)
options = (
{'id': 'bitrate', 'desc': 'bitrate (bits/s)', 'default': 1000000'idn':'dec_can_opt_bitrate'},
{'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0'idn':'dec_can_opt_sample_point'},
{'id': 'bitrate', 'desc': 'bitrate (bits/s)', 'default': 1000000,'idn':'dec_can_opt_bitrate'},
{'id': 'sample_point', 'desc': 'Sample point (%)', 'default': 70.0,'idn':'dec_can_opt_sample_point'},
)
annotations = (
('data', 'CAN payload data'),