• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef DATA_REQUEST_H
17 #define DATA_REQUEST_H
18 
19 #include <condition_variable>
20 #include <mutex>
21 
22 #include "mms_network_manager.h"
23 #include "telephony_errors.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class DataRequest {
28 public:
29     explicit DataRequest(int32_t slotId);
30     ~DataRequest();
31     int32_t HttpRequest(int32_t slotId, const std::string &method, std::shared_ptr<MmsNetworkManager> netMgr,
32         const std::string &contentUrl, const std::string &pduDir);
33     int32_t ExecuteMms(const std::string &method, std::shared_ptr<MmsNetworkManager> mmsNetworkMgr,
34         const std::string &contentUrl, const std::string &pduDir);
35     uint8_t GetRequestId();
36     void CreateRequestId();
37 
38 public:
39     static bool networkReady_;
40     static std::mutex ctx_;
41     static std::condition_variable cv_;
42     int32_t slotId_ = -1;
43     uint8_t requestId_ = 0;
44 };
45 } // namespace Telephony
46 } // namespace OHOS
47 #endif