{"id":22192440,"url":"https://github.com/beriberikix/senml-zephyr","last_synced_at":"2025-03-24T20:45:31.207Z","repository":{"id":265743845,"uuid":"834640316","full_name":"beriberikix/senml-zephyr","owner":"beriberikix","description":"A codec for encoding and decoding Sensor Measurement Lists (SenML) for Zephyr","archived":false,"fork":false,"pushed_at":"2024-07-28T02:43:41.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T22:53:03.675Z","etag":null,"topics":["codec","data","iot","senml","sensor","zephyr-rtos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beriberikix.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":"2024-07-27T22:31:26.000Z","updated_at":"2024-07-28T02:43:44.000Z","dependencies_parsed_at":"2024-11-30T19:32:35.528Z","dependency_job_id":"bb2b1ca3-8c42-4524-a922-121d5deb7e49","html_url":"https://github.com/beriberikix/senml-zephyr","commit_stats":null,"previous_names":["beriberikix/senml-zephyr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beriberikix%2Fsenml-zephyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beriberikix%2Fsenml-zephyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beriberikix%2Fsenml-zephyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beriberikix%2Fsenml-zephyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beriberikix","download_url":"https://codeload.github.com/beriberikix/senml-zephyr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245351757,"owners_count":20601090,"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":["codec","data","iot","senml","sensor","zephyr-rtos"],"created_at":"2024-12-02T12:24:41.811Z","updated_at":"2025-03-24T20:45:31.176Z","avatar_url":"https://github.com/beriberikix.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SenML Codec for Zephyr\n\nThe `senml-zephyr` project provides a codec for encoding and decoding Sensor Measurement Lists (SenML) as defined in [RFC 8428](https://datatracker.ietf.org/doc/html/rfc8428) \u0026 [RFC 8798](https://datatracker.ietf.org/doc/html/rfc8798). This codec supports both JSON and CBOR formats for data serialization.\n\n## Configuration\n\nThe project provides configuration options via Kconfig:\n\n- `SENML_CODEC`: Enable the SenML codec module.\n- `SENML_FORMAT_JSON`: Enable support for JSON format.\n- `SENML_FORMAT_CBOR`: Enable support for CBOR format (default).\n\n## Usage\n\n### Encoding and Decoding SenML Records\n\nInclude the SenML codec header in your application:\n```\n#include \"senml_codec.h\"\n```\n\nCreate and encode a SenML record:\n```\nstruct senml_record record = {\n    .bn = \"device-1\",\n    .bt = 0,\n    .bu = \"C\",\n    .bv = 0,\n    .n = \"temperature\",\n    .u = \"C\",\n    .v = 25.3,\n    .vs = NULL,\n    .vb = 0,\n    .vd = NULL,\n    .s = 0,\n    .ut = 0\n};\n\nchar buffer[256];\nint ret = senml_encode_record(\u0026record, buffer, sizeof(buffer));\nif (ret == 0) {\n    printk(\"Encoded JSON: %s\\n\", buffer);\n} else {\n    printk(\"Failed to encode JSON\\n\");\n}\n```\n\nDecode a SenML record:\n```\nstruct senml_record decoded_record;\nret = senml_decode_record(buffer, sizeof(buffer), \u0026decoded_record);\nif (ret == 0) {\n    printk(\"Decoded JSON Record: bn=%s, bt=%f, bu=%s, bv=%f, n=%s, u=%s, v=%f, s=%f, ut=%f\\n\",\n           decoded_record.bn, decoded_record.bt, decoded_record.bu, decoded_record.bv,\n           decoded_record.n, decoded_record.u, decoded_record.v, decoded_record.s, decoded_record.ut);\n} else {\n    printk(\"Failed to decode JSON\\n\");\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberiberikix%2Fsenml-zephyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberiberikix%2Fsenml-zephyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberiberikix%2Fsenml-zephyr/lists"}