{"id":31931289,"url":"https://github.com/patrickbaus/cobs-cpp","last_synced_at":"2025-10-14T04:33:33.519Z","repository":{"id":110104494,"uuid":"102534597","full_name":"PatrickBaus/COBS-CPP","owner":"PatrickBaus","description":"An Arduino compatible COBS (Consistent Overhead Byte Stuffing) Encoder/Decoder","archived":false,"fork":false,"pushed_at":"2025-05-09T08:22:48.000Z","size":49,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T08:36:29.675Z","etag":null,"topics":["arduino-library","iot"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickBaus.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,"zenodo":null}},"created_at":"2017-09-05T22:11:46.000Z","updated_at":"2025-05-09T07:41:26.000Z","dependencies_parsed_at":"2023-05-21T14:53:14.440Z","dependency_job_id":null,"html_url":"https://github.com/PatrickBaus/COBS-CPP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PatrickBaus/COBS-CPP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickBaus%2FCOBS-CPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickBaus%2FCOBS-CPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickBaus%2FCOBS-CPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickBaus%2FCOBS-CPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickBaus","download_url":"https://codeload.github.com/PatrickBaus/COBS-CPP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickBaus%2FCOBS-CPP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017942,"owners_count":26086213,"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-10-14T02:00:06.444Z","response_time":60,"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":["arduino-library","iot"],"created_at":"2025-10-14T04:33:28.192Z","updated_at":"2025-10-14T04:33:33.506Z","avatar_url":"https://github.com/PatrickBaus.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Consistent Overhead Byte Stuffing Library\n===================\n\nThis repository contains a fast C library of the [COBS](http://www.stuartcheshire.org/papers/COBSforToN.pdf) (Consistent Overhead Byte Stuffing) algorithm.\nIt is designed for small embedded devices and the Internet of Things. When using any serial connection\nto transfer data, packet boundaries need to be unambiguous within the data stream.\n\nThe COBS encoder works by reencoding a dataframe to remove a a certain byte (typically `0x00`), so that\nthis byte can then be used as a special marker to denote the end of a frame. The encoding is especially\nefficient and requires little computational resources.\n\nThe implementation is both efficient and rquires little memory. It works in-place on the input data\nto save memory, but it is limited to a single COBS frame of 254 bytes, which is typically more than\nenough for small devices.\n\nUsage\n-----\nThe example data is taken from the Wikipedia article on [COBS](https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing).\nThe code is written for the Arduino platform, but works on any platform.\n\n```cpp\n#include \"cobs.h\"\n\nvoid printBuffer(uint8_t* buffer, size_t size) {\n  for (uint8_t i = 0; i \u003c size; i++) {\n    if (buffer[i] \u003c 0x10) {\n      Serial.print(0);\n    }\n    Serial.print(buffer[i], HEX);\n    Serial.print(\" \");\n  }\n}\n\nvoid setup() {\n  Serial.begin(115200);\n  // This is example 3 from Wikipedia\n  uint8_t buffer[] = {0xFF, 0x11, 0x22, 0x00, 0x33};  //Note, that there is an additional byte in front of the example data\n  cobs::encode(buffer, sizeof(buffer));\n  Serial.print(\"Encoded data: \");\n  printBuffer(buffer, sizeof(buffer));\n  Serial.println(\"00\"); // Add the final delimiter to complete the message\n\n  // Now decode the data again\n  cobs::decode(buffer, sizeof(buffer));\n\n  Serial.print(\"Decoded data: \");\n  printBuffer(buffer+1, sizeof(buffer)-1);\n}\n\nvoid loop() {\n\n}\n```\n\nInstallation\n-----\nCurrently the library does not support the Arduino library manager, so it is highly recommended to copy the full library to a subfolder called\n```\nsrc/\n```\nwithin your Arduino project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbaus%2Fcobs-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickbaus%2Fcobs-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbaus%2Fcobs-cpp/lists"}