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 TAG_SESSION_PROXY_H 16 #define TAG_SESSION_PROXY_H 17 #include "iremote_proxy.h" 18 #include "itag_session.h" 19 #include "nfc_basic_proxy.h" 20 21 namespace OHOS { 22 namespace NFC { 23 namespace TAG { 24 class TagSessionProxy final : public OHOS::IRemoteProxy<ITagSession>, public NfcBasicProxy { 25 public: TagSessionProxy(const OHOS::sptr<OHOS::IRemoteObject> & remote)26 explicit TagSessionProxy(const OHOS::sptr<OHOS::IRemoteObject>& remote) 27 : OHOS::IRemoteProxy<ITagSession>(remote), NfcBasicProxy(remote) 28 { 29 } ~TagSessionProxy()30 ~TagSessionProxy() override {} 31 32 int Connect(int tagRfDiscId, int technology) override; 33 int Reconnect(int tagRfDiscId) override; 34 void Disconnect(int tagRfDiscId) override; 35 int GetMaxTransceiveLength(int technology, int &maxSize) override; 36 int SetTimeout(int timeout, int technology) override; 37 int GetTimeout(int technology, int &timeout) override; 38 int SendRawFrame(int tagRfDiscId, std::string hexCmdData, bool raw, std::string &hexRespData) override; 39 40 std::vector<int> GetTechList(int tagRfDiscId) override; 41 bool IsTagFieldOn(int tagRfDiscId) override; 42 bool IsNdef(int tagRfDiscId) override; 43 std::string NdefRead(int tagRfDiscId) override; 44 int NdefWrite(int tagRfDiscId, std::string msg) override; 45 int NdefMakeReadOnly(int tagRfDiscId) override; 46 int FormatNdef(int tagRfDiscId, const std::string& key) override; 47 int CanMakeReadOnly(int ndefType, bool &canSetReadOnly) override; 48 int IsSupportedApdusExtended(bool &isSupported) override; 49 private: 50 }; 51 } // namespace TAG 52 } // namespace NFC 53 } // namespace OHOS 54 #endif // TAG_SESSION_PROXY_H 55