Rename all device cxx methods from _Rust -> _Cxx
Bug: 284156955
Change-Id: I780c5043bce388947255d7dff71d19f132aa9696
diff --git a/rust/netsim-cxx/src/devices/devices_handler.rs b/rust/netsim-cxx/src/devices/devices_handler.rs
index 3a6cd15..fa68519 100644
--- a/rust/netsim-cxx/src/devices/devices_handler.rs
+++ b/rust/netsim-cxx/src/devices/devices_handler.rs
@@ -122,7 +122,7 @@
/// An AddChip function for Rust Device API.
/// The backend gRPC code will be invoking this method.
-pub fn add_chip_rust(
+pub fn add_chip_cxx(
device_guid: &str,
device_name: &str,
chip_kind: &CxxString,
@@ -218,7 +218,7 @@
/// A RemoveChip function for Rust Device API.
/// The backend gRPC code will be invoking this method.
-pub fn remove_chip_rust(device_id: u32, chip_id: u32) {
+pub fn remove_chip_cxx(device_id: u32, chip_id: u32) {
match remove_chip(device_id as i32, chip_id as i32) {
Ok(_) => info!("Rust Device API Remove Chip Success"),
Err(err) => error!("Rust Device API Remove Chip Failure: {err}"),
@@ -287,7 +287,7 @@
/// A GetDistance function for Rust Device API.
/// The backend gRPC code will be invoking this method.
-pub fn get_distance_rust(a: u32, b: u32) -> f32 {
+pub fn get_distance_cxx(a: u32, b: u32) -> f32 {
match get_distance(a as i32, b as i32) {
Ok(distance) => distance,
Err(err) => {
diff --git a/rust/netsim-cxx/src/lib.rs b/rust/netsim-cxx/src/lib.rs
index 70798eb..ff18c92 100644
--- a/rust/netsim-cxx/src/lib.rs
+++ b/rust/netsim-cxx/src/lib.rs
@@ -46,7 +46,7 @@
};
use crate::config::{get_dev, set_dev};
use crate::devices::devices_handler::{
- add_chip_rust, get_distance_rust, handle_device_cxx, is_shutdown_time_cxx, remove_chip_rust,
+ add_chip_cxx, get_distance_cxx, handle_device_cxx, is_shutdown_time_cxx, remove_chip_cxx,
};
use crate::http_server::run_http_server;
use crate::ranging::*;
@@ -124,9 +124,9 @@
fn unregister_grpc_transport(kind: u32, facade_id: u32);
// Device Resource
- #[cxx_name = AddChipRust]
+ #[cxx_name = AddChipCxx]
#[namespace = "netsim::device"]
- fn add_chip_rust(
+ fn add_chip_cxx(
device_guid: &str,
device_name: &str,
chip_kind: &CxxString,
@@ -135,13 +135,13 @@
chip_product_name: &str,
) -> UniquePtr<AddChipResult>;
- #[cxx_name = RemoveChipRust]
+ #[cxx_name = RemoveChipCxx]
#[namespace = "netsim::device"]
- fn remove_chip_rust(device_id: u32, chip_id: u32);
+ fn remove_chip_cxx(device_id: u32, chip_id: u32);
- #[cxx_name = GetDistanceRust]
+ #[cxx_name = GetDistanceCxx]
#[namespace = "netsim::device"]
- fn get_distance_rust(a: u32, b: u32) -> f32;
+ fn get_distance_cxx(a: u32, b: u32) -> f32;
#[cxx_name = IsShutdownTimeCxx]
#[namespace = "netsim::device"]
diff --git a/src/controller/scene_controller.cc b/src/controller/scene_controller.cc
index 86d046d..b600757 100644
--- a/src/controller/scene_controller.cc
+++ b/src/controller/scene_controller.cc
@@ -63,8 +63,8 @@
break;
}
std::unique_ptr<scene_controller::AddChipResult> add_chip_result_ptr =
- netsim::device::AddChipRust(guid, device_name, chip_kind_string,
- chip_name, manufacturer, product_name);
+ netsim::device::AddChipCxx(guid, device_name, chip_kind_string, chip_name,
+ manufacturer, product_name);
uint32_t device_id = add_chip_result_ptr->device_id;
uint32_t chip_id = add_chip_result_ptr->chip_id;
uint32_t facade_id = add_chip_result_ptr->facade_id;
@@ -96,7 +96,7 @@
void SceneController::RemoveChip(uint32_t device_id, uint32_t chip_id) {
std::unique_lock<std::mutex> lock(this->mutex_);
- netsim::device::RemoveChipRust(device_id, chip_id);
+ netsim::device::RemoveChipCxx(device_id, chip_id);
}
// Returns a Device shared_ptr or nullptr
@@ -137,7 +137,7 @@
// Euclidian distance between two devices.
float SceneController::GetDistance(uint32_t id, uint32_t other_id) {
- return netsim::device::GetDistanceRust(id, other_id);
+ return netsim::device::GetDistanceCxx(id, other_id);
}
void SceneController::Reset() {