{"id":20129983,"url":"https://github.com/ok-dmr/ok-dmrlib","last_synced_at":"2025-04-07T16:19:20.343Z","repository":{"id":43996946,"uuid":"430168724","full_name":"OK-DMR/ok-dmrlib","owner":"OK-DMR","description":"DMR PDUs, elements, FEC and CRC library, including proprietary DMR protocols of Hytera and Motorola","archived":false,"fork":false,"pushed_at":"2024-12-02T13:18:27.000Z","size":648,"stargazers_count":45,"open_issues_count":3,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T14:12:54.471Z","etag":null,"topics":["crc","dmr","dmr-radio","etsi","fec","ham-radio","hamradio","hytera","lp","lrrp","motorola","python","rcp","rrs","tmp","tms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OK-DMR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-20T17:38:22.000Z","updated_at":"2025-03-25T10:21:37.000Z","dependencies_parsed_at":"2024-04-06T10:23:26.918Z","dependency_job_id":"16582913-3dc2-4ec9-bc47-c55a10a1a503","html_url":"https://github.com/OK-DMR/ok-dmrlib","commit_stats":{"total_commits":152,"total_committers":1,"mean_commits":152.0,"dds":0.0,"last_synced_commit":"46fc60f9a8ae3eff82befcbb5d38292714540f8c"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OK-DMR%2Fok-dmrlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OK-DMR%2Fok-dmrlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OK-DMR%2Fok-dmrlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OK-DMR%2Fok-dmrlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OK-DMR","download_url":"https://codeload.github.com/OK-DMR/ok-dmrlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685634,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crc","dmr","dmr-radio","etsi","fec","ham-radio","hamradio","hytera","lp","lrrp","motorola","python","rcp","rrs","tmp","tms"],"created_at":"2024-11-13T20:36:53.854Z","updated_at":"2025-04-07T16:19:20.315Z","avatar_url":"https://github.com/OK-DMR.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OK-DMR Lib\n\n[![.github/workflows/sanity.yml](https://img.shields.io/github/actions/workflow/status/OK-DMR/ok-dmrlib/sanity.yml?style=flat-square\u0026branch=master)](https://github.com/OK-DMR/ok-dmrlib/actions)\n[![Code Style: Python Black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n[![License](https://img.shields.io/github/license/OK-DMR/ok-dmrlib?style=flat-square)](https://github.com/OK-DMR/ok-dmrlib/blob/master/LICENSE)\n[![Last released version](https://img.shields.io/pypi/v/ok-dmrlib?style=flat-square)](https://pypi.org/project/ok-dmrlib/)\n[![PyPI downloads](https://img.shields.io/pypi/dd/ok-dmrlib?style=flat-square)](https://libraries.io/pypi/ok-dmrlib)\n[![Python versions](https://img.shields.io/pypi/pyversions/ok-dmrlib?style=flat-square)](https://pypi.org/project/ok-dmrlib/)\n[![Wheel](https://img.shields.io/pypi/wheel/ok-dmrlib?style=flat-square)](https://pypi.org/project/ok-dmrlib/#files)\n[![Codecov](https://img.shields.io/codecov/c/github/ok-dmr/ok-dmrlib?style=flat-square)](https://app.codecov.io/gh/OK-DMR/ok-dmrlib)\n\nThis package provides way to parse and assemble various DMR ETSI protocols and functions, in pure Python implementation\n\n## Supported features\n\n### FEC (Forward Error Correction)\n\n| Algorithm                                           | Encoding | Decoding / Verification |\n|-----------------------------------------------------|:--------:|:-----------------------:|\n| Hamming (7,4,3)                                     |    ✅     |            ✅            |\n| Hamming (13,9,3)                                    |    ✅     |            ✅            |\n| Hamming (15,11,3)                                   |    ✅     |            ✅            |\n| Hamming (16,11,3)                                   |    ✅     |            ✅            |\n| Hamming (17,12,3)                                   |    ✅     |            ✅            |\n| Golay (20,8,7)                                      |    ✅     |            ✅            |\n| Quadratic Residue (16,7,6)                          |    ✅     |            ✅            |\n| Reed-Solomon (12,9,4)                               |    ✅     |            ✅            |\n| Rate 3/4 Trellis                                    |    ✅     |            ✅            |\n| Block Product Turbo Code (196,96)                   |    ✅     |            ✅            |\n| Variable length BPTC (BPTC 128,72)                  |    ✅     |            ✅            |\n| Variable length BPTC (BPTC 68,28) for CACH/Short LC |    ✅     |            ✅            |\n| Variable length BTPC (BPTC 32,11) for Single-Burst  |    ✅     |            ✅            |\n\n### CRC (Cyclic Redundancy Check) and Checksums\n\n| Name                  | Generate | Verify |\n|-----------------------|:--------:|:------:|\n| 5-bit checksum        |    ✅     |   ✅    |\n| CRC-8 (8-bit CRC)     |    ✅     |   ✅    |\n| CRC-9                 |    ✅     |   ✅    |\n| CRC-CCIT (CRC16-CCIT) |    ✅     |   ✅    |\n| CRC-32 (32-bit CRC)   |    ✅     |   ✅    |\n\n### ETSI PDUs (Protocol Data Units)\n\n| Name                    | Encoding / Decoding | Description                                                                                                                | \n|-------------------------|:-------------------:|----------------------------------------------------------------------------------------------------------------------------|\n| CSBK                    |          ✅          | Control Signalling Block, namely: BS Outbound Activation, Unit-Unit Request/Answer, Negative ACK, Preamble, Channel Timing |\n| EMB                     |          ✅          | Embedded Signalling                                                                                                        |\n| FULL\u0026nbsp;LC            |          ✅          | Full Link Control, namely: Group Voice, Unit-Unit, Talker Alias (header + blocks1,2,3), GPSInfo, Terminator with LC        |\n| SHORT\u0026nbsp;LC           |          ✅          | Short Link Control, namely: Activity, Null                                                                                 |\n| SLOT                    |          ✅          | Slot Type                                                                                                                  |\n| SYNC                    |          ✅          | Synchronization patterns                                                                                                   |\n| Data\u0026nbsp;Header        |          ✅          | Confirmed/Unconfirmed, Response, Defined Short Data                                                                        |\n| PI\u0026nbsp;Header          |          ✅          | Privacy (PI) Header, without further understanding of transported data                                                     |\n| Rate\u0026nbsp;1\u0026nbsp;Data   |          ✅          | Rate 1 data (confirmed and unconfirmed) and last block data (confirmed and unconfirmed)                                    |\n| Rate\u0026nbsp;1/2\u0026nbsp;Data |          ✅          | Rate 1/2 data (confirmed and unconfirmed) and last block data (confirmed and unconfirmed)                                  |\n| Rate\u0026nbsp;3/4\u0026nbsp;Data |          ✅          | Rate 3/4 data (confirmed and unconfirmed) and last block data (confirmed and unconfirmed)                                  |\n| Full/Short Link Control |          ✅          | FLC/SLC PDUs                                                                                                               |\n| UDP/IPv4                |          ✅          | UDP/IPv4 compressed header/packet                                                                                          |\n\n### ETSI Information Elements\n\nAll listed elements are supported as standalone enum/class representation, which allows for decoding/encoding and\ndescribing data (discovery):\n\nAccess Types (AT), CRC Mask, CSBKO (CSBK Opcode), DPF (Data Packet Format), DT (Data Type), FID (Feature Set ID), FLCO (\nFull LC Opcode), LCSS (LC Start/Stop), PI (Pre-emption and power control indicator), SLCO (Short LC Opcode), SYNC (\nSynchronization pattern), Activity ID, Additional Information Field, Answer/Response, CTO (Channel Timing Opcode), DI (\nDynamic Identifier), Position Error, Reason Code, Service Options, Talker Alias Data Format, Defined Data Format (DD),\nSelective Automatic Repeat reQuest (SARQ),\nRe-Synchronize Flag (S), Send sequence number (N(S)), SAP identifier (SAP), Supplementary Flag (SF), Unified Data\nTransport Format (UDT Format), UDP Port Identifier (SPID/DPID), IP Address Identifier (SAID/DAID)\n\n### Hytera\n\n| Protocol Name                                        | Encoding / Decoding | \n|------------------------------------------------------|:-------------------:|\n| Hytera Simple Transport Reliability Protocol (HSTRP) |          ✅          |\n| Hytera Radio Network Protocol (HRNP)                 |          ✅          |\n| Hytera DMR Application Protocol (HDAP)               |          ✅          |\n| Radio Registration Service (RRS)                     |          ✅          |\n| Location Protocol (LP)                               |          ✅          |\n| Radio Control Protocol (RCP)                         |          ✅          |\n| Text Message Protocol (TMP)                          |          ✅          |\n\n- Not all opcodes in all protocols are implemented, however it will fail with descriptive message, which opcode is\n  missing in particular operation (decoding, description, encoding)\n\n### Motorola\n\n| Protocol Name                             | Encoding / Decoding | \n|-------------------------------------------|:-------------------:|\n| Location Request Response Protocol (LRRP) |          ✅          |\n| Automatic Registration Service (ARS)      |          ✅          |\n| Text Messaging Service (TMS)              |          ✅          |\n\n- Motorola has MBXML (Motorola Binary XML) which is used to represent LRRP/ARRP documents, ok-dmrlib contains abstract\n  MBXML implementation with various tools, LRRP implementation tested with both examples and real-world data\n- LRRP is supported as `[bytes] \u003c-\u003e [mbxml document(s)] -\u003e [xml representation]`, currently serialization of xml\n  document to bytes is not supported\n- There are some catches, when you want to serialize MBXML token with common name, look through the test_mbxml and\n  test_lrrp modules, to see how to select specific (correct) token programatically\n\n### Available CLI tools\n\n- dmrlib-pcap-tool - PCAP/PCAPNG traffic description and data extraction\n- dmrlib-dmr-burst - Describe full Tier-II burst (33 bytes)\n- dmrlib-dmr-header - Describe DMR Data Header\n- dmrlib-dmr-ipudp - Describe DMR UDP/IPv4 Compressed data (header + user payload)\n- dmrlib-hytera-hstrp - Hytera Simple Transport Protocol\n- dmrlib-hytera-hdap - Hytera DMR Application Protocol\n- dmrlib-hytera-hrnp - Hytera Radio Network Protocol\n- dmrlib-hytera-lp - Hytera Location Protocol\n- dmrlib-hytera-rcp - Hytera Radio Control Protocol\n- dmrlib-hytera-rrs - Hytera Radio Registration Service\n- dmrlib-hytera-tmp - Hytera Text Message Protocol\n\n### Additional notes\n\n- Almost every class/enum supports BitsInterface (de-serialization from on-air bits, serialization to transmission bits)\n  , or for byte-aligned protocols (Hytera, Motorola) BytesInterface (with explicit endianness support)\n- Every FEC/CRC implemented supports both calculation, verification and (if possible) also self-correction\n- Working with Vocoder and Data/Control Bursts is supported, along with handling rates 1, 1/2 and 3/4\n- CRCs interface classes may require appropriate CRC Mask to be provided when generating or verifying\n- Through [dmr-kaitai](https://github.com/ok-dmr/dmr-kaitai) handling of ETSI, Hytera and MMDVM/Homebrew UDP data is\n  supported\n- To inspect on-wire traffic PcapTool (provided in cli as `dmrlib-pcap-tool` script) supports PCAP/PCAPNG files with\n  various functions on describing bursts, port/data filtering, data extraction, ...\n- Everything is tested, specifically now we have 95% pytest coverage for whole ok-dmrlib codebase\n- Not everything is probably documented as it should be, but the usage should always be very clear, when you look at\n  tests of particular component\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fok-dmr%2Fok-dmrlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fok-dmr%2Fok-dmrlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fok-dmr%2Fok-dmrlib/lists"}