{"id":38850509,"url":"https://github.com/daed/espidf-nats","last_synced_at":"2026-01-17T14:11:57.300Z","repository":{"id":310439483,"uuid":"1039839711","full_name":"daed/espidf-nats","owner":"daed","description":"A shallow port of arduino-nats to the ESP-IDF framework","archived":false,"fork":false,"pushed_at":"2025-08-18T04:18:59.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-18T06:24:49.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/daed.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":"2025-08-18T04:10:59.000Z","updated_at":"2025-08-18T04:19:03.000Z","dependencies_parsed_at":"2025-08-18T06:24:53.127Z","dependency_job_id":"b217fd21-5c7d-4b09-8833-ede17b756e94","html_url":"https://github.com/daed/espidf-nats","commit_stats":null,"previous_names":["daed/espidf-nats"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/daed/espidf-nats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daed%2Fespidf-nats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daed%2Fespidf-nats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daed%2Fespidf-nats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daed%2Fespidf-nats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daed","download_url":"https://codeload.github.com/daed/espidf-nats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daed%2Fespidf-nats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-17T14:11:57.207Z","updated_at":"2026-01-17T14:11:57.289Z","avatar_url":"https://github.com/daed.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NATS - ESP-IDF Client\n\nAn ESP-IDF and FreeRTOS (probably) compatible C++ library for communicating with a [NATS](http://nats.io) server.\n\nThis module is was ported from https://github.com/isobit/arduino-nats and aims to remain compatible with it.\n\n## Features\n\n- Header-only library\n- Compatible with Ethernet and WiFi-capable ESP32s\n- Familiar C++ object-oriented API, similar usage to the official NATS client\n  APIs\n- Automatically attempts to reconnect to NATS server if the connection is dropped\n\n### Manual\n\nJust download [`espidf_nats.h`](https://raw.githubusercontent.com/daed/espidf-nats/master/espidf_nats.h) and include it in your code.\n\n## API\n\n```c\nclass NATS {\n\ttypedef struct {\n\t\tconst char* subject;\n\t\tconst int sid;\n\t\tconst char* reply;\n\t\tconst char* data;\n\t\tconst int size;\n\t} msg;\n\n\ttypedef void (*sub_cb)(msg e);\n\ttypedef void (*event_cb)();\n\n\tNATS(\n\t\tconst char* hostname,\n\t\tint port = NATS_DEFAULT_PORT,\n\t\tconst char* user = NULL,\n\t\tconst char* pass = NULL\n\t);\n\n\tbool connect();\t\t\t// initiate the connection\n\tvoid disconnect();      // close the connection\n\n\tbool connected;\t\t\t// whether or not the client is connected\n\n\tint max_outstanding_pings;\t// number of outstanding pings to allow before considering the connection closed (default 3)\n\tint max_reconnect_attempts; // number of times to attempt reconnects, -1 means no maximum (default -1)\n\n\tevent_cb on_connect;    // called after NATS finishes connecting to server\n\tevent_cb on_disconnect; // called when a disconnect happens\n\tevent_cb on_error;\t\t// called when an error is received\n\n\tvoid publish(const char* subject, const char* msg = NULL, const char* replyto = NULL);\n\tvoid publish(const char* subject, const bool msg);\n\tvoid publishf(const char* subject, const char* fmt, ...);\n\n\tint subscribe(const char* subject, sub_cb cb, const char* queue = NULL, const int max_wanted = 0);\n\tvoid unsubscribe(const int sid);\n\n\tint request(const char* subject, const char* msg, sub_cb cb, const int max_wanted = 1);\n\n\tvoid process();\t\t\t// process pending messages from the buffer, must be called regularly in loop()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaed%2Fespidf-nats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaed%2Fespidf-nats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaed%2Fespidf-nats/lists"}