{"id":19277615,"url":"https://github.com/wolkabout/wolkconnect-cpp","last_synced_at":"2025-04-22T00:31:02.320Z","repository":{"id":26320025,"uuid":"105018682","full_name":"Wolkabout/WolkConnect-Cpp","owner":"Wolkabout","description":"C++11 library which provides easy connectivity to WolkAbout IoT Platform.","archived":false,"fork":false,"pushed_at":"2024-06-14T10:01:30.000Z","size":1456,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-14T11:25:57.946Z","etag":null,"topics":["client-library","connectivity","cpp","fota","iot","iot-platform","wolkabout","wolkconnect"],"latest_commit_sha":null,"homepage":"https://demo.wolkabout.com","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/Wolkabout.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":"2017-09-27T13:00:01.000Z","updated_at":"2024-06-14T11:26:00.682Z","dependencies_parsed_at":"2022-07-05T22:01:29.673Z","dependency_job_id":"6e0dabd9-0cc1-4624-8b87-c30d4263a333","html_url":"https://github.com/Wolkabout/WolkConnect-Cpp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wolkabout%2FWolkConnect-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wolkabout%2FWolkConnect-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wolkabout%2FWolkConnect-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wolkabout%2FWolkConnect-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wolkabout","download_url":"https://codeload.github.com/Wolkabout/WolkConnect-Cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223881912,"owners_count":17219269,"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":["client-library","connectivity","cpp","fota","iot","iot-platform","wolkabout","wolkconnect"],"created_at":"2024-11-09T21:06:28.125Z","updated_at":"2024-11-09T21:06:28.586Z","avatar_url":"https://github.com/Wolkabout.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n██╗    ██╗ ██████╗ ██╗     ██╗  ██╗ ██████╗ ██████╗ ███╗   ██╗███╗   ██╗███████╗ ██████╗████████╗\n██║    ██║██╔═══██╗██║     ██║ ██╔╝██╔════╝██╔═══██╗████╗  ██║████╗  ██║██╔════╝██╔════╝╚══██╔══╝\n██║ █╗ ██║██║   ██║██║     █████╔╝ ██║     ██║   ██║██╔██╗ ██║██╔██╗ ██║█████╗  ██║        ██║   \n██║███╗██║██║   ██║██║     ██╔═██╗ ██║     ██║   ██║██║╚██╗██║██║╚██╗██║██╔══╝  ██║        ██║   \n╚███╔███╔╝╚██████╔╝███████╗██║  ██╗╚██████╗╚██████╔╝██║ ╚████║██║ ╚████║███████╗╚██████╗   ██║   \n ╚══╝╚══╝  ╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝ ╚═════╝   ╚═╝   \n                                                                                                 \n                                                                          ██████╗██████╗ ██████╗ \n                                                                         ██╔════╝██╔══██╗██╔══██╗\n                                                                   █████╗██║     ██████╔╝██████╔╝\n                                                                   ╚════╝██║     ██╔═══╝ ██╔═══╝ \n                                                                         ╚██████╗██║     ██║     \n                                                                          ╚═════╝╚═╝     ╚═╝     \n```\n\n----\nWolkAbout C++11 Connector library for connecting devices to WolkAbout IoT platform instance\n.\n\nSupported protocol:\n\n- Wolkabout Protocol/Digital Twin (22.GA)\n\n## Installing from source\n\nThis repository must be cloned from the command line using:\n\n```sh\ngit clone --recurse-submodules https://github.com/Wolkabout/WolkConnect-Cpp.git\n```\n\n### Prerequisite\n\nFollowing tools/libraries are required in order to build WolkAbout C++ connector:\n\n- CMake (version 3.5+)\n- GNU C++ Compiler\n- LibSSL\n- PThread\n\nAnd all of them can be installed this way:\n\n```shell\napt update\napt install cmake g++ libssl-dev libpthread-stubs0-dev\n```\n\n### Configuring \u0026 Building\n\nAfterwards dependencies are installed, the Makefile build system can be generated by invoking:\n\n```shell\ncd WolkConnect-Cpp # Change the directory if you haven't\n./configure.sh\n```\n\nGenerated build system is located inside `out` directory\n\n```shell\ncd out # Change the directory if you haven't\nmake -j$(nproc) # Make the library\nmake tests -j$(nproc) # Make and run the tests\nmake full_example/pull_example/register_example/simple_example -j$(nproc) # Make any of the examples\n```\n\n## Example Usage\n\nThere are 4 examples that each show some other functionalities of the WolkConnect-Cpp:\n\n- [Simple Example](./examples/simple/Application.cpp) - Simplest PUSH device just sending data periodically.\n- [Register Example](./examples/register_feed_and_attribute/Application.cpp) - Device registering its own feed and\n  attribute.\n- [Pull Example](./examples/pull/Application.cpp) - Device that is periodically connected to the platform and does data\n  PULL when online.\n- [Full Feature Example](./examples/full_feature/Application.cpp) - A fully featured device with File Management and\n  Firmware Update functionality.\n\n## Basic Guide\n\n**Establishing connection with WolkAbout IoT platform:**\n\n```c++\n// Defining device information\nauto device = wolkabout::Device(DEVICE_KEY, DEVICE_PASSWORD, wolkabout::OutboundDataMode::PUSH /* or PULL */);\n\n// Creating the Wolk instance\nauto wolk = wolkabout::Wolk::newBuilder(device).host(PLATFORM_HOST).build();\n\n// Connecting to the platform\nwolk-\u003econnect();\n```\n\nHere we're going to list out all the `WolkBuilder` methods. Note, these all are optional calls, all of them have some\ndefault value already set:\n\n```c++\n// Creating the Wolk instance\nauto wolkBuilder = wolkabout::Wolk::newBuilder(device)\n        .host(PLATFORM_HOST) // Sets the MQTT broker path - used to connect with the platform\n        .caCertPath(CA_CERT_PATH) // Path to a `ca.crt` file - used to establish a secure connection with the platform\n        .feedUpdateHandler(...) // Sets the callback which will receive FeedValues updates sent by the platform\n        .parameterHandler(...) // Set the callback which will receive Parameter updates sent by the platform\n        .withPersistence(...) // Sets the default message persistence - used while the connection is offline\n        .withDataProtocol(...) // Sets a custom DataProtocol implementation\n        .withFileTransfer(...) // Enables the FileManagement functionality with only platform transfers enabled - Use only if device is PUSH\n        .withFileURLDownload(...) // Enables the FileManagement functionality with the File URL downloading enabled (and platform transfers optionally) - Use only if device is PUSH\n        .withFileListener(...) // Sets an object that will receive information about newly added/removed files - Use only if device is PUSH\n        .withFirmwareUpdate(...) // Enables the FirmwareUpdate functionality in either FirmwareInstall mode (for PUSH devices) or FirmwareParametersListener (for PULL devices).\n```\n\n**Connecting and disconnecting**\n\n```c++\nwolk-\u003econnect();\n\nwolk-\u003edisconnect();\n```\n\n**Publishing feed values:**\n\n```c++\nwolk-\u003eaddReading(\"T\", 20.4);\nwolk-\u003eaddReading(\"SW\", false, 1638537962000); // Optional timestamp value in milliseconds\n```\n\n**Registering feeds and attributes**\n\n```c++\n// Defining a feed\nauto feed = Feed{\"New Feed Name\", \"NFN\", wolkabout::FeedType::IN, wolkabout::Unit::NUMERIC};\nwolk-\u003eregisterFeed(feed);\n\n// Defining an attribute\nauto attribute = wolkabout::Attribute{\"New Attribute\", wolkabout::DataType::NUMERIC,\n                                      std::to_string(std::chrono::system_clock::now().time_since_epoch().count())};\nwolk-\u003eaddAttribute(attribute);\n```\n\n**Removing feeds**\n\n```c++\nwolk-\u003eremoveFeed(\"NFN\"); // Reference of the feed we registered above.\n```\n\n**Updating parameters**\u003cbr/\u003e\n*Be careful with updating parameters!*\n\n```c++\nwolk-\u003eupdateParameter(wolkabout::ParameterName::EXTERNAL_ID, \"Device ID\");\n```\n\n**Pulling feed values \u0026 parameters**\n\nIf you have set a `FeedValueHandler` using `.feedUpdateHandler()`, or `ParameterHandler` using `.parameterHandler()`,\nyou can use pull methods to receive values:\n\n```c++\nwolk-\u003epullFeedValues();\nwolk-\u003epullParameters();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolkabout%2Fwolkconnect-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolkabout%2Fwolkconnect-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolkabout%2Fwolkconnect-cpp/lists"}