{"id":18689262,"url":"https://github.com/endail/radiopacket","last_synced_at":"2026-05-10T02:32:35.900Z","repository":{"id":104384681,"uuid":"328181385","full_name":"endail/RadioPacket","owner":"endail","description":"A packet format for sending/receiving data using the Arduino Manchester library","archived":false,"fork":false,"pushed_at":"2021-01-16T08:39:09.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T01:40:11.466Z","etag":null,"topics":["arduino","arduino-library","manchester-encoding","radio","rf"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/endail.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-01-09T15:08:47.000Z","updated_at":"2021-01-16T08:42:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd5600b4-d225-41b6-bcf9-d39ec44669dc","html_url":"https://github.com/endail/RadioPacket","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FRadioPacket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FRadioPacket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FRadioPacket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FRadioPacket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endail","download_url":"https://codeload.github.com/endail/RadioPacket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239549977,"owners_count":19657538,"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":["arduino","arduino-library","manchester-encoding","radio","rf"],"created_at":"2024-11-07T10:41:55.735Z","updated_at":"2025-11-08T05:30:37.238Z","avatar_url":"https://github.com/endail.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RadioPacket\n\nA packet format for sending/receiving data using the [Arduino Manchester library](https://github.com/mchr3k/arduino-libs-manchester).\n\n[![lint status](https://github.com/endail/RadioPacket/workflows/arduino-lint/badge.svg?event=push)](https://github.com/endail/RadioPacket/actions?query=workflow%3Aarduino-lint)\n\n## [Transmitter Code](https://github.com/endail/RadioPacket/blob/main/examples/tx/tx.ino)\n\n```cpp\nusing RadioPacket;\n\nMessage m(arr, sizeof(arr));\nm.setRawAction(UPDATE_DB_CMD);\n\nRadioPacket p(\u0026m);\np.setRawTransmitterId(TRANSMITTER_ID);\np.setRawReceiverId(RECEIVER_ID);\np.setRawCrc8(p.generateChecksum());\n\nman.transmitArray(\n    p.getRawPacketLength(),\n    const_cast\u003cuint8_t*\u003e(p.getData()));\n```\n\n## [Receiver Code](https://github.com/endail/RadioPacket/blob/main/examples/rx/rx.ino)\n\n```cpp\nRadioPacket* p;\nMessage* m;\n\nif(RadioPacket::parse(\u0026p, buffer, BUFFER_SIZE) == RadioPacket::PARSE_OK) {\n    if(Message::parse(\u0026m, p-\u003egetBodyData(), p-\u003egetRawBodyLength()) == Message::PARSE_OK) {\n        Serial.println(m-\u003egetBodyData());\n    }\n}\n\ndelete p;\ndelete m;\n```\n\n## Packet Format\n\n0             1        2               4            6\n\n[PACKET LENGTH][VERSION][TRANSMITTER ID][RECEIVER ID]\n\n6        7            8     9\n\n[FRAGMENT][BODY LENGTH][CRC8]\n\n9\n\n[BODY DATA]\n\n## Message Format\n\n0           2       4\n\n[BODY LENGTH][ACTION]\n\n4\n\n[BODY DATA]\n\n## Extending Messages\n\n```cpp\n// MeasurementMessage.h\n\n#include \u003cRadioPacket.h\u003e\n\n/**\n * MeasurementMessage holds a single 16 bit integer\n */\nclass MeasurementMessage : public RadioPacket::Message {\n\nprotected:\n    static const uint8_t _MEASUREMENT_OFFSET = 0;\n    static const uint8_t _ACTION_VALUE = 1;\n\npublic:\n    MeasurementMessage() : Message() {\n        this-\u003esetRawAction(_ACTION_VALUE);\n        this-\u003eresizeBody(sizeof(uint16_t));\n    }\n\n    uint16_t getMeasurement() const noexcept {\n        return this-\u003e_data.getUInt16(this-\u003efromBaseBodyOffset(\n            _MEASUREMENT_OFFSET));\n    }\n\n    void setMeasurement(const uint16_t m) noexcept {\n        this-\u003e_data.setUInt16(m, this-\u003efromBaseBodyOffset(\n            _MEASUREMENT_OFFSET));\n    }\n\n};\n```\n\n```cpp\n// example use of MeasurementMessage\n// read analog value of A1 into message object\nMeasurementMessage mm;\nmm.setMeasurement(::analogRead(A1));\n\n// then encapsulate the message into a RadioPacket as\n// in the example transmitter code above\n\n// when receiving, cast Message to a MeasurementMessage,\n// where m is a Message* as in the example receiver code above\nMeasurementMessage* mm = static_cast\u003cMeasurementMessage*\u003e(m);\nmm-\u003egetMeasurement();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendail%2Fradiopacket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendail%2Fradiopacket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendail%2Fradiopacket/lists"}