logic-agent-mcp 0.0.0-stage → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.cmd +5 -0
- package/CAPTURE.cmd +8 -0
- package/CHECK.cmd +7 -0
- package/FIRMWARE-RECOVER.cmd +6 -0
- package/FIRMWARE-STATUS.cmd +8 -0
- package/INSTALL-DRIVER.cmd +6 -0
- package/INSTALL-MCP.cmd +16 -0
- package/LICENSE +31 -0
- package/MCP.cmd +5 -0
- package/README.md +127 -2
- package/SELF-TEST.cmd +6 -0
- package/THIRD-PARTY-NOTICES.md +32 -0
- package/VERIFY-FILES.cmd +6 -0
- package/VERSION.txt +17 -0
- package/VIEW.cmd +16 -0
- package/checksums.sha256 +449 -0
- package/docs/DRIVER.md +54 -0
- package/docs/DSLOGIC-PLUS.md +180 -0
- package/docs/FIRMWARE.md +53 -0
- package/docs/INSTALL.md +74 -0
- package/docs/MCP-CLIENTS.md +213 -0
- package/docs/PROTOCOLS.md +200 -0
- package/docs/TROUBLESHOOTING.md +41 -0
- package/docs/UPSTREAM-SYNC.md +141 -0
- package/docs/WAVEFORM-VIEWER.md +48 -0
- package/firmware/DSLogicPlus.fw +0 -0
- package/firmware/LICENSE-DreamSourceLab.txt +20 -0
- package/launcher/logic-agent-mcp.mjs +106 -0
- package/package.json +56 -6
- package/runtime/app/logic_agent/__init__.py +4 -0
- package/runtime/app/logic_agent/analysis.py +84 -0
- package/runtime/app/logic_agent/backends/__init__.py +7 -0
- package/runtime/app/logic_agent/backends/base.py +37 -0
- package/runtime/app/logic_agent/backends/dslab.py +278 -0
- package/runtime/app/logic_agent/backends/mock.py +101 -0
- package/runtime/app/logic_agent/backends/sigrok.py +252 -0
- package/runtime/app/logic_agent/cli.py +387 -0
- package/runtime/app/logic_agent/decoders.py +868 -0
- package/runtime/app/logic_agent/errors.py +50 -0
- package/runtime/app/logic_agent/importer.py +129 -0
- package/runtime/app/logic_agent/mcp_clients.py +956 -0
- package/runtime/app/logic_agent/mcp_server.py +345 -0
- package/runtime/app/logic_agent/models.py +150 -0
- package/runtime/app/logic_agent/protocols.py +233 -0
- package/runtime/app/logic_agent/service.py +378 -0
- package/runtime/app/logic_agent/signal.py +206 -0
- package/runtime/app/logic_agent/store.py +197 -0
- package/runtime/bin/_bz2.pyd +0 -0
- package/runtime/bin/_ctypes.pyd +0 -0
- package/runtime/bin/_decimal.pyd +0 -0
- package/runtime/bin/_elementtree.pyd +0 -0
- package/runtime/bin/_hashlib.pyd +0 -0
- package/runtime/bin/_lzma.pyd +0 -0
- package/runtime/bin/_multiprocessing.pyd +0 -0
- package/runtime/bin/_socket.pyd +0 -0
- package/runtime/bin/_sqlite3.pyd +0 -0
- package/runtime/bin/_ssl.pyd +0 -0
- package/runtime/bin/dslab.exe +0 -0
- package/runtime/bin/libglib-2.0-0.dll +0 -0
- package/runtime/bin/libiconv-2.dll +0 -0
- package/runtime/bin/libintl-8.dll +0 -0
- package/runtime/bin/libpcre2-8-0.dll +0 -0
- package/runtime/bin/libusb-1.0.dll +0 -0
- package/runtime/bin/libwinpthread-1.dll +0 -0
- package/runtime/bin/libz-1.dll +0 -0
- package/runtime/bin/msvcp100.dll +0 -0
- package/runtime/bin/msvcr100.dll +0 -0
- package/runtime/bin/pyexpat.pyd +0 -0
- package/runtime/bin/python34.dll +0 -0
- package/runtime/bin/python34.zip +0 -0
- package/runtime/bin/res/DSCope.bin +0 -0
- package/runtime/bin/res/DSCope.fw +0 -0
- package/runtime/bin/res/DSCope1.def.dsc +88 -0
- package/runtime/bin/res/DSCope2.def.dsc +54 -0
- package/runtime/bin/res/DSCope20.bin +0 -0
- package/runtime/bin/res/DSCope20.fw +0 -0
- package/runtime/bin/res/DSCopeC20B.bin +0 -0
- package/runtime/bin/res/DSCopeC20P.bin +0 -0
- package/runtime/bin/res/DSCopeU2B100.bin +0 -0
- package/runtime/bin/res/DSCopeU2B20.bin +0 -0
- package/runtime/bin/res/DSCopeU2P20.bin +0 -0
- package/runtime/bin/res/DSCopeU3P100.bin +0 -0
- package/runtime/bin/res/DSLogic.fw +0 -0
- package/runtime/bin/res/DSLogic0.def.dsc +297 -0
- package/runtime/bin/res/DSLogic1.def.dsc +82 -0
- package/runtime/bin/res/DSLogic2.def.dsc +52 -0
- package/runtime/bin/res/DSLogic33.bin +0 -0
- package/runtime/bin/res/DSLogic50.bin +0 -0
- package/runtime/bin/res/DSLogicBasic.bin +0 -0
- package/runtime/bin/res/DSLogicPlus-pgl12-2.bin +0 -0
- package/runtime/bin/res/DSLogicPlus-pgl12.bin +0 -0
- package/runtime/bin/res/DSLogicPlus.bin +0 -0
- package/runtime/bin/res/DSLogicPlus.fw +0 -0
- package/runtime/bin/res/DSLogicPro.bin +0 -0
- package/runtime/bin/res/DSLogicPro.fw +0 -0
- package/runtime/bin/res/DSLogicU2Basic-pgl12-2.bin +0 -0
- package/runtime/bin/res/DSLogicU2Basic-pgl12.bin +0 -0
- package/runtime/bin/res/DSLogicU2Basic.bin +0 -0
- package/runtime/bin/res/DSLogicU2Pro16.bin +0 -0
- package/runtime/bin/res/DSLogicU3Pro16.bin +0 -0
- package/runtime/bin/res/DSLogicU3Pro32.bin +0 -0
- package/runtime/bin/res/license.txt +20 -0
- package/runtime/bin/res/virtual-demo1.dsc +68 -0
- package/runtime/bin/select.pyd +0 -0
- package/runtime/bin/sigrok-cli.exe +0 -0
- package/runtime/bin/unicodedata.pyd +0 -0
- package/runtime/bin/winsound.pyd +0 -0
- package/runtime/decoders/ac97/__init__.py +38 -0
- package/runtime/decoders/ac97/pd.py +477 -0
- package/runtime/decoders/ad5626/__init__.py +25 -0
- package/runtime/decoders/ad5626/pd.py +62 -0
- package/runtime/decoders/ad79x0/__init__.py +25 -0
- package/runtime/decoders/ad79x0/pd.py +137 -0
- package/runtime/decoders/ade77xx/__init__.py +31 -0
- package/runtime/decoders/ade77xx/lists.py +102 -0
- package/runtime/decoders/ade77xx/pd.py +131 -0
- package/runtime/decoders/adf435x/__init__.py +29 -0
- package/runtime/decoders/adf435x/pd.py +230 -0
- package/runtime/decoders/adns5020/__init__.py +27 -0
- package/runtime/decoders/adns5020/pd.py +116 -0
- package/runtime/decoders/adxl345/__init__.py +26 -0
- package/runtime/decoders/adxl345/lists.py +96 -0
- package/runtime/decoders/adxl345/pd.py +453 -0
- package/runtime/decoders/am230x/__init__.py +36 -0
- package/runtime/decoders/am230x/pd.py +229 -0
- package/runtime/decoders/amulet_ascii/__init__.py +28 -0
- package/runtime/decoders/amulet_ascii/lists.py +73 -0
- package/runtime/decoders/amulet_ascii/pd.py +699 -0
- package/runtime/decoders/arm_etmv3/__init__.py +25 -0
- package/runtime/decoders/arm_etmv3/pd.py +567 -0
- package/runtime/decoders/arm_itm/__init__.py +25 -0
- package/runtime/decoders/arm_itm/pd.py +373 -0
- package/runtime/decoders/arm_tpiu/__init__.py +28 -0
- package/runtime/decoders/arm_tpiu/pd.py +131 -0
- package/runtime/decoders/atsha204a/__init__.py +30 -0
- package/runtime/decoders/atsha204a/pd.py +323 -0
- package/runtime/decoders/aud/__init__.py +31 -0
- package/runtime/decoders/aud/pd.py +108 -0
- package/runtime/decoders/avr_isp/__init__.py +25 -0
- package/runtime/decoders/avr_isp/parts.py +163 -0
- package/runtime/decoders/avr_isp/pd.py +278 -0
- package/runtime/decoders/avr_pdi/__init__.py +42 -0
- package/runtime/decoders/avr_pdi/pd.py +574 -0
- package/runtime/decoders/caliper/__init__.py +36 -0
- package/runtime/decoders/caliper/pd.py +146 -0
- package/runtime/decoders/can/__init__.py +31 -0
- package/runtime/decoders/can/pd.py +519 -0
- package/runtime/decoders/cc1101/__init__.py +28 -0
- package/runtime/decoders/cc1101/lists.py +115 -0
- package/runtime/decoders/cc1101/pd.py +294 -0
- package/runtime/decoders/cec/__init__.py +25 -0
- package/runtime/decoders/cec/pd.py +311 -0
- package/runtime/decoders/cec/protocoldata.py +117 -0
- package/runtime/decoders/cfp/__init__.py +34 -0
- package/runtime/decoders/cfp/pd.py +110 -0
- package/runtime/decoders/cjtag/__init__.py +36 -0
- package/runtime/decoders/cjtag/pd.py +323 -0
- package/runtime/decoders/common/__init__.py +19 -0
- package/runtime/decoders/common/plugtrx/__init__.py +20 -0
- package/runtime/decoders/common/plugtrx/mod.py +192 -0
- package/runtime/decoders/common/sdcard/__init__.py +20 -0
- package/runtime/decoders/common/sdcard/mod.py +150 -0
- package/runtime/decoders/common/srdhelper/__init__.py +20 -0
- package/runtime/decoders/common/srdhelper/mod.py +98 -0
- package/runtime/decoders/counter/__init__.py +28 -0
- package/runtime/decoders/counter/pd.py +145 -0
- package/runtime/decoders/dali/__init__.py +24 -0
- package/runtime/decoders/dali/lists.py +98 -0
- package/runtime/decoders/dali/pd.py +244 -0
- package/runtime/decoders/dcf77/__init__.py +28 -0
- package/runtime/decoders/dcf77/pd.py +311 -0
- package/runtime/decoders/dmx512/__init__.py +25 -0
- package/runtime/decoders/dmx512/pd.py +361 -0
- package/runtime/decoders/ds1307/__init__.py +25 -0
- package/runtime/decoders/ds1307/pd.py +270 -0
- package/runtime/decoders/ds2408/__init__.py +25 -0
- package/runtime/decoders/ds2408/pd.py +129 -0
- package/runtime/decoders/ds243x/__init__.py +25 -0
- package/runtime/decoders/ds243x/pd.py +270 -0
- package/runtime/decoders/ds28ea00/__init__.py +25 -0
- package/runtime/decoders/ds28ea00/pd.py +93 -0
- package/runtime/decoders/dsi/__init__.py +24 -0
- package/runtime/decoders/dsi/pd.py +157 -0
- package/runtime/decoders/edid/__init__.py +35 -0
- package/runtime/decoders/edid/pd.py +671 -0
- package/runtime/decoders/edid/pnpids.txt +2135 -0
- package/runtime/decoders/eeprom24xx/__init__.py +25 -0
- package/runtime/decoders/eeprom24xx/lists.py +214 -0
- package/runtime/decoders/eeprom24xx/pd.py +443 -0
- package/runtime/decoders/eeprom93xx/__init__.py +32 -0
- package/runtime/decoders/eeprom93xx/pd.py +163 -0
- package/runtime/decoders/em4100/__init__.py +24 -0
- package/runtime/decoders/em4100/pd.py +238 -0
- package/runtime/decoders/em4305/__init__.py +24 -0
- package/runtime/decoders/em4305/pd.py +394 -0
- package/runtime/decoders/enc28j60/__init__.py +32 -0
- package/runtime/decoders/enc28j60/lists.py +161 -0
- package/runtime/decoders/enc28j60/pd.py +294 -0
- package/runtime/decoders/flexray/__init__.py +32 -0
- package/runtime/decoders/flexray/pd.py +413 -0
- package/runtime/decoders/graycode/__init__.py +24 -0
- package/runtime/decoders/graycode/pd.py +197 -0
- package/runtime/decoders/guess_bitrate/__init__.py +40 -0
- package/runtime/decoders/guess_bitrate/pd.py +79 -0
- package/runtime/decoders/hdcp/__init__.py +27 -0
- package/runtime/decoders/hdcp/pd.py +191 -0
- package/runtime/decoders/i2c/__init__.py +25 -0
- package/runtime/decoders/i2c/pd.py +364 -0
- package/runtime/decoders/i2cdemux/__init__.py +27 -0
- package/runtime/decoders/i2cdemux/pd.py +80 -0
- package/runtime/decoders/i2cfilter/__init__.py +37 -0
- package/runtime/decoders/i2cfilter/pd.py +106 -0
- package/runtime/decoders/i2s/__init__.py +29 -0
- package/runtime/decoders/i2s/pd.py +179 -0
- package/runtime/decoders/ieee488/__init__.py +26 -0
- package/runtime/decoders/ieee488/pd.py +849 -0
- package/runtime/decoders/ir_irmp/__init__.py +25 -0
- package/runtime/decoders/ir_irmp/irmp_library.py +168 -0
- package/runtime/decoders/ir_irmp/pd.py +139 -0
- package/runtime/decoders/ir_nec/__init__.py +25 -0
- package/runtime/decoders/ir_nec/lists.py +93 -0
- package/runtime/decoders/ir_nec/pd.py +300 -0
- package/runtime/decoders/ir_rc5/__init__.py +24 -0
- package/runtime/decoders/ir_rc5/lists.py +93 -0
- package/runtime/decoders/ir_rc5/pd.py +182 -0
- package/runtime/decoders/ir_rc6/__init__.py +24 -0
- package/runtime/decoders/ir_rc6/pd.py +205 -0
- package/runtime/decoders/ir_sirc/__init__.py +26 -0
- package/runtime/decoders/ir_sirc/lists.py +201 -0
- package/runtime/decoders/ir_sirc/pd.py +215 -0
- package/runtime/decoders/jitter/__init__.py +29 -0
- package/runtime/decoders/jitter/pd.py +198 -0
- package/runtime/decoders/jtag/__init__.py +30 -0
- package/runtime/decoders/jtag/pd.py +235 -0
- package/runtime/decoders/jtag_ejtag/__init__.py +25 -0
- package/runtime/decoders/jtag_ejtag/pd.py +408 -0
- package/runtime/decoders/jtag_stm32/__init__.py +29 -0
- package/runtime/decoders/jtag_stm32/pd.py +269 -0
- package/runtime/decoders/lfast/__init__.py +35 -0
- package/runtime/decoders/lfast/pd.py +335 -0
- package/runtime/decoders/lin/__init__.py +28 -0
- package/runtime/decoders/lin/pd.py +247 -0
- package/runtime/decoders/lm75/__init__.py +25 -0
- package/runtime/decoders/lm75/pd.py +186 -0
- package/runtime/decoders/lpc/__init__.py +25 -0
- package/runtime/decoders/lpc/pd.py +365 -0
- package/runtime/decoders/ltc242x/__init__.py +25 -0
- package/runtime/decoders/ltc242x/pd.py +86 -0
- package/runtime/decoders/ltc26x7/__init__.py +25 -0
- package/runtime/decoders/ltc26x7/pd.py +187 -0
- package/runtime/decoders/maple_bus/__init__.py +25 -0
- package/runtime/decoders/maple_bus/pd.py +222 -0
- package/runtime/decoders/max72xx/__init__.py +25 -0
- package/runtime/decoders/max72xx/pd.py +130 -0
- package/runtime/decoders/mcp230xx/__init__.py +25 -0
- package/runtime/decoders/mcp230xx/pd.py +143 -0
- package/runtime/decoders/mcs48/__init__.py +31 -0
- package/runtime/decoders/mcs48/pd.py +126 -0
- package/runtime/decoders/mdio/__init__.py +39 -0
- package/runtime/decoders/mdio/pd.py +325 -0
- package/runtime/decoders/microwire/__init__.py +40 -0
- package/runtime/decoders/microwire/pd.py +194 -0
- package/runtime/decoders/midi/__init__.py +28 -0
- package/runtime/decoders/midi/lists.py +840 -0
- package/runtime/decoders/midi/pd.py +627 -0
- package/runtime/decoders/miller/__init__.py +26 -0
- package/runtime/decoders/miller/pd.py +190 -0
- package/runtime/decoders/mlx90614/__init__.py +25 -0
- package/runtime/decoders/mlx90614/pd.py +82 -0
- package/runtime/decoders/modbus/__init__.py +28 -0
- package/runtime/decoders/modbus/pd.py +941 -0
- package/runtime/decoders/morse/__init__.py +28 -0
- package/runtime/decoders/morse/pd.py +250 -0
- package/runtime/decoders/mrf24j40/__init__.py +25 -0
- package/runtime/decoders/mrf24j40/lists.py +165 -0
- package/runtime/decoders/mrf24j40/pd.py +188 -0
- package/runtime/decoders/mxc6225xu/__init__.py +28 -0
- package/runtime/decoders/mxc6225xu/pd.py +217 -0
- package/runtime/decoders/nes_gamepad/__init__.py +54 -0
- package/runtime/decoders/nes_gamepad/pd.py +92 -0
- package/runtime/decoders/nrf24l01/__init__.py +29 -0
- package/runtime/decoders/nrf24l01/pd.py +332 -0
- package/runtime/decoders/nrf905/__init__.py +26 -0
- package/runtime/decoders/nrf905/pd.py +301 -0
- package/runtime/decoders/numbers_and_state/__init__.py +41 -0
- package/runtime/decoders/numbers_and_state/pd.py +377 -0
- package/runtime/decoders/nunchuk/__init__.py +30 -0
- package/runtime/decoders/nunchuk/pd.py +207 -0
- package/runtime/decoders/onewire_link/__init__.py +56 -0
- package/runtime/decoders/onewire_link/pd.py +347 -0
- package/runtime/decoders/onewire_network/__init__.py +56 -0
- package/runtime/decoders/onewire_network/pd.py +185 -0
- package/runtime/decoders/ook/__init__.py +36 -0
- package/runtime/decoders/ook/pd.py +484 -0
- package/runtime/decoders/ook_oregon/__init__.py +25 -0
- package/runtime/decoders/ook_oregon/lists.py +75 -0
- package/runtime/decoders/ook_oregon/pd.py +389 -0
- package/runtime/decoders/ook_vis/__init__.py +25 -0
- package/runtime/decoders/ook_vis/pd.py +194 -0
- package/runtime/decoders/pan1321/__init__.py +25 -0
- package/runtime/decoders/pan1321/pd.py +164 -0
- package/runtime/decoders/parallel/__init__.py +45 -0
- package/runtime/decoders/parallel/pd.py +285 -0
- package/runtime/decoders/pca9571/__init__.py +25 -0
- package/runtime/decoders/pca9571/pd.py +122 -0
- package/runtime/decoders/pjdl/__init__.py +27 -0
- package/runtime/decoders/pjdl/pd.py +723 -0
- package/runtime/decoders/pjon/__init__.py +25 -0
- package/runtime/decoders/pjon/pd.py +603 -0
- package/runtime/decoders/ps2/__init__.py +26 -0
- package/runtime/decoders/ps2/pd.py +126 -0
- package/runtime/decoders/pwm/__init__.py +24 -0
- package/runtime/decoders/pwm/pd.py +167 -0
- package/runtime/decoders/qi/__init__.py +25 -0
- package/runtime/decoders/qi/pd.py +244 -0
- package/runtime/decoders/rc_encode/__init__.py +40 -0
- package/runtime/decoders/rc_encode/pd.py +215 -0
- package/runtime/decoders/rfm12/__init__.py +25 -0
- package/runtime/decoders/rfm12/pd.py +497 -0
- package/runtime/decoders/rgb_led_spi/__init__.py +25 -0
- package/runtime/decoders/rgb_led_spi/pd.py +72 -0
- package/runtime/decoders/rgb_led_ws281x/__init__.py +27 -0
- package/runtime/decoders/rgb_led_ws281x/pd.py +267 -0
- package/runtime/decoders/rtc8564/__init__.py +25 -0
- package/runtime/decoders/rtc8564/pd.py +254 -0
- package/runtime/decoders/sae_j1850_vpw/__init__.py +24 -0
- package/runtime/decoders/sae_j1850_vpw/pd.py +296 -0
- package/runtime/decoders/sbus_futaba/__init__.py +35 -0
- package/runtime/decoders/sbus_futaba/pd.py +273 -0
- package/runtime/decoders/sda2506/__init__.py +24 -0
- package/runtime/decoders/sda2506/pd.py +146 -0
- package/runtime/decoders/sdcard_sd/__init__.py +24 -0
- package/runtime/decoders/sdcard_sd/pd.py +554 -0
- package/runtime/decoders/sdcard_spi/__init__.py +68 -0
- package/runtime/decoders/sdcard_spi/pd.py +518 -0
- package/runtime/decoders/sdq/__init__.py +28 -0
- package/runtime/decoders/sdq/pd.py +131 -0
- package/runtime/decoders/seven_segment/__init__.py +24 -0
- package/runtime/decoders/seven_segment/pd.py +186 -0
- package/runtime/decoders/signature/__init__.py +25 -0
- package/runtime/decoders/signature/pd.py +142 -0
- package/runtime/decoders/sipi/__init__.py +30 -0
- package/runtime/decoders/sipi/pd.py +181 -0
- package/runtime/decoders/sle44xx/__init__.py +26 -0
- package/runtime/decoders/sle44xx/pd.py +541 -0
- package/runtime/decoders/smart_qspi/PORTING.md +22 -0
- package/runtime/decoders/smart_qspi/__init__.py +1 -0
- package/runtime/decoders/smart_qspi/pd.py +826 -0
- package/runtime/decoders/spdif/__init__.py +25 -0
- package/runtime/decoders/spdif/pd.py +295 -0
- package/runtime/decoders/spi/__init__.py +32 -0
- package/runtime/decoders/spi/pd.py +347 -0
- package/runtime/decoders/spiflash/__init__.py +30 -0
- package/runtime/decoders/spiflash/lists.py +178 -0
- package/runtime/decoders/spiflash/pd.py +537 -0
- package/runtime/decoders/ssi32/__init__.py +28 -0
- package/runtime/decoders/ssi32/pd.py +127 -0
- package/runtime/decoders/st25r39xx_spi/__init__.py +31 -0
- package/runtime/decoders/st25r39xx_spi/lists.py +231 -0
- package/runtime/decoders/st25r39xx_spi/pd.py +360 -0
- package/runtime/decoders/st7735/__init__.py +27 -0
- package/runtime/decoders/st7735/pd.py +173 -0
- package/runtime/decoders/stepper_motor/__init__.py +25 -0
- package/runtime/decoders/stepper_motor/pd.py +95 -0
- package/runtime/decoders/swd/__init__.py +34 -0
- package/runtime/decoders/swd/pd.py +350 -0
- package/runtime/decoders/swim/__init__.py +28 -0
- package/runtime/decoders/swim/pd.py +303 -0
- package/runtime/decoders/t55xx/__init__.py +25 -0
- package/runtime/decoders/t55xx/pd.py +326 -0
- package/runtime/decoders/tca6408a/__init__.py +25 -0
- package/runtime/decoders/tca6408a/pd.py +157 -0
- package/runtime/decoders/tdm_audio/__init__.py +25 -0
- package/runtime/decoders/tdm_audio/pd.py +116 -0
- package/runtime/decoders/timing/__init__.py +24 -0
- package/runtime/decoders/timing/pd.py +194 -0
- package/runtime/decoders/tlc5620/__init__.py +24 -0
- package/runtime/decoders/tlc5620/pd.py +212 -0
- package/runtime/decoders/uart/__init__.py +40 -0
- package/runtime/decoders/uart/pd.py +635 -0
- package/runtime/decoders/usb_packet/__init__.py +43 -0
- package/runtime/decoders/usb_packet/pd.py +401 -0
- package/runtime/decoders/usb_power_delivery/__init__.py +24 -0
- package/runtime/decoders/usb_power_delivery/pd.py +642 -0
- package/runtime/decoders/usb_request/__init__.py +49 -0
- package/runtime/decoders/usb_request/pd.py +386 -0
- package/runtime/decoders/usb_signalling/__init__.py +50 -0
- package/runtime/decoders/usb_signalling/pd.py +348 -0
- package/runtime/decoders/wiegand/__init__.py +28 -0
- package/runtime/decoders/wiegand/pd.py +148 -0
- package/runtime/decoders/x2444m/__init__.py +25 -0
- package/runtime/decoders/x2444m/pd.py +111 -0
- package/runtime/decoders/xfp/__init__.py +38 -0
- package/runtime/decoders/xfp/pd.py +486 -0
- package/runtime/decoders/xy2-100/__init__.py +28 -0
- package/runtime/decoders/xy2-100/pd.py +242 -0
- package/runtime/decoders/z80/__init__.py +36 -0
- package/runtime/decoders/z80/pd.py +358 -0
- package/runtime/decoders/z80/tables.py +1083 -0
- package/runtime/dslab.cmd +5 -0
- package/runtime/licenses/DreamSourceLab-res-MIT.txt +20 -0
- package/runtime/licenses/dslab-GPL-3.0.txt +674 -0
- package/runtime/licenses/logic-agent-MIT.txt +31 -0
- package/runtime/licenses/python-PSF.txt +645 -0
- package/runtime/licenses/sigrok-cli-GPL-3.0.txt +674 -0
- package/runtime/licenses/smart_qspi-PORTING.md +22 -0
- package/runtime/licenses/source/patches/dsview-v1.3.2-dslab.patch +124 -0
- package/runtime/logic-agent-mcp.cmd +9 -0
- package/runtime/logic-agent.cmd +9 -0
- package/runtime/python/LICENSE.txt +645 -0
- package/runtime/python/_asyncio.pyd +0 -0
- package/runtime/python/_bz2.pyd +0 -0
- package/runtime/python/_ctypes.pyd +0 -0
- package/runtime/python/_decimal.pyd +0 -0
- package/runtime/python/_elementtree.pyd +0 -0
- package/runtime/python/_hashlib.pyd +0 -0
- package/runtime/python/_lzma.pyd +0 -0
- package/runtime/python/_multiprocessing.pyd +0 -0
- package/runtime/python/_overlapped.pyd +0 -0
- package/runtime/python/_queue.pyd +0 -0
- package/runtime/python/_socket.pyd +0 -0
- package/runtime/python/_sqlite3.pyd +0 -0
- package/runtime/python/_ssl.pyd +0 -0
- package/runtime/python/_uuid.pyd +0 -0
- package/runtime/python/_wmi.pyd +0 -0
- package/runtime/python/_zoneinfo.pyd +0 -0
- package/runtime/python/libcrypto-3.dll +0 -0
- package/runtime/python/libffi-8.dll +0 -0
- package/runtime/python/libssl-3.dll +0 -0
- package/runtime/python/pyexpat.pyd +0 -0
- package/runtime/python/python.cat +0 -0
- package/runtime/python/python.exe +0 -0
- package/runtime/python/python3.dll +0 -0
- package/runtime/python/python313._pth +3 -0
- package/runtime/python/python313.dll +0 -0
- package/runtime/python/python313.zip +0 -0
- package/runtime/python/pythonw.exe +0 -0
- package/runtime/python/select.pyd +0 -0
- package/runtime/python/sqlite3.dll +0 -0
- package/runtime/python/unicodedata.pyd +0 -0
- package/runtime/python/vcruntime140.dll +0 -0
- package/runtime/python/vcruntime140_1.dll +0 -0
- package/runtime/python/winsound.pyd +0 -0
- package/runtime/scripts/deploy-check.ps1 +171 -0
- package/scripts/check.ps1 +14 -0
- package/scripts/firmware-recover.ps1 +27 -0
- package/scripts/install-driver.ps1 +30 -0
- package/scripts/self-test.ps1 +14 -0
- package/scripts/verify-files.py +39 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2018 Steve R <steversig@virginmedia.com>
|
|
5
|
+
##
|
|
6
|
+
## This program is free software; you can redistribute it and/or modify
|
|
7
|
+
## it under the terms of the GNU General Public License as published by
|
|
8
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
9
|
+
## (at your option) any later version.
|
|
10
|
+
##
|
|
11
|
+
## This program is distributed in the hope that it will be useful,
|
|
12
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
## GNU General Public License for more details.
|
|
15
|
+
##
|
|
16
|
+
## You should have received a copy of the GNU General Public License
|
|
17
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
import sigrokdecode as srd
|
|
21
|
+
import math
|
|
22
|
+
from .lists import *
|
|
23
|
+
|
|
24
|
+
class Decoder(srd.Decoder):
|
|
25
|
+
api_version = 3
|
|
26
|
+
id = 'ook_oregon'
|
|
27
|
+
name = 'Oregon'
|
|
28
|
+
longname = 'Oregon Scientific'
|
|
29
|
+
desc = 'Oregon Scientific weather sensor protocol.'
|
|
30
|
+
license = 'gplv2+'
|
|
31
|
+
inputs = ['ook']
|
|
32
|
+
outputs = []
|
|
33
|
+
tags = ['Sensor']
|
|
34
|
+
annotations = (
|
|
35
|
+
('bit', 'Bit'),
|
|
36
|
+
('field', 'Field'),
|
|
37
|
+
('l2', 'Level 2'),
|
|
38
|
+
('pre', 'Preamble'),
|
|
39
|
+
('syn', 'Sync'),
|
|
40
|
+
('id', 'SensorID'),
|
|
41
|
+
('ch', 'Channel'),
|
|
42
|
+
('roll', 'Rolling code'),
|
|
43
|
+
('f1', 'Flags1'),
|
|
44
|
+
)
|
|
45
|
+
annotation_rows = (
|
|
46
|
+
('bits', 'Bits', (0,)),
|
|
47
|
+
('fields', 'Fields', (1, 3, 4)),
|
|
48
|
+
('l2vals', 'Level 2', (2,)),
|
|
49
|
+
)
|
|
50
|
+
binary = (
|
|
51
|
+
('data-hex', 'Hex data'),
|
|
52
|
+
)
|
|
53
|
+
options = (
|
|
54
|
+
{'id': 'unknown', 'desc': 'Unknown type is', 'default': 'Unknown',
|
|
55
|
+
'values': ('Unknown', 'Temp', 'Temp_Hum', 'Temp_Hum1', 'Temp_Hum_Baro',
|
|
56
|
+
'Temp_Hum_Baro1', 'UV', 'UV1', 'Wind', 'Rain', 'Rain1')},
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def __init__(self):
|
|
60
|
+
self.reset()
|
|
61
|
+
|
|
62
|
+
def reset(self):
|
|
63
|
+
self.decoded = [] # Local cache of decoded OOK.
|
|
64
|
+
self.skip = None
|
|
65
|
+
|
|
66
|
+
def start(self):
|
|
67
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
68
|
+
self.out_binary = self.register(srd.OUTPUT_BINARY)
|
|
69
|
+
self.unknown = self.options['unknown']
|
|
70
|
+
|
|
71
|
+
def putx(self, data):
|
|
72
|
+
self.put(self.ss, self.es, self.out_ann, data)
|
|
73
|
+
|
|
74
|
+
def dump_oregon_hex(self, start, finish):
|
|
75
|
+
nib = self.decoded_nibbles
|
|
76
|
+
hexstring = ''
|
|
77
|
+
for x in nib:
|
|
78
|
+
hexstring += str(x[3]) if x[3] != '' else ' '
|
|
79
|
+
s = 'Oregon ' + self.ver + ' \"' + hexstring.upper() + '\"\n'
|
|
80
|
+
self.put(start, finish, self.out_binary,
|
|
81
|
+
[0, bytes([ord(c) for c in s])])
|
|
82
|
+
|
|
83
|
+
def oregon_put_pre_and_sync(self, len_pream, len_sync, ver):
|
|
84
|
+
ook = self.decoded
|
|
85
|
+
self.decode_pos = len_pream
|
|
86
|
+
self.ss, self.es = ook[0][0], ook[self.decode_pos][0]
|
|
87
|
+
self.putx([1, ['Oregon ' + ver + ' Preamble', ver + ' Preamble',
|
|
88
|
+
ver + ' Pre', ver]])
|
|
89
|
+
self.decode_pos += len_sync
|
|
90
|
+
self.ss, self.es = ook[len_pream][0], ook[self.decode_pos][0]
|
|
91
|
+
self.putx([1, ['Sync', 'Syn', 'S']])
|
|
92
|
+
|
|
93
|
+
# Strip off preamble and sync bits.
|
|
94
|
+
self.decoded = self.decoded[self.decode_pos:]
|
|
95
|
+
self.ookstring = self.ookstring[self.decode_pos:]
|
|
96
|
+
self.ver = ver
|
|
97
|
+
|
|
98
|
+
def oregon(self):
|
|
99
|
+
self.ookstring = ''
|
|
100
|
+
self.decode_pos = 0
|
|
101
|
+
ook = self.decoded
|
|
102
|
+
for i in range(len(ook)):
|
|
103
|
+
self.ookstring += ook[i][2]
|
|
104
|
+
if '10011001' in self.ookstring[:40]:
|
|
105
|
+
(preamble, data) = self.ookstring.split('10011001', 1)
|
|
106
|
+
if len(data) > 0 and len(preamble) > 16:
|
|
107
|
+
self.oregon_put_pre_and_sync(len(preamble), 8, 'v2.1')
|
|
108
|
+
self.oregon_v2()
|
|
109
|
+
elif 'E1100' in self.ookstring[:17]:
|
|
110
|
+
(preamble, data) = self.ookstring.split('E1100', 1)
|
|
111
|
+
if len(data) > 0 and len(preamble) <= 12:
|
|
112
|
+
self.oregon_put_pre_and_sync(len(preamble), 5, 'v1')
|
|
113
|
+
self.oregon_v1()
|
|
114
|
+
elif '0101' in self.ookstring[:28]:
|
|
115
|
+
(preamble, data) = self.ookstring.split('0101', 1)
|
|
116
|
+
if len(data) > 0 and len(preamble) > 12:
|
|
117
|
+
self.oregon_put_pre_and_sync(len(preamble), 4, 'v3')
|
|
118
|
+
self.oregon_v3()
|
|
119
|
+
elif len(self.ookstring) > 16: # Ignore short packets.
|
|
120
|
+
error_message = 'Not Oregon or wrong preamble'
|
|
121
|
+
self.ss, self.es = ook[0][0], ook[len(ook) - 1][1]
|
|
122
|
+
self.putx([1,[error_message]])
|
|
123
|
+
|
|
124
|
+
def oregon_v1(self):
|
|
125
|
+
ook = self.decoded
|
|
126
|
+
self.decode_pos = 0
|
|
127
|
+
self.decoded_nibbles = []
|
|
128
|
+
if len(self.decoded) >= 32: # Check there are at least 8 nibbles.
|
|
129
|
+
self.oregon_put_nib('RollingCode', ook[self.decode_pos][0],
|
|
130
|
+
ook[self.decode_pos + 3][1], 4)
|
|
131
|
+
self.oregon_put_nib('Ch', ook[self.decode_pos][0],
|
|
132
|
+
ook[self.decode_pos + 3][1], 4)
|
|
133
|
+
self.oregon_put_nib('Temp', ook[self.decode_pos][0],
|
|
134
|
+
ook[self.decode_pos + 15][1], 16)
|
|
135
|
+
self.oregon_put_nib('Checksum', ook[self.decode_pos][0],
|
|
136
|
+
ook[self.decode_pos + 7][1], 8)
|
|
137
|
+
|
|
138
|
+
self.dump_oregon_hex(ook[0][0], ook[len(ook) - 1][1])
|
|
139
|
+
|
|
140
|
+
# L2 decode.
|
|
141
|
+
self.oregon_temp(2)
|
|
142
|
+
self.oregon_channel(1)
|
|
143
|
+
self.oregon_battery(2)
|
|
144
|
+
self.oregon_checksum_v1()
|
|
145
|
+
|
|
146
|
+
def oregon_v2(self): # Convert to v3 format - discard odd bits.
|
|
147
|
+
self.decode_pos = 0
|
|
148
|
+
self.ookstring = self.ookstring[1::2]
|
|
149
|
+
for i in range(len(self.decoded)):
|
|
150
|
+
if i % 2 == 1:
|
|
151
|
+
self.decoded[i][0] = self.decoded[i - 1][0] # Re-align start pos.
|
|
152
|
+
self.decoded = self.decoded[1::2] # Discard left hand bits.
|
|
153
|
+
self.oregon_v3() # Decode with v3 decoder.
|
|
154
|
+
|
|
155
|
+
def oregon_nibbles(self, ookstring):
|
|
156
|
+
num_nibbles = int(len(ookstring) / 4)
|
|
157
|
+
nibbles = []
|
|
158
|
+
for i in range(num_nibbles):
|
|
159
|
+
nibble = ookstring[4 * i : 4 * i + 4]
|
|
160
|
+
nibble = nibble[::-1] # Reversed from right.
|
|
161
|
+
nibbles.append(nibble)
|
|
162
|
+
return nibbles
|
|
163
|
+
|
|
164
|
+
def oregon_put_nib(self, label, start, finish, numbits):
|
|
165
|
+
param = self.ookstring[self.decode_pos:self.decode_pos + numbits]
|
|
166
|
+
param = self.oregon_nibbles(param)
|
|
167
|
+
if 'E' in ''.join(param): # Blank out fields with errors.
|
|
168
|
+
result = ''
|
|
169
|
+
else:
|
|
170
|
+
result = hex(int(''.join(param), 2))[2:]
|
|
171
|
+
if len(result) < numbits / 4: # Reinstate leading zeros.
|
|
172
|
+
result = '0' * (int(numbits / 4) - len(result)) + result
|
|
173
|
+
if label != '':
|
|
174
|
+
label += ': '
|
|
175
|
+
self.put(start, finish, self.out_ann, [1, [label + result, result]])
|
|
176
|
+
if label == '': # No label - use nibble position.
|
|
177
|
+
label = int(self.decode_pos / 4)
|
|
178
|
+
for i in range(len(param)):
|
|
179
|
+
ss = self.decoded[self.decode_pos + (4 * i)][0]
|
|
180
|
+
es = self.decoded[self.decode_pos + (4 * i) + 3][1]
|
|
181
|
+
# Blank out nibbles with errors.
|
|
182
|
+
result = '' if ('E' in param[i]) else hex(int(param[i], 2))[2:]
|
|
183
|
+
# Save nibbles for L2 decoder.
|
|
184
|
+
self.decoded_nibbles.append([ss, es, label, result])
|
|
185
|
+
self.decode_pos += numbits
|
|
186
|
+
|
|
187
|
+
def oregon_v3(self):
|
|
188
|
+
self.decode_pos = 0
|
|
189
|
+
self.decoded_nibbles = []
|
|
190
|
+
ook = self.decoded
|
|
191
|
+
|
|
192
|
+
if len(self.decoded) >= 32: # Check there are at least 8 nibbles.
|
|
193
|
+
self.oregon_put_nib('SensorID', ook[self.decode_pos][0],
|
|
194
|
+
ook[self.decode_pos + 16][0], 16)
|
|
195
|
+
self.oregon_put_nib('Ch', ook[self.decode_pos][0],
|
|
196
|
+
ook[self.decode_pos + 3][1], 4)
|
|
197
|
+
self.oregon_put_nib('RollingCode', ook[self.decode_pos][0],
|
|
198
|
+
ook[self.decode_pos + 7][1], 8)
|
|
199
|
+
self.oregon_put_nib('Flags1', ook[self.decode_pos][0],
|
|
200
|
+
ook[self.decode_pos + 3][1], 4)
|
|
201
|
+
|
|
202
|
+
rem_nibbles = len(self.ookstring[self.decode_pos:]) // 4
|
|
203
|
+
for i in range(rem_nibbles): # Display and save rest of nibbles.
|
|
204
|
+
self.oregon_put_nib('', ook[self.decode_pos][0],
|
|
205
|
+
ook[self.decode_pos + 3][1], 4)
|
|
206
|
+
self.dump_oregon_hex(ook[0][0], ook[len(ook) - 1][1])
|
|
207
|
+
self.oregon_level2() # Level 2 decode.
|
|
208
|
+
else:
|
|
209
|
+
error_message = 'Too short to decode'
|
|
210
|
+
self.put(ook[0][0], ook[-1][1], self.out_ann, [1, [error_message]])
|
|
211
|
+
|
|
212
|
+
def oregon_put_l2_param(self, offset, digits, dec_point, pre_label, label):
|
|
213
|
+
nib = self.decoded_nibbles
|
|
214
|
+
result = 0
|
|
215
|
+
out_string = ''.join(str(x[3]) for x in nib[offset:offset + digits])
|
|
216
|
+
if len(out_string) == digits:
|
|
217
|
+
for i in range(dec_point, 0, -1):
|
|
218
|
+
result += int(nib[offset + dec_point - i][3], 16) / pow(10, i)
|
|
219
|
+
for i in range(dec_point, digits):
|
|
220
|
+
result += int(nib[offset + i][3], 16) * pow(10, i - dec_point)
|
|
221
|
+
result = '%g' % (result)
|
|
222
|
+
else:
|
|
223
|
+
result = ''
|
|
224
|
+
es = nib[offset + digits - 1][1]
|
|
225
|
+
if label == '\u2103':
|
|
226
|
+
es = nib[offset + digits][1] # Align temp to include +/- nibble.
|
|
227
|
+
self.put(nib[offset][0], es, self.out_ann,
|
|
228
|
+
[2, [pre_label + result + label, result]])
|
|
229
|
+
|
|
230
|
+
def oregon_temp(self, offset):
|
|
231
|
+
nib = self.decoded_nibbles
|
|
232
|
+
if nib[offset + 3][3] != '':
|
|
233
|
+
temp_sign = str(int(nib[offset + 3][3], 16))
|
|
234
|
+
temp_sign = '-' if temp_sign != '0' else '+'
|
|
235
|
+
else:
|
|
236
|
+
temp_sign = '?'
|
|
237
|
+
self.oregon_put_l2_param(offset, 3, 1, temp_sign, '\u2103')
|
|
238
|
+
|
|
239
|
+
def oregon_baro(self, offset):
|
|
240
|
+
nib = self.decoded_nibbles
|
|
241
|
+
baro = ''
|
|
242
|
+
if not (nib[offset + 2][3] == '' or nib[offset + 1][3] == ''
|
|
243
|
+
or nib[offset][3] == ''):
|
|
244
|
+
baro = str(int(nib[offset + 1][3] + nib[offset][3], 16) + 856)
|
|
245
|
+
self.put(nib[offset][0], nib[offset + 3][1],
|
|
246
|
+
self.out_ann, [2, [baro + ' mb', baro]])
|
|
247
|
+
|
|
248
|
+
def oregon_wind_dir(self, offset):
|
|
249
|
+
nib = self.decoded_nibbles
|
|
250
|
+
if nib[offset][3] != '':
|
|
251
|
+
w_dir = int(int(nib[offset][3], 16) * 22.5)
|
|
252
|
+
w_compass = dir_table[math.floor((w_dir + 11.25) / 22.5)]
|
|
253
|
+
self.put(nib[offset][0], nib[offset][1], self.out_ann,
|
|
254
|
+
[2, [w_compass + ' (' + str(w_dir) + '\u00b0)', w_compass]])
|
|
255
|
+
|
|
256
|
+
def oregon_channel(self, offset):
|
|
257
|
+
nib = self.decoded_nibbles
|
|
258
|
+
channel = ''
|
|
259
|
+
if nib[offset][3] != '':
|
|
260
|
+
ch = int(nib[offset][3], 16)
|
|
261
|
+
if self.ver != 'v3': # May not be true for all v2.1 sensors.
|
|
262
|
+
if ch != 0:
|
|
263
|
+
bit_pos = 0
|
|
264
|
+
while ((ch & 1) == 0):
|
|
265
|
+
bit_pos += 1
|
|
266
|
+
ch = ch >> 1
|
|
267
|
+
if self.ver == 'v2.1':
|
|
268
|
+
bit_pos += 1
|
|
269
|
+
channel = str(bit_pos)
|
|
270
|
+
elif self.ver == 'v3': # Not sure if this applies to all v3's.
|
|
271
|
+
channel = str(ch)
|
|
272
|
+
if channel != '':
|
|
273
|
+
self.put(nib[offset][0], nib[offset][1],
|
|
274
|
+
self.out_ann, [2, ['Ch ' + channel, channel]])
|
|
275
|
+
|
|
276
|
+
def oregon_battery(self, offset):
|
|
277
|
+
nib = self.decoded_nibbles
|
|
278
|
+
batt = 'OK'
|
|
279
|
+
if nib[offset][3] != '':
|
|
280
|
+
if (int(nib[offset][3], 16) >> 2) & 0x1 == 1:
|
|
281
|
+
batt = 'Low'
|
|
282
|
+
self.put(nib[offset][0], nib[offset][1],
|
|
283
|
+
self.out_ann, [2, ['Batt ' + batt, batt]])
|
|
284
|
+
|
|
285
|
+
def oregon_level2(self): # v2 and v3 level 2 decoder.
|
|
286
|
+
nib = self.decoded_nibbles
|
|
287
|
+
self.sensor_id = (nib[0][3] + nib[1][3] + nib[2][3] + nib[3][3]).upper()
|
|
288
|
+
nl, sensor_type = sensor.get(self.sensor_id, [['Unknown'], 'Unknown'])
|
|
289
|
+
names = ','.join(nl)
|
|
290
|
+
# Allow user to try decoding an unknown sensor.
|
|
291
|
+
if sensor_type == 'Unknown' and self.unknown != 'Unknown':
|
|
292
|
+
sensor_type = self.unknown
|
|
293
|
+
self.put(nib[0][0], nib[3][1], self.out_ann,
|
|
294
|
+
[2, [names + ' - ' + sensor_type, names, nl[0]]])
|
|
295
|
+
self.oregon_channel(4)
|
|
296
|
+
self.oregon_battery(7)
|
|
297
|
+
if sensor_type == 'Rain':
|
|
298
|
+
self.oregon_put_l2_param(8, 4, 2, '', ' in/hr') # Rain rate
|
|
299
|
+
self.oregon_put_l2_param(12, 6, 3, 'Total ', ' in') # Rain total
|
|
300
|
+
self.oregon_checksum(18)
|
|
301
|
+
if sensor_type == 'Rain1':
|
|
302
|
+
self.oregon_put_l2_param(8, 3, 1, '', ' mm/hr') # Rain rate
|
|
303
|
+
self.oregon_put_l2_param(11, 5, 1, 'Total ', ' mm') # Rain total
|
|
304
|
+
self.oregon_checksum(18)
|
|
305
|
+
if sensor_type == 'Temp':
|
|
306
|
+
self.oregon_temp(8)
|
|
307
|
+
self.oregon_checksum(12)
|
|
308
|
+
if sensor_type == 'Temp_Hum_Baro':
|
|
309
|
+
self.oregon_temp(8)
|
|
310
|
+
self.oregon_put_l2_param(12, 2, 0, 'Hum ', '%') # Hum
|
|
311
|
+
self.oregon_baro(15) # Baro
|
|
312
|
+
self.oregon_checksum(19)
|
|
313
|
+
if sensor_type == 'Temp_Hum_Baro1':
|
|
314
|
+
self.oregon_temp(8)
|
|
315
|
+
self.oregon_put_l2_param(12, 2, 0, 'Hum ', '%') # Hum
|
|
316
|
+
self.oregon_baro(14) # Baro
|
|
317
|
+
if sensor_type == 'Temp_Hum':
|
|
318
|
+
self.oregon_temp(8)
|
|
319
|
+
self.oregon_put_l2_param(12, 2, 0, 'Hum ', '%') # Hum
|
|
320
|
+
self.oregon_checksum(15)
|
|
321
|
+
if sensor_type == 'Temp_Hum1':
|
|
322
|
+
self.oregon_temp(8)
|
|
323
|
+
self.oregon_put_l2_param(12, 2, 0, 'Hum ', '%') # Hum
|
|
324
|
+
self.oregon_checksum(14)
|
|
325
|
+
if sensor_type == 'UV':
|
|
326
|
+
self.oregon_put_l2_param(8, 2, 0, '', '') # UV
|
|
327
|
+
if sensor_type == 'UV1':
|
|
328
|
+
self.oregon_put_l2_param(11, 2, 0,'' ,'') # UV
|
|
329
|
+
if sensor_type == 'Wind':
|
|
330
|
+
self.oregon_wind_dir(8)
|
|
331
|
+
self.oregon_put_l2_param(11, 3, 1, 'Gust ', ' m/s') # Wind gust
|
|
332
|
+
self.oregon_put_l2_param(14, 3, 1, 'Speed ', ' m/s') # Wind speed
|
|
333
|
+
self.oregon_checksum(17)
|
|
334
|
+
|
|
335
|
+
def oregon_put_checksum(self, nibbles, checksum):
|
|
336
|
+
nib = self.decoded_nibbles
|
|
337
|
+
result = 'BAD'
|
|
338
|
+
if (nibbles + 1) < len(nib):
|
|
339
|
+
if (nib[nibbles + 1][3] != '' and nib[nibbles][3] != ''
|
|
340
|
+
and checksum != -1):
|
|
341
|
+
if self.ver != 'v1':
|
|
342
|
+
if checksum == (int(nib[nibbles + 1][3], 16) * 16 +
|
|
343
|
+
int(nib[nibbles][3], 16)):
|
|
344
|
+
result = 'OK'
|
|
345
|
+
else:
|
|
346
|
+
if checksum == (int(nib[nibbles][3], 16) * 16 +
|
|
347
|
+
int(nib[nibbles + 1][3], 16)):
|
|
348
|
+
result = 'OK'
|
|
349
|
+
rx_check = (nib[nibbles + 1][3] + nib[nibbles][3]).upper()
|
|
350
|
+
details = '%s Calc %s Rx %s ' % (result, hex(checksum)[2:].upper(),
|
|
351
|
+
rx_check)
|
|
352
|
+
self.put(nib[nibbles][0], nib[nibbles + 1][1],
|
|
353
|
+
self.out_ann, [2, ['Checksum ' + details, result]])
|
|
354
|
+
|
|
355
|
+
def oregon_checksum(self, nibbles):
|
|
356
|
+
checksum = 0
|
|
357
|
+
for i in range(nibbles): # Add reversed nibbles.
|
|
358
|
+
nibble = self.ookstring[i * 4 : i * 4 + 4]
|
|
359
|
+
nibble = nibble[::-1] # Reversed from right.
|
|
360
|
+
if 'E' in nibble: # Abort checksum if there are errors.
|
|
361
|
+
checksum = -1
|
|
362
|
+
break
|
|
363
|
+
checksum += int(nibble, 2)
|
|
364
|
+
if checksum > 255:
|
|
365
|
+
checksum -= 255 # Make it roll over at 255.
|
|
366
|
+
chk_ver, comment = sensor_checksum.get(self.sensor_id,
|
|
367
|
+
['Unknown', 'Unknown'])
|
|
368
|
+
if chk_ver != 'Unknown':
|
|
369
|
+
self.ver = chk_ver
|
|
370
|
+
if self.ver == 'v2.1':
|
|
371
|
+
checksum -= 10 # Subtract 10 from v2 checksums.
|
|
372
|
+
self.oregon_put_checksum(nibbles, checksum)
|
|
373
|
+
|
|
374
|
+
def oregon_checksum_v1(self):
|
|
375
|
+
nib = self.decoded_nibbles
|
|
376
|
+
checksum = 0
|
|
377
|
+
for i in range(3): # Add the first three bytes.
|
|
378
|
+
if nib[2 * i][3] == '' or nib[2 * i + 1][3] == '': # Abort if blank.
|
|
379
|
+
checksum = -1
|
|
380
|
+
break
|
|
381
|
+
checksum += ((int(nib[2 * i][3], 16) & 0xF) << 4 |
|
|
382
|
+
(int(nib[2 * i + 1][3], 16) & 0xF))
|
|
383
|
+
if checksum > 255:
|
|
384
|
+
checksum -= 255 # Make it roll over at 255.
|
|
385
|
+
self.oregon_put_checksum(6, checksum)
|
|
386
|
+
|
|
387
|
+
def decode(self, ss, es, data):
|
|
388
|
+
self.decoded = data
|
|
389
|
+
self.oregon()
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2018 Steve R <steversig@virginmedia.com>
|
|
5
|
+
##
|
|
6
|
+
## This program is free software; you can redistribute it and/or modify
|
|
7
|
+
## it under the terms of the GNU General Public License as published by
|
|
8
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
9
|
+
## (at your option) any later version.
|
|
10
|
+
##
|
|
11
|
+
## This program is distributed in the hope that it will be useful,
|
|
12
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
## GNU General Public License for more details.
|
|
15
|
+
##
|
|
16
|
+
## You should have received a copy of the GNU General Public License
|
|
17
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
'''
|
|
21
|
+
This decoder stacks on top of the 'ook' PD and visualizes protocol details
|
|
22
|
+
in various ways.
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2018 Steve R <steversig@virginmedia.com>
|
|
5
|
+
##
|
|
6
|
+
## This program is free software; you can redistribute it and/or modify
|
|
7
|
+
## it under the terms of the GNU General Public License as published by
|
|
8
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
9
|
+
## (at your option) any later version.
|
|
10
|
+
##
|
|
11
|
+
## This program is distributed in the hope that it will be useful,
|
|
12
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
## GNU General Public License for more details.
|
|
15
|
+
##
|
|
16
|
+
## You should have received a copy of the GNU General Public License
|
|
17
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
import sigrokdecode as srd
|
|
21
|
+
from common.srdhelper import bcd2int
|
|
22
|
+
|
|
23
|
+
class Decoder(srd.Decoder):
|
|
24
|
+
api_version = 3
|
|
25
|
+
id = 'ook_vis'
|
|
26
|
+
name = 'OOK visualisation'
|
|
27
|
+
longname = 'On-off keying visualisation'
|
|
28
|
+
desc = 'OOK visualisation in various formats.'
|
|
29
|
+
license = 'gplv2+'
|
|
30
|
+
inputs = ['ook']
|
|
31
|
+
outputs = ['ook']
|
|
32
|
+
tags = ['Encoding']
|
|
33
|
+
annotations = (
|
|
34
|
+
('bit', 'Bit'),
|
|
35
|
+
('ref', 'Reference'),
|
|
36
|
+
('field', 'Field'),
|
|
37
|
+
('ref_field', 'Ref field'),
|
|
38
|
+
('level2', 'L2'),
|
|
39
|
+
('ref_level2', 'Ref L2'),
|
|
40
|
+
)
|
|
41
|
+
annotation_rows = (
|
|
42
|
+
('bits', 'Bits', (0,)),
|
|
43
|
+
('compare', 'Compare', (1,)),
|
|
44
|
+
('fields', 'Fields', (2,)),
|
|
45
|
+
('ref_fields', 'Ref fields', (3,)),
|
|
46
|
+
('level2_vals', 'L2', (4,)),
|
|
47
|
+
('ref_level2_vals', 'Ref L2', (5,)),
|
|
48
|
+
)
|
|
49
|
+
options = (
|
|
50
|
+
{'id': 'displayas', 'desc': 'Display as', 'default': 'Nibble - Hex',
|
|
51
|
+
'values': ('Byte - Hex', 'Byte - Hex rev', 'Byte - BCD',
|
|
52
|
+
'Byte - BCD rev', 'Nibble - Hex', 'Nibble - Hex rev', 'Nibble - BCD',
|
|
53
|
+
'Nibble - BCD rev')},
|
|
54
|
+
{'id': 'synclen', 'desc': 'Sync length', 'default': '4',
|
|
55
|
+
'values': ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')},
|
|
56
|
+
{'id': 'syncoffset', 'desc': 'Sync offset', 'default': '0',
|
|
57
|
+
'values': ('-4', '-3', '-2', '-1', '0', '1', '2', '3', '4')},
|
|
58
|
+
{'id': 'refsample', 'desc': 'Compare', 'default': 'off', 'values':
|
|
59
|
+
('off', 'show numbers', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
|
60
|
+
'10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
|
|
61
|
+
'21', '22', '23', '24', '25', '26', '27', '28', '29', '30')},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def __init__(self):
|
|
65
|
+
self.reset()
|
|
66
|
+
|
|
67
|
+
def reset(self):
|
|
68
|
+
self.decoded = [] # Local cache of decoded OOK.
|
|
69
|
+
self.ookstring = ''
|
|
70
|
+
self.ookcache = []
|
|
71
|
+
self.trace_num = 0
|
|
72
|
+
|
|
73
|
+
def start(self):
|
|
74
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
75
|
+
self.out_python = self.register(srd.OUTPUT_PYTHON)
|
|
76
|
+
self.displayas = self.options['displayas']
|
|
77
|
+
self.sync_length = self.options['synclen']
|
|
78
|
+
self.sync_offset = self.options['syncoffset']
|
|
79
|
+
self.ref = self.options['refsample']
|
|
80
|
+
|
|
81
|
+
def putx(self, data):
|
|
82
|
+
self.put(self.ss, self.es, self.out_ann, data)
|
|
83
|
+
|
|
84
|
+
def putp(self, data):
|
|
85
|
+
self.put(self.ss, self.es, self.out_python, data)
|
|
86
|
+
|
|
87
|
+
def display_level2(self, bits, line):
|
|
88
|
+
self.decode_pos = 0
|
|
89
|
+
ook = self.decoded
|
|
90
|
+
# Find the end of the preamble which could be 1010 or 1111.
|
|
91
|
+
if len(ook) > 1:
|
|
92
|
+
preamble_end = len(ook) + 1
|
|
93
|
+
char_first = ook[0][2]
|
|
94
|
+
char_second = ook[1][2]
|
|
95
|
+
if char_first == char_second: # 1111
|
|
96
|
+
preamble = '1111'
|
|
97
|
+
char_last = char_first
|
|
98
|
+
else:
|
|
99
|
+
preamble = '1010'
|
|
100
|
+
char_last = char_second
|
|
101
|
+
for i in range(len(ook)):
|
|
102
|
+
if preamble == '1111':
|
|
103
|
+
if ook[i][2] != char_last:
|
|
104
|
+
preamble_end = i
|
|
105
|
+
break
|
|
106
|
+
else:
|
|
107
|
+
char_last = ook[i][2]
|
|
108
|
+
else:
|
|
109
|
+
if ook[i][2] != char_last:
|
|
110
|
+
char_last = ook[i][2]
|
|
111
|
+
else:
|
|
112
|
+
preamble_end = i
|
|
113
|
+
break
|
|
114
|
+
|
|
115
|
+
if len(ook) >= preamble_end:
|
|
116
|
+
preamble_end += int(self.sync_offset) - 1
|
|
117
|
+
self.ss, self.es = ook[0][0], ook[preamble_end][1]
|
|
118
|
+
self.putx([line, ['Preamble', 'Pre', 'P']])
|
|
119
|
+
self.decode_pos += preamble_end
|
|
120
|
+
|
|
121
|
+
if len(ook) > self.decode_pos + int(self.sync_length):
|
|
122
|
+
self.ss = self.es
|
|
123
|
+
self.es = ook[self.decode_pos + int(self.sync_length)][1]
|
|
124
|
+
self.putx([line, ['Sync', 'Syn', 'S']])
|
|
125
|
+
self.decode_pos += int(self.sync_length) + 1
|
|
126
|
+
|
|
127
|
+
ookstring = self.ookstring[self.decode_pos:]
|
|
128
|
+
rem_nibbles = len(ookstring) // bits
|
|
129
|
+
for i in range(rem_nibbles): # Display the rest of nibbles.
|
|
130
|
+
self.ss = ook[self.decode_pos][0]
|
|
131
|
+
self.es = ook[self.decode_pos + bits - 1][1]
|
|
132
|
+
self.put_field(bits, line)
|
|
133
|
+
|
|
134
|
+
def put_field(self, numbits, line):
|
|
135
|
+
param = self.ookstring[self.decode_pos:self.decode_pos + numbits]
|
|
136
|
+
if 'rev' in self.displayas:
|
|
137
|
+
param = param[::-1] # Reversed from right.
|
|
138
|
+
if not 'E' in param: # Format if no errors.
|
|
139
|
+
if 'Hex' in self.displayas:
|
|
140
|
+
param = hex(int(param, 2))[2:]
|
|
141
|
+
elif 'BCD' in self.displayas:
|
|
142
|
+
param = bcd2int(int(param, 2))
|
|
143
|
+
self.putx([line, [str(param)]])
|
|
144
|
+
self.decode_pos += numbits
|
|
145
|
+
|
|
146
|
+
def display_all(self):
|
|
147
|
+
ookstring = ''
|
|
148
|
+
self.decode_pos = 0
|
|
149
|
+
ook = self.decoded
|
|
150
|
+
for i in range(len(ook)):
|
|
151
|
+
self.ookstring += ook[i][2]
|
|
152
|
+
bits = 4 if 'Nibble' in self.displayas else 8
|
|
153
|
+
rem_nibbles = len(self.ookstring) // bits
|
|
154
|
+
for i in range(rem_nibbles): # Display the rest of the nibbles.
|
|
155
|
+
self.ss = ook[self.decode_pos][0]
|
|
156
|
+
self.es = ook[self.decode_pos + bits - 1][1]
|
|
157
|
+
self.put_field(bits, 2)
|
|
158
|
+
|
|
159
|
+
self.display_level2(bits, 4) # Display L2 decode.
|
|
160
|
+
|
|
161
|
+
if (self.ref != 'off' and self.ref != 'show numbers' and
|
|
162
|
+
len(self.ookcache) >= int(self.ref)): # Compare traces.
|
|
163
|
+
ref = int(self.ref) - 1
|
|
164
|
+
self.display_ref(self.trace_num, ref)
|
|
165
|
+
if len(self.ookcache) == int(self.ref): # Backfill.
|
|
166
|
+
for i in range(0, ref):
|
|
167
|
+
self.display_ref(i, ref)
|
|
168
|
+
elif self.ref == 'show numbers': # Display ref numbers.
|
|
169
|
+
self.ss = self.ookcache[self.trace_num][0][0]
|
|
170
|
+
end_sig = len(self.ookcache[self.trace_num]) - 1
|
|
171
|
+
self.es = self.ookcache[self.trace_num][end_sig][1]
|
|
172
|
+
self.putx([1, [str(self.trace_num + 1)]])
|
|
173
|
+
|
|
174
|
+
def display_ref(self, t_num, ref):
|
|
175
|
+
display_len = len(self.ookcache[ref])
|
|
176
|
+
if len(self.ookcache[t_num]) < len(self.ookcache[ref]):
|
|
177
|
+
display_len = len(self.ookcache[t_num])
|
|
178
|
+
for i in range(display_len):
|
|
179
|
+
self.ss = self.ookcache[t_num][i][0]
|
|
180
|
+
self.es = self.ookcache[t_num][i][1]
|
|
181
|
+
self.putx([1, [self.ookcache[ref][i][2]]])
|
|
182
|
+
|
|
183
|
+
def add_to_cache(self): # Cache the OOK so it can be used as a reference.
|
|
184
|
+
self.ookcache.append(self.decoded)
|
|
185
|
+
|
|
186
|
+
def decode(self, ss, es, data):
|
|
187
|
+
self.decoded = data
|
|
188
|
+
self.add_to_cache()
|
|
189
|
+
self.display_all()
|
|
190
|
+
self.ookstring = ''
|
|
191
|
+
self.trace_num += 1
|
|
192
|
+
self.ss = ss
|
|
193
|
+
self.es = es
|
|
194
|
+
self.putp(data) # Send data up the stack.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
|
|
5
|
+
##
|
|
6
|
+
## This program is free software; you can redistribute it and/or modify
|
|
7
|
+
## it under the terms of the GNU General Public License as published by
|
|
8
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
9
|
+
## (at your option) any later version.
|
|
10
|
+
##
|
|
11
|
+
## This program is distributed in the hope that it will be useful,
|
|
12
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
## GNU General Public License for more details.
|
|
15
|
+
##
|
|
16
|
+
## You should have received a copy of the GNU General Public License
|
|
17
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
'''
|
|
21
|
+
This decoder stacks on top of the 'uart' PD and decodes the Panasonic PAN1321
|
|
22
|
+
Bluetooth module Serial Port Profile (SPP) protocol.
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
from .pd import Decoder
|