1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 //! Implementation of multi-device cooperation. 17 18 #![allow(dead_code)] 19 20 use std::ffi::{ c_char, CString }; 21 22 use hilog_rust::{ hilog, HiLogLabel, LogType }; 23 24 use fusion_data_rust::{ GeneralCoordinationParam, StartCoordinationParam, CallingContext, 25 StopCoordinationParam, GetCoordinationStateParam }; 26 use fusion_utils_rust::{ call_debug_enter, FusionResult, FusionErrorCode }; 27 28 const LOG_LABEL: HiLogLabel = HiLogLabel { 29 log_type: LogType::LogCore, 30 domain: 0xD002220, 31 tag: "Coordination" 32 }; 33 34 #[derive(Default)] 35 pub struct Coordination(i32); 36 37 impl Coordination { enable(&self, context: &CallingContext, param: &GeneralCoordinationParam) -> FusionResult<()>38 pub fn enable(&self, context: &CallingContext, 39 param: &GeneralCoordinationParam) -> FusionResult<()> 40 { 41 call_debug_enter!("Coordination::enable"); 42 Err(FusionErrorCode::Fail) 43 } 44 disable(&self, context: &CallingContext, param: &GeneralCoordinationParam) -> FusionResult<()>45 pub fn disable(&self, context: &CallingContext, 46 param: &GeneralCoordinationParam) -> FusionResult<()> 47 { 48 call_debug_enter!("Coordination::disable"); 49 Err(FusionErrorCode::Fail) 50 } 51 start(&self, context: &CallingContext, param: &StartCoordinationParam) -> FusionResult<()>52 pub fn start(&self, context: &CallingContext, 53 param: &StartCoordinationParam) -> FusionResult<()> 54 { 55 call_debug_enter!("Coordination::start"); 56 Err(FusionErrorCode::Fail) 57 } 58 stop(&self, context: &CallingContext, param: &StopCoordinationParam) -> FusionResult<()>59 pub fn stop(&self, context: &CallingContext, 60 param: &StopCoordinationParam) -> FusionResult<()> 61 { 62 call_debug_enter!("Coordination::stop"); 63 Err(FusionErrorCode::Fail) 64 } 65 get_state(&self, context: &CallingContext, param: &GetCoordinationStateParam) -> FusionResult<()>66 pub fn get_state(&self, context: &CallingContext, 67 param: &GetCoordinationStateParam) -> FusionResult<()> 68 { 69 call_debug_enter!("Coordination::get_state"); 70 Err(FusionErrorCode::Fail) 71 } 72 register_listener(&self, context: &CallingContext, param: &GeneralCoordinationParam) -> FusionResult<()>73 pub fn register_listener(&self, context: &CallingContext, 74 param: &GeneralCoordinationParam) -> FusionResult<()> 75 { 76 call_debug_enter!("Coordination::register_listener"); 77 Err(FusionErrorCode::Fail) 78 } 79 unregister_listener(&self, context: &CallingContext, param: &GeneralCoordinationParam) -> FusionResult<()>80 pub fn unregister_listener(&self, context: &CallingContext, 81 param: &GeneralCoordinationParam) -> FusionResult<()> 82 { 83 call_debug_enter!("Coordination::unregister_listener"); 84 Err(FusionErrorCode::Fail) 85 } 86 } 87