{"id":21686713,"url":"https://github.com/jgosmann/bsec","last_synced_at":"2025-04-12T08:22:02.540Z","repository":{"id":62438550,"uuid":"363698852","full_name":"jgosmann/bsec","owner":"jgosmann","description":"Rust API to the Bosch BSEC library.","archived":false,"fork":false,"pushed_at":"2024-10-27T10:46:26.000Z","size":119,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T03:33:08.867Z","etag":null,"topics":["bsec","bsec-library","embedded","rust-bindings"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jgosmann.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2021-05-02T16:36:06.000Z","updated_at":"2024-10-19T18:43:18.000Z","dependencies_parsed_at":"2024-10-27T11:55:36.235Z","dependency_job_id":null,"html_url":"https://github.com/jgosmann/bsec","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"fcf1d12f7d58008d6d52ddb2447931e9240fb5fb"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgosmann%2Fbsec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgosmann%2Fbsec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgosmann%2Fbsec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgosmann%2Fbsec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgosmann","download_url":"https://codeload.github.com/jgosmann/bsec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537417,"owners_count":21120755,"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":["bsec","bsec-library","embedded","rust-bindings"],"created_at":"2024-11-25T16:32:08.720Z","updated_at":"2025-04-12T08:22:02.515Z","avatar_url":"https://github.com/jgosmann.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bsec crate\n\nRust API to the\n[Bosch BSEC library](https://www.bosch-sensortec.com/software-tools/software/bsec/).\n\nThis readme will use *bsec* to refer to this crate, while\n*Bosch BSEC* is used to refer to the original BSEC library provided by\nBosch.\n\n\n## Important license information\n\nThe *Bosch BSEC* library is proprietary. Thus, the *Bosch BSEC* library and\nits documentation cannot be included in the *bsec* Rust crate and need to be\nobtained separately.\n\nWhile the *bsec* documentation covers the Rust crate itself, you will likely\nhave to refer to the *Bosch BSEC* documentation at some points to get a full\nunderstanding.\n\nYou are responsible for adhering to the Bosch BSEC lincese terms in your\nproducts, despite the Rust API in this crate being published under a\npermissive license.\n\n* [Bosch BSEC website to obtain your copy](https://www.bosch-sensortec.com/software-tools/software/bsec/)\n* [Bosch BESC license terms at the time of writing](https://www.bosch-sensortec.com/media/boschsensortec/downloads/bsec/2017-07-17_clickthrough_license_terms_environmentalib_sw_clean.pdf)\n\n\n## Features\n\n* Safe Rust API bindings to the *Bosch BSEC* library.\n* Implementation to use it with the\n  [BME680](https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme680/)\n  sensor.\n* Extensible to other sensors.\n* Rudimentary fake sensor implementation to use in unit tests.\n\n\n## Documentation\n\n[The crate documentation can be found on docs.rs.](https://docs.rs/bsec/latest/bsec/index.html)\n\n\n## Getting started\n\n[See the crate documentation.](https://docs.rs/bsec/latest/bsec/index.html#getting-started)\n\n\n## Usage example\n\n```rust\nuse bsec::{Bsec, Input, InputKind, OutputKind, clock::Clock, SampleRate, SubscriptionRequest};\nuse nb::block;\nuse std::time::Duration;\n\n// Acquire handle to the BSEC library.\n// Only one such handle can be acquired at any time.\nlet mut bsec: Bsec\u003c_, TimePassed, _\u003e = Bsec::init(sensor, \u0026clock)?;\n\n// Configure the outputs you want to subscribe to.\nbsec.update_subscription(\u0026[\n    SubscriptionRequest {\n        sample_rate: SampleRate::Lp,\n        sensor: OutputKind::Iaq,\n    },\n])?;\n\n// We need to feed BSEC regularly with new measurements.\nloop {\n    // Wait for when the next measurement is due.\n    sleep_for(Duration::from_nanos((bsec.next_measurement() - clock.timestamp_ns()) as u64));\n\n    // Start the measurement.\n    let wait_duration = block!(bsec.start_next_measurement())?;\n    sleep_for(wait_duration);\n    # clock.advance_by(wait_duration);\n\n    // Process the measurement when ready and print the BSEC outputs.\n    let outputs = block!(bsec.process_last_measurement())?;\n    for output in \u0026outputs {\n        println!(\"{:?}: {}\", output.sensor, output.signal);\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgosmann%2Fbsec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgosmann%2Fbsec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgosmann%2Fbsec/lists"}