summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChih-Yu Huang <akahuang@google.com>2022-03-15 15:29:19 +0900
committerChih-Yu Huang <akahuang@google.com>2022-03-16 10:10:55 +0900
commit8a806ae55f38660ac84cff9f1ec8c000134fc8a5 (patch)
tree6293c6636b58bb4726810e851dbc2e9eb1b2c40f /src
parente374838eaf454b5c1c96c3b9f0a0b5b2a99b025a (diff)
downloaduwb-8a806ae55f38660ac84cff9f1ec8c000134fc8a5.tar.gz
uwb_core: create the UWB core library
This CL creates an empty Rust crate "uwb_core", and setups the Android build config for it. Now we can build the crate by either "cargo build" or "mmm external/uwb". Bug: 224686845 Test: mmm external/uwb -j32 Test: Run "cargo test" at external/uwb/rust/uwb_core Test: atest libuwb_core_tests --host Change-Id: If361dc5d5dece630a065ad0794a60de82ae49401
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Android.bp19
-rw-r--r--src/rust/uwb_core/Cargo.toml6
-rw-r--r--src/rust/uwb_core/src/lib.rs15
3 files changed, 40 insertions, 0 deletions
diff --git a/src/Android.bp b/src/Android.bp
index 618e7bc..d0e15d0 100755
--- a/src/Android.bp
+++ b/src/Android.bp
@@ -129,3 +129,22 @@ genrule {
"rust/uwb_uci_packets/uci_packets.rs",
],
}
+
+rust_defaults {
+ name: "libuwb_core_defaults",
+ srcs: ["rust/uwb_core/src/lib.rs"],
+ lints: "android",
+ clippy_lints: "android",
+ host_supported: true,
+}
+
+rust_library {
+ name: "libuwb_core",
+ defaults: ["libuwb_core_defaults"],
+ crate_name: "uwb_core",
+}
+
+rust_test {
+ name: "libuwb_core_tests",
+ defaults: ["libuwb_core_defaults"],
+}
diff --git a/src/rust/uwb_core/Cargo.toml b/src/rust/uwb_core/Cargo.toml
new file mode 100644
index 0000000..35a852f
--- /dev/null
+++ b/src/rust/uwb_core/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "uwb_core"
+version = "0.0.1"
+edition = "2018"
+
+[dependencies]
diff --git a/src/rust/uwb_core/src/lib.rs b/src/rust/uwb_core/src/lib.rs
new file mode 100644
index 0000000..27bc7d8
--- /dev/null
+++ b/src/rust/uwb_core/src/lib.rs
@@ -0,0 +1,15 @@
+// Copyright 2022, The Android Open Source Project
+//
+// 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.
+
+//! The library provides the core logic of Ultra-wide band (UWB) technology.