{"id":20470234,"url":"https://github.com/houseos/scp","last_synced_at":"2025-06-15T21:10:55.321Z","repository":{"id":54111510,"uuid":"149658161","full_name":"houseos/SCP","owner":"houseos","description":"Arduino library for secure-control-protocol devices","archived":false,"fork":false,"pushed_at":"2022-03-18T10:48:29.000Z","size":734,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"development","last_synced_at":"2025-01-16T02:16:19.623Z","etag":null,"topics":["chacha20-poly1305","esp8266","http","iot","json","protocol","rest","security","wifi"],"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/houseos.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}},"created_at":"2018-09-20T19:13:39.000Z","updated_at":"2021-03-09T07:51:53.000Z","dependencies_parsed_at":"2022-08-13T06:50:48.549Z","dependency_job_id":null,"html_url":"https://github.com/houseos/SCP","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseos%2FSCP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseos%2FSCP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseos%2FSCP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseos%2FSCP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houseos","download_url":"https://codeload.github.com/houseos/SCP/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242033792,"owners_count":20061014,"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":["chacha20-poly1305","esp8266","http","iot","json","protocol","rest","security","wifi"],"created_at":"2024-11-15T14:12:12.566Z","updated_at":"2025-03-05T13:27:04.631Z","avatar_url":"https://github.com/houseos.png","language":"C++","readme":"# secure-control-protocol - Arduino Library\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FbenjaminSchilling33%2Fsecure-control-protocol.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FbenjaminSchilling33%2Fsecure-control-protocol?ref=badge_shield)\n\nThe protocol specification can be found in `doc/`.\n\n## Dependencies\n\nThe SCP Arduino library uses the rBase64 library and esp8266 core libraries.\n\nThey can be found in the repositories described in the library.json file.\n\n## Installation\n\nTo install the library copy it into your Arduino Libraries directory.\n\n## Integrating SCP\n\nWe made integrating SCP as easy as possible.\n\nSeveral examples of successful integrations can be found in the [scp-devices](https://github.com/HouseOS/scp-devices) repository.\n\nThe following Arduino Sketch outlines how the library can be included.\n\n```cpp\n// First include the SCP library and create a SCP object\n#include \u003cSCP.h\u003e\nSCP scp;\n//To register function pointers include the std::placeholders namespace\nusing namespace std::placeholders;\n\nvoid setup(void)\n{\n  pinMode(D5, OUTPUT);\n  pinMode(D6, OUTPUT);\n  Serial.begin(115200);\n  Serial.println(\"\");\n\n// Initialize the SCP object\n// First parameter is the device type\n// Second parameters contains all control actions\n// Third parameter contains all measure actions (in this case: none)\n  scp.init(\"shutter-control\", \"\\\"up\\\",\\\"down\\\",\\\"stop\\\"\", \"\");\n// Register your control functions.\n  scp.registerControlFunction(std::bind(control, _1));\n  scp.registerMeasureFunction(std::bind(measure, _1));\n}\n\n// In the control function define all supported actions, \n// each action is identified by a unique string\nvoid control(String action){\n  Serial.println(\"control: \" + action);\n  if(action == \"up\"){\n    digitalWrite(D5, 1);\n    digitalWrite(D6, 0);\n  }\n  if(action == \"down\"){\n    digitalWrite(D6, 1);\n    digitalWrite(D5, 0); \n  }\n  if(action == \"stop\"){\n    digitalWrite(D5, 0);\n    digitalWrite(D6, 0); \n  }\n}\n\n\ndouble measure(String action){\n  Serial.println(\"No measure action available.\");\n}\n\nvoid loop(void)\n{\n// In the loop call the handleClient \n// function to listen for HTTP requests\n  scp.handleClient();\n}\n```\n\n## License\n\nSPDX-License-Identifier: GPL-3.0-or-later\n\nThe full version of the license can be found in LICENSE. \n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FbenjaminSchilling33%2Fsecure-control-protocol.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FbenjaminSchilling33%2Fsecure-control-protocol?ref=badge_large)\n\nIf you need a license for commercial use, please contact [Benjamin Schilling](mailto:schilling.benjamin@delusionsoftware.de). \n\n## Copyright\nCopyright (C) 2018 - 2021 Benjamin Schilling\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseos%2Fscp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhouseos%2Fscp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseos%2Fscp/lists"}