Comments (9)
@maciekish
The difference between DSView and sigrok is that when calling self. wait(), it returns a tuple, while sigrok returns a list.
from dsview.
@maciekish
This decoder is a sub decoder, so it can use without edit. But it miss the "tag" attribute.
You can see the error message from log. You need append line as:
class Decoder(srd.Decoder):
api_version = 3
id = 'dcs_bios'
name = 'DCS-BIOS'
longname = 'DCS-BIOS Protocol'
desc = 'Decoder for the DCS-BIOS protocol over UART'
license = 'gplv2+'
inputs = ['uart']
outputs = []
tags = ['bios']
from dsview.
Where do i place the file to make DSView use it without editing the app on macOS?
from dsview.
@maciekish
On macOS, if you open DSView from the dmg file, you need to select the DSView icon, press the right button with the menu "Show Package Contents", find the "decoders" derectory, copy your new decoder files to here.
from dsview.
@maciekish
Maybe you need to copy the DSView app to other direcotry first.
from dsview.
Is it possible for you to consider reading additional decoders from another directory than the app? If users without macOS development knowledge modify the app, they just get a cryptic message saying the app is damaged and needs to be deleted. I know i can remove the signature and use the app anyway, but this is not a good solution. Perhaps you could use ~/Library/DSView/decoders or ~/.dsview/decoders or something like that in the macOS version?
from dsview.
@dreamsource-tai I have a second decoder that crashes DSView on launch, but works in PulseView. Any idea why please? It's not using self.wait()
import sigrokdecode as srd
class Decoder(srd.Decoder):
api_version = 3
id = 'dcsbios'
name = 'DCS BIOS Protocol'
longname = 'DCS BIOS protocol'
desc = 'DCS BIOS protocol'
license = 'gplv2+'
tags = ['DCS']
inputs = ['uart']
outputs = []
annotations = (
('sync', 'Sync bytes'),
('address', 'Address'),
('count', 'Count'),
('data', 'Data'),
)
annotation_rows = (
('fields', 'Fields', (0, 1, 2, 3)),
)
def __init__(self):
self.reset()
def reset(self):
self.state = 0 # Initial state: Wait for sync
self.sync_byte_count = 0
self.address = 0
self.count = 0
self.data = 0
def start(self):
self.out_ann = self.register(srd.OUTPUT_ANN)
def decode(self, ss, es, data):
ptype, rxtx, pdata = data
if ptype != 'DATA':
return
c = pdata[0]
if c == 0x55:
self.sync_byte_count += 1
else:
self.sync_byte_count = 0
if self.sync_byte_count == 4:
self.state = 1 # Transition to address_low state
self.count = 0
self.address = 0
self.data = 0
self.sync_byte_count = 0
self.put(ss, es, self.out_ann, [0, ['SYNC']])
return
if self.state == 1: # DCSBIOS_STATE_ADDRESS_LOW
self.address = c
self.state = 2
self.put(ss, es, self.out_ann, [1, ['Address low: %02x' % c]])
elif self.state == 2: # DCSBIOS_STATE_ADDRESS_HIGH
self.address = (c << 8) | self.address
if self.address != 0x5555:
self.state = 3 # Transition to count_low state
else:
self.state = 0 # Transition back to wait_for_sync state
self.put(ss, es, self.out_ann, [1, ['Address high: %02x, Full address: %04x' % (c, self.address)]])
elif self.state == 3: # DCSBIOS_STATE_COUNT_LOW
self.count = c
self.state = 4
self.put(ss, es, self.out_ann, [2, ['Count low: %02x' % c]])
elif self.state == 4: # DCSBIOS_STATE_COUNT_HIGH
self.count = (c << 8) | self.count
self.state = 5 # Transition to data_low state
self.put(ss, es, self.out_ann, [2, ['Count high: %02x, Full count: %04x' % (c, self.count)]])
elif self.state == 5: # DCSBIOS_STATE_DATA_LOW
self.data = c
self.count -= 1
self.state = 6
self.put(ss, es, self.out_ann, [3, ['Data low: %02x' % c]])
elif self.state == 6: # DCSBIOS_STATE_DATA_HIGH
self.data = (c << 8) | self.data
self.count -= 1
self.address += 2
if self.count == 0:
self.state = 1 # Transition back to address_low state
else:
self.state = 5 # Transition back to data_low state
self.put(ss, es, self.out_ann, [3, ['Data high: %02x, Full data: %04x' % (c, self.data)]])
from dsview.
@maciekish
Another way is to compile the project yourself, so the program is not an app package and there will be no signature restrictions.
Decoder execution error, relevant information can be seen through logs. You can run the program on the terminal to view the logs, or you can use the log options to view the log content.
The upper layer protocol does not need to call self. wait(), and its data is obtained by passing parameters.
from dsview.
@dreamsource-tai I agree with @maciekish - having an extra directory that you can load decoders (in the home directory for example) from is probably the correct solution. If you edit the application itself, it can be hard to share decoders with other people, and also tricky to upgrade the software. You could also store your custom decoders in a git repository or something like that.
from dsview.
Related Issues (20)
- advice: add eye icon beside the decoder HOT 1
- DSView 1.3.1 tells me that I need to connect to a USB3 port when it is already connected to a USB3 port HOT 2
- Unable to select decoder from list HOT 2
- 在多个显示屏环境下,将窗口移动到副屛上,最大化的时候,出现bug:会覆盖掉下面的任务栏 HOT 3
- V1.3.1版本界面以及数据渲染 HOT 1
- 调整电压幅度分辨率后,0电平跟着变化了。
- 卡到的波形后自动计算了有效值平均值等,但改变波形时间分辨率,不会重新计算有效值和平均值
- CANFD 协议解码器有问题,错误帧解码错误导致后续报文连续解码错误 HOT 4
- SPI解码数据导出txt/csv增加Packet ID HOT 1
- Decoder list is empty in DSView HOT 14
- Bug-软件上次退出的窗口位置 未正确保存 (主副屏问题) HOT 1
- SPI解码错误 HOT 1
- SPI解码错误 HOT 1
- 多个光标时,删除光标,光标的序号会重新排序,建议有个配置可选是否要重新排序 HOT 2
- 能否为linux发行版提供一个通用的Appimage? HOT 2
- Error in PDI decoder: TypeError:argument 2 must be int, not None HOT 12
- Can't select decoding format+ cant get decoding to work HOT 7
- 能否把示波器独立出来呢? HOT 1
- XY2-100 deconding issues HOT 2
- 自定义协议编辑,软件提示错误:未能创建解码实例,有什么调试方法可以辅助定位问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsview.