{"id":34072641,"url":"https://github.com/stmicroelectronics/compost-rpc","last_synced_at":"2025-12-14T08:04:40.417Z","repository":{"id":302488570,"uuid":"1007605190","full_name":"STMicroelectronics/compost-rpc","owner":"STMicroelectronics","description":"RPC protocol generator. Abstracts communication between a PC and an MCU. Basically it allows you to call functions on your MCU from a PC.","archived":false,"fork":false,"pushed_at":"2025-10-02T15:07:20.000Z","size":1168,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-15T02:22:21.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/STMicroelectronics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-24T08:50:15.000Z","updated_at":"2025-10-21T08:52:38.000Z","dependencies_parsed_at":"2025-07-02T17:30:43.289Z","dependency_job_id":"9e60d230-cfca-4819-85db-8d276730ad42","html_url":"https://github.com/STMicroelectronics/compost-rpc","commit_stats":null,"previous_names":["stmicroelectronics/compost-rpc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/STMicroelectronics/compost-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STMicroelectronics%2Fcompost-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STMicroelectronics%2Fcompost-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STMicroelectronics%2Fcompost-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STMicroelectronics%2Fcompost-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STMicroelectronics","download_url":"https://codeload.github.com/STMicroelectronics/compost-rpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STMicroelectronics%2Fcompost-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27722674,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-12-14T08:04:37.162Z","updated_at":"2025-12-14T08:04:40.411Z","avatar_url":"https://github.com/STMicroelectronics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compost\n\nCompost is a Remote Procedure Call ([RPC](https://en.wikipedia.org/wiki/Remote_procedure_call))\nprotocol generator with a simple wire format.\n\nIt abstracts communication between a PC and an MCU. Basically it allows you to\ncall functions on your MCU from a PC.\n\nCompost is meant to be used over any medium, but it's simplicity is best suited\nfor UART/RS232 or UDP/IP.\n\n## Install\n\n    pip install compost_rpc\n\n## Documentation\n\nDocumentation is available in the [Wiki](https://github.com/STMicroelectronics/compost-rpc/wiki)\n\n## Introduction\n\nWith Compost you can write a function for your MCU in C, but call\nit from Python or C# on a PC.\n\nThe call on the PC looks like a normal function\ncall, but Compost takes the arguments, creates a message and sends it\nover a transport like serial port. Then, Compost on the MCU parses the message\nand calls your function with the arguments you provided on the PC.\nYour function returns a value. Compost on the MCU creates a response message\nwith the return value. The response is sent to PC. Compost on the PC parses the\nmessage and the function you called on the PC returns the value you provided in\nthe MCU.\n\nSimplified functionality diagram:\n\n![Functional overview](docs/_static/image/getting_started/compost-simple.svg)\n\n## Features\n\n### Languge support\n\n- C\n  - C11 standard\n  - Implemented roles\n    - RPC server (callee)\n    - Notification sender\n    - Notification receiver\n- Python\n  - Needs version \u003e= 3.10\n  - Implemented roles\n    - RPC client (caller)\n    - Notification receiver\n- C#\n  - Implemented roles\n    - RPC client (caller)\n    - Notification receiver\n\n### Transports\n\n- UDP transport\n- Serial transport\n- Raw ethernet transport (Linux only)\n- TCP transport\n- Stdio transport\n- Custom\n\n### Data types\n\n- 8, 16, 32 and 64-bit signed and unsigned integers\n- 32 and 64-bit floating-point numbers (IEEE 754)\n- Bit-precise integers\n- C like Struct\n- C like Enum with selectable underlying type\n- Dynamically sized array (list) for each supported primitive type\n\n## Try it!\n\nYou just need Python and a C compiler like GCC to run our single PC example.\n\nClone the repository and enter the directory with the example:\n\n    git clone https://github.com/STMicroelectronics/compost-rpc.git\n    cd compost-rpc/examples/pc_to_pc\n\nGenerate C code from the protocol definition:\n\n    python protocol_def.py\n\nCompile the server:\n\nOn Linux or macOS:\n\n    gcc -o server main.c compost.c\n\nOn Windows:\n\n    gcc -o server main.c compost.c -lws2_32\n\nIn one terminal run the C server:\n\n    ./server\n\nIn another terminal run the Python client:\n\n    python main.py\n\nClient sends two integers and the server adds them together and sends the result back to the client.\nIt's probably the simplest Compost example you can have.\n\nIf you want to try Compost-RPC properly with an MCU, check out\nthe [Tutorial](https://github.com/STMicroelectronics/compost-rpc/wiki/Tutorial).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstmicroelectronics%2Fcompost-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstmicroelectronics%2Fcompost-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstmicroelectronics%2Fcompost-rpc/lists"}