Rename matter(-iot) to rs-matter; matter_macro_derive to rs-matter-macros; tlv_tool to just tlv
This commit is contained in:
parent
6bbac0b6e9
commit
bafedb022b
126 changed files with 94 additions and 121 deletions
7
.github/workflows/build-tlv-tool.yml
vendored
7
.github/workflows/build-tlv-tool.yml
vendored
|
@ -17,10 +17,9 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: cd tools/tlv_tool; cargo build --verbose
|
||||
run: cd tools/tlv; cargo build
|
||||
- name: Archive artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: tlv_tool
|
||||
path: tools/tlv_tool/target/debug/tlv_tool
|
||||
|
||||
name: tlv
|
||||
path: tools/tlv/target/debug/tlv
|
||||
|
|
4
.github/workflows/test-linux.yml
vendored
4
.github/workflows/test-linux.yml
vendored
|
@ -20,6 +20,6 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: cd matter; cargo build --no-default-features --features ${{matrix.crypto-backend}}
|
||||
run: cd rs-matter; cargo build --no-default-features --features ${{matrix.crypto-backend}}
|
||||
- name: Run tests
|
||||
run: cd matter; cargo test --no-default-features --features os,${{matrix.crypto-backend}} -- --test-threads=1
|
||||
run: cd rs-matter; cargo test --no-default-features --features os,${{matrix.crypto-backend}} -- --test-threads=1
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["matter", "matter_macro_derive"]
|
||||
members = ["rs-matter", "rs-matter-macros"]
|
||||
|
||||
exclude = ["examples/*", "tools/tlv_tool"]
|
||||
exclude = ["examples/*", "tools/tlv"]
|
||||
|
||||
# For compatibility with ESP IDF
|
||||
[patch.crates-io]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# matter-rs: The Rust Implementation of Matter
|
||||
# rs-matter: The Rust Implementation of Matter
|
||||
|
||||
 [](https://raw.githubusercontent.com/project-chip/matter-rs/main/LICENSE)
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
use matter::error::{Error, ErrorCode};
|
||||
use rs_matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
use rs_matter::error::{Error, ErrorCode};
|
||||
|
||||
pub struct HardCodedDevAtt {}
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 2020-2022 Project CHIP Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
pub mod dev_att;
|
|
@ -20,19 +20,19 @@ use core::pin::pin;
|
|||
|
||||
use embassy_futures::select::select3;
|
||||
use log::info;
|
||||
use matter::core::{CommissioningData, Matter};
|
||||
use matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
use matter::data_model::cluster_on_off;
|
||||
use matter::data_model::device_types::DEV_TYPE_ON_OFF_LIGHT;
|
||||
use matter::data_model::objects::*;
|
||||
use matter::data_model::root_endpoint;
|
||||
use matter::data_model::system_model::descriptor;
|
||||
use matter::error::Error;
|
||||
use matter::mdns::{MdnsRunBuffers, MdnsService};
|
||||
use matter::secure_channel::spake2p::VerifierData;
|
||||
use matter::transport::core::RunBuffers;
|
||||
use matter::transport::network::{Ipv4Addr, Ipv6Addr, NetworkStack};
|
||||
use matter::utils::select::EitherUnwrap;
|
||||
use rs_matter::core::{CommissioningData, Matter};
|
||||
use rs_matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
use rs_matter::data_model::cluster_on_off;
|
||||
use rs_matter::data_model::device_types::DEV_TYPE_ON_OFF_LIGHT;
|
||||
use rs_matter::data_model::objects::*;
|
||||
use rs_matter::data_model::root_endpoint;
|
||||
use rs_matter::data_model::system_model::descriptor;
|
||||
use rs_matter::error::Error;
|
||||
use rs_matter::mdns::{MdnsRunBuffers, MdnsService};
|
||||
use rs_matter::secure_channel::spake2p::VerifierData;
|
||||
use rs_matter::transport::core::RunBuffers;
|
||||
use rs_matter::transport::network::{Ipv4Addr, Ipv6Addr, NetworkStack};
|
||||
use rs_matter::utils::select::EitherUnwrap;
|
||||
|
||||
mod dev_att;
|
||||
|
||||
|
@ -79,26 +79,26 @@ fn run() -> Result<(), Error> {
|
|||
let dev_att = dev_att::HardCodedDevAtt::new();
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
let epoch = matter::utils::epoch::sys_epoch;
|
||||
let epoch = rs_matter::utils::epoch::sys_epoch;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
let rand = matter::utils::rand::sys_rand;
|
||||
let rand = rs_matter::utils::rand::sys_rand;
|
||||
|
||||
// NOTE (no_std): For no_std, provide your own function here
|
||||
#[cfg(not(feature = "std"))]
|
||||
let epoch = matter::utils::epoch::dummy_epoch;
|
||||
let epoch = rs_matter::utils::epoch::dummy_epoch;
|
||||
|
||||
// NOTE (no_std): For no_std, provide your own function here
|
||||
#[cfg(not(feature = "std"))]
|
||||
let rand = matter::utils::rand::dummy_rand;
|
||||
let rand = rs_matter::utils::rand::dummy_rand;
|
||||
|
||||
let mdns = MdnsService::new(
|
||||
0,
|
||||
"matter-demo",
|
||||
"rs-matter-demo",
|
||||
ipv4_addr.octets(),
|
||||
Some((ipv6_addr.octets(), interface)),
|
||||
&dev_det,
|
||||
matter::MATTER_PORT,
|
||||
rs_matter::MATTER_PORT,
|
||||
);
|
||||
|
||||
info!("mDNS initialized");
|
||||
|
@ -110,13 +110,13 @@ fn run() -> Result<(), Error> {
|
|||
&mdns,
|
||||
epoch,
|
||||
rand,
|
||||
matter::MATTER_PORT,
|
||||
rs_matter::MATTER_PORT,
|
||||
);
|
||||
|
||||
info!("Matter initialized");
|
||||
|
||||
#[cfg(all(feature = "std", not(target_os = "espidf")))]
|
||||
let mut psm = matter::persist::Psm::new(&matter, std::env::temp_dir().join("matter-iot"))?;
|
||||
let mut psm = rs_matter::persist::Psm::new(&matter, std::env::temp_dir().join("rs-matter"))?;
|
||||
|
||||
let handler = HandlerCompat(handler(&matter));
|
||||
|
||||
|
@ -223,8 +223,8 @@ fn initialize_logger() {
|
|||
#[inline(never)]
|
||||
fn initialize_network() -> Result<(Ipv4Addr, Ipv6Addr, u32), Error> {
|
||||
use log::error;
|
||||
use matter::error::ErrorCode;
|
||||
use nix::{net::if_::InterfaceFlags, sys::socket::SockaddrIn6};
|
||||
use rs_matter::error::ErrorCode;
|
||||
|
||||
let interfaces = || {
|
||||
nix::ifaddrs::getifaddrs().unwrap().filter(|ia| {
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
use matter::error::Error;
|
||||
use rs_matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
use rs_matter::error::Error;
|
||||
|
||||
pub struct HardCodedDevAtt {}
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 2020-2022 Project CHIP Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// TODO pub mod dev_att;
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
// TODO
|
||||
// mod dev_att;
|
||||
// use matter::core::{self, CommissioningData};
|
||||
// use matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
// use matter::data_model::cluster_media_playback::{Commands, MediaPlaybackCluster};
|
||||
// use matter::data_model::device_types::DEV_TYPE_ON_SMART_SPEAKER;
|
||||
// use matter::secure_channel::spake2p::VerifierData;
|
||||
// use rs_matter::core::{self, CommissioningData};
|
||||
// use rs_matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
// use rs_matter::data_model::cluster_media_playback::{Commands, MediaPlaybackCluster};
|
||||
// use rs_matter::data_model::device_types::DEV_TYPE_ON_SMART_SPEAKER;
|
||||
// use rs_matter::secure_channel::spake2p::VerifierData;
|
||||
|
||||
fn main() {
|
||||
// env_logger::init();
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use rs_matter::core::{self, CommissioningData};
|
||||
use rs_matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
use rs_matter::data_model::cluster_media_playback::{Commands, MediaPlaybackCluster};
|
||||
use rs_matter::data_model::device_types::DEV_TYPE_ON_SMART_SPEAKER;
|
||||
use rs_matter::secure_channel::spake2p::VerifierData;
|
||||
|
||||
mod dev_att;
|
||||
use matter::core::{self, CommissioningData};
|
||||
use matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
use matter::data_model::cluster_media_playback::{Commands, MediaPlaybackCluster};
|
||||
use matter::data_model::device_types::DEV_TYPE_ON_SMART_SPEAKER;
|
||||
use matter::secure_channel::spake2p::VerifierData;
|
||||
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "matter_macro_derive"
|
||||
name = "rs-matter-macros"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
5
rs-matter-macros/README.md
Normal file
5
rs-matter-macros/README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# rs-matter-macros
|
||||
|
||||
Proc-macros for implementing the `ToTLV` and `FromTLV` traits.
|
||||
|
||||
NOTE: The macros are re-exported by the `rs-matter` crate which should be used instead of adding a direct dependency on the `rs-matter-macros` crate.
|
|
@ -107,7 +107,7 @@ fn parse_tag_val(field: &syn::Field) -> Option<u8> {
|
|||
}
|
||||
|
||||
fn get_crate_name() -> String {
|
||||
let found_crate = proc_macro_crate::crate_name("matter-iot").unwrap_or_else(|err| {
|
||||
let found_crate = proc_macro_crate::crate_name("rs-matter").unwrap_or_else(|err| {
|
||||
eprintln!("Warning: defaulting to `crate` {err}");
|
||||
proc_macro_crate::FoundCrate::Itself
|
||||
});
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "matter-iot"
|
||||
name = "rs-matter"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["Kedar Sovani <kedars@gmail.com>"]
|
||||
|
@ -11,7 +11,7 @@ categories = ["embedded", "network-programming"]
|
|||
license = "Apache-2.0"
|
||||
|
||||
[lib]
|
||||
name = "matter"
|
||||
name = "rs_matter"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[features]
|
||||
|
@ -28,7 +28,7 @@ rustcrypto = ["alloc", "sha2", "hmac", "pbkdf2", "hkdf", "aes", "ccm", "p256", "
|
|||
embassy-net = ["dep:embassy-net", "dep:embassy-net-driver", "smoltcp"]
|
||||
|
||||
[dependencies]
|
||||
matter_macro_derive = { path = "../matter_macro_derive" }
|
||||
rs-matter-macros = { path = "../rs-matter-macros" }
|
||||
bitflags = { version = "1.3", default-features = false }
|
||||
byteorder = { version = "1.4.3", default-features = false }
|
||||
heapless = "0.7.16"
|
3
rs-matter/README.md
Normal file
3
rs-matter/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# rs-matter: The Rust Implementation of Matter Library
|
||||
|
||||
This is the actual `rs-matter` library crate. See [the main README file](../README.md) for more information.
|
|
@ -24,13 +24,13 @@
|
|||
//!
|
||||
//! # Examples
|
||||
//! TODO: Fix once new API has stabilized a bit
|
||||
//! use matter::{Matter, CommissioningData};
|
||||
//! use matter::data_model::device_types::device_type_add_on_off_light;
|
||||
//! use matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
//! use matter::secure_channel::spake2p::VerifierData;
|
||||
//! use rs_matter::{Matter, CommissioningData};
|
||||
//! use rs_matter::data_model::device_types::device_type_add_on_off_light;
|
||||
//! use rs_matter::data_model::cluster_basic_information::BasicInfoConfig;
|
||||
//! use rs_matter::secure_channel::spake2p::VerifierData;
|
||||
//!
|
||||
//! # use matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
//! # use matter::error::Error;
|
||||
//! # use rs_matter::data_model::sdm::dev_att::{DataType, DevAttDataFetcher};
|
||||
//! # use rs_matter::error::Error;
|
||||
//! # pub struct DevAtt{}
|
||||
//! # impl DevAttDataFetcher for DevAtt{
|
||||
//! # fn get_devatt_data(&self, data_type: DataType, data: &mut [u8]) -> Result<usize, Error> { Ok(0) }
|
|
@ -47,7 +47,7 @@ mod parser;
|
|||
mod traits;
|
||||
mod writer;
|
||||
|
||||
pub use matter_macro_derive::{FromTLV, ToTLV};
|
||||
pub use parser::*;
|
||||
pub use rs_matter_macros::{FromTLV, ToTLV};
|
||||
pub use traits::*;
|
||||
pub use writer::*;
|
|
@ -450,7 +450,7 @@ impl<'a> ToTLV for TLVElement<'a> {
|
|||
mod tests {
|
||||
use super::{FromTLV, OctetStr, TLVWriter, TagType, ToTLV};
|
||||
use crate::{error::Error, tlv::TLVList, utils::writebuf::WriteBuf};
|
||||
use matter_macro_derive::{FromTLV, ToTLV};
|
||||
use rs_matter_macros::{FromTLV, ToTLV};
|
||||
|
||||
#[derive(ToTLV)]
|
||||
struct TestDerive {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue