1 /* 2 * Copyright (C) 2022 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 #ifndef FRAMEWORKS_SERVICES_MEDIA_MTP_INCLUDE_MTP_CONTEXT_H_ 16 #define FRAMEWORKS_SERVICES_MEDIA_MTP_INCLUDE_MTP_CONTEXT_H_ 17 #include <memory> 18 #include <stdint.h> 19 #include "mtp_constants.h" 20 #include "storage.h" 21 #include "mtp_driver.h" 22 namespace OHOS { 23 namespace Media { 24 struct MtpOperationContext { 25 uint16_t operationCode {0}; 26 uint32_t transactionID {0}; 27 uint32_t devicePropertyCode {0}; 28 uint32_t storageID {0}; 29 uint16_t format {0}; 30 uint32_t parent {0}; 31 uint32_t handle {0}; 32 uint32_t property {0}; 33 uint32_t groupCode {0}; 34 uint32_t depth {0}; 35 int properType = MTP_TYPE_UNDEFINED_CODE; 36 std::string properStrValue; 37 int64_t properIntValue {0}; 38 std::shared_ptr<UInt32List> handles; 39 uint32_t sendObjectFileSize {0}; 40 std::string name; 41 std::string created; 42 std::string modified; 43 uint64_t offset {0}; 44 uint32_t length {0}; 45 46 bool indata {false}; 47 uint32_t storageInfoID {0}; 48 49 bool sessionOpen {false}; 50 uint32_t sessionID {0}; 51 std::shared_ptr<MtpDriver> mtpDriver; 52 uint32_t tempSessionID {0}; 53 uint32_t eventHandle {0}; 54 uint32_t eventProperty {0}; 55 }; 56 } // namespace Media 57 } // namespace OHOS 58 #endif // FRAMEWORKS_SERVICES_MEDIA_MTP_INCLUDE_MTP_CONTEXT_H_ 59