• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 FOUNDATION_APPEXECFWK_OHOS_ICONNECT_CALLBACK_H
16 #define FOUNDATION_APPEXECFWK_OHOS_ICONNECT_CALLBACK_H
17 #include <string>
18 #include "iremote_broker.h"
19 
20 using string = std::string;
21 namespace OHOS {
22 namespace AppExecFwk {
23 /**
24  * interface for device connect callback.
25  */
26 class IConnectCallback : public IRemoteBroker {
27 public:
28     IConnectCallback() = default;
29     virtual ~IConnectCallback() = default;
30     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.iconnectcallback");
31     /**
32      * @brief Connect device interface.
33      * @param deviceId indicates the device ID of the connection.
34      * @param deviceType indicates the device type of the connection.
35      * @return none.
36      */
37     virtual void Connect(const string &deviceId, const string &deviceType) = 0;
38     /**
39      * @brief disconnect device interface.
40      * @param deviceId indicates the device ID of the disconnect.
41      * @param deviceType indicates the device type of the connectdisconnection.
42      * @return none.
43      */
44     virtual void Disconnect(const string &deviceId) = 0;
45 
46     // connect status
47     enum {
48         COMMAND_CONNECT = 1,
49         COMMAND_DISCONNECT,
50     };
51 };
52 
53 }  // namespace AppExecFwk
54 }  // namespace OHOS
55 #endif  // FOUNDATION_APPEXECFWK_OHOS_ICONNECT_CALLBACK_H
56