1 // Copyright (C) 2023 Huawei Device Co., Ltd. 2 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // you may not use this file except in compliance with the License. 4 // You may obtain a copy of the License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 //! Request Ipc Code 15 16 /// Construct a new request. 17 pub const CONSTRUCT: u32 = 0; 18 /// Pause A Request. 19 pub const PAUSE: u32 = 1; 20 /// Query a request. 21 pub const QUERY: u32 = 2; 22 /// Query a request's mime type. 23 pub const QUERY_MIME_TYPE: u32 = 3; 24 /// Remove a request. 25 pub const REMOVE: u32 = 4; 26 /// Resume a request. 27 pub const RESUME: u32 = 5; 28 /// Start a request. 29 pub const START: u32 = 6; 30 /// Stop a request. 31 pub const STOP: u32 = 7; 32 /// Show a request. 33 pub const SHOW: u32 = 8; 34 /// Touch a request. 35 pub const TOUCH: u32 = 9; 36 /// Search a request. 37 pub const SEARCH: u32 = 10; 38 /// Get a task. 39 pub const GET_TASK: u32 = 11; 40 /// Clear a request. 41 pub const CLEAR: u32 = 12; 42 /// Open a channel. 43 pub const OPEN_CHANNEL: u32 = 13; 44 /// Subscribe a request. 45 pub const SUBSCRIBE: u32 = 14; 46 /// Unsubscribe a request. 47 pub const UNSUBSCRIBE: u32 = 15; 48 /// Subscribe run count. 49 pub const SUB_RUN_COUNT: u32 = 16; 50 /// Unsubscribe run count. 51 pub const UNSUB_RUN_COUNT: u32 = 17; 52 /// Create a group. 53 pub const CREATE_GROUP: u32 = 18; 54 /// Attach a group. 55 pub const ATTACH_GROUP: u32 = 19; 56 /// Delete a group. 57 pub const DELETE_GROUP: u32 = 20; 58 /// Set the max speed of a task 59 pub const SET_MAX_SPEED: u32 = 21; 60 /// Show a task's progress. 61 pub const SHOW_PROGRESS: u32 = 22; 62 /// Change task mode. 63 pub const SET_MODE: u32 = 100; 64 /// Change task mode. 65 pub const DISABLE_TASK_NOTIFICATION: u32 = 101; 66 67 /// Function code of RequestNotifyInterfaceCode 68 pub(crate) const NOTIFY_RUN_COUNT: u32 = 2; 69 70 #[cfg(test)] 71 mod test { 72 use super::*; 73 #[test] ut_interface()74 fn ut_interface() { 75 assert_eq!(0, CONSTRUCT); 76 assert_eq!(1, PAUSE); 77 assert_eq!(2, QUERY); 78 assert_eq!(3, QUERY_MIME_TYPE); 79 assert_eq!(4, REMOVE); 80 assert_eq!(5, RESUME); 81 assert_eq!(6, START); 82 assert_eq!(7, STOP); 83 assert_eq!(8, SHOW); 84 assert_eq!(9, TOUCH); 85 assert_eq!(10, SEARCH); 86 assert_eq!(11, GET_TASK); 87 assert_eq!(12, CLEAR); 88 assert_eq!(13, OPEN_CHANNEL); 89 assert_eq!(14, SUBSCRIBE); 90 assert_eq!(15, UNSUBSCRIBE); 91 assert_eq!(16, SUB_RUN_COUNT); 92 assert_eq!(17, UNSUB_RUN_COUNT); 93 assert_eq!(18, CREATE_GROUP); 94 assert_eq!(19, ATTACH_GROUP); 95 assert_eq!(20, DELETE_GROUP); 96 assert_eq!(100, SET_MODE); 97 assert_eq!(101, DISABLE_TASK_NOTIFICATION); 98 } 99 } 100