1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.nfc.tag.d.ts 55.31 KB
一键复制 编辑 原始数据 按行查看 历史
fengyong 提交于 2024-07-31 16:45 +08:00 . clearing alarms
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ConnectivityKit
*/
import type { NfcATag as _NfcATag, NfcBTag as _NfcBTag, NfcFTag as _NfcFTag, NfcVTag as _NfcVTag } from './tag/nfctech';
import {
IsoDepTag as _IsoDepTag,
NdefTag as _NdefTag,
MifareClassicTag as _MifareClassicTag,
MifareUltralightTag as _MifareUltralightTag,
NdefFormatableTag as _NdefFormatableTag
} from './tag/nfctech';
import { NdefMessage as _NdefMessage } from './tag/nfctech';
import { TagSession as _TagSession } from './tag/tagSession';
import type { PacMap } from './ability/dataAbilityHelper';
import type rpc from './@ohos.rpc';
import type { AsyncCallback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import type { ElementName } from './bundleManager/ElementName';
/**
* Provides methods to operate or manage NFC tag.
*
* @namespace tag
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Provides methods to operate or manage NFC tag.
*
* @namespace tag
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
declare namespace tag {
/**
* Indicates an NFC-A tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an NFC-A tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NFC_A = 1;
/**
* Indicates an NFC-B tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an NFC-B tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NFC_B = 2;
/**
* Indicates an ISO_DEP tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an ISO_DEP tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const ISO_DEP = 3;
/**
* Indicates an NFC-F tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an NFC-F tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NFC_F = 4;
/**
* Indicates an NFC-V tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an NFC-V tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NFC_V = 5;
/**
* Indicates an NDEF tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an NDEF tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NDEF = 6;
/**
* Indicates an NDEF Formatable tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Indicates an NDEF Formatable tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const NDEF_FORMATABLE = 7;
/**
* Indicates an MIFARE CLASSIC tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an MIFARE CLASSIC tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const MIFARE_CLASSIC = 8;
/**
* Indicates an MIFARE ULTRALIGHT tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Indicates an MIFARE ULTRALIGHT tag.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const MIFARE_ULTRALIGHT = 9;
/**
* TNF types definitions, see NFCForum-TS-NDEF_1.0.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* TNF types definitions, see NFCForum-TS-NDEF_1.0.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
enum TnfType {
/**
* Empty
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Empty
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_EMPTY = 0x0,
/**
* NFC Forum well-known type [NFC RTD]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC Forum well-known type [NFC RTD]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_WELL_KNOWN = 0x1,
/**
* Media-type as defined in RFC 2046 [RFC 2046]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Media-type as defined in RFC 2046 [RFC 2046]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_MEDIA = 0x2,
/**
* Absolute URI as defined in RFC 3986 [RFC 3986]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Absolute URI as defined in RFC 3986 [RFC 3986]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_ABSOLUTE_URI = 0x3,
/**
* NFC Forum external type [NFC RTD]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC Forum external type [NFC RTD]
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_EXT_APP = 0x4,
/**
* Unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_UNKNOWN = 0x5,
/**
* Unchanged (see section 2.3.3)
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Unchanged (see section 2.3.3)
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TNF_UNCHANGED = 0x6
}
/**
* NfcForum Type definition. The NDEF tag may use one of them.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NfcForum Type definition. The NDEF tag may use one of them.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
enum NfcForumType {
/**
* NFC FORUM TYPE 1
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC FORUM TYPE 1
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
NFC_FORUM_TYPE_1 = 1,
/**
* NFC FORUM TYPE 2
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC FORUM TYPE 2
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
NFC_FORUM_TYPE_2 = 2,
/**
* NFC FORUM TYPE 3
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC FORUM TYPE 3
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
NFC_FORUM_TYPE_3 = 3,
/**
* NFC FORUM TYPE 4
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NFC FORUM TYPE 4
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
NFC_FORUM_TYPE_4 = 4,
/**
* Mifare Classic
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Classic
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
MIFARE_CLASSIC = 101
}
/**
* RTD type TEXT, see NFC Record Type Definition (RTD) Specification.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* RTD type TEXT, see NFC Record Type Definition (RTD) Specification.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const RTD_TEXT: number[];
/**
* RTD type URI, see NFC Record Type Definition (RTD) Specification.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* RTD type URI, see NFC Record Type Definition (RTD) Specification.
*
* @constant
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
const RTD_URI: number[];
/**
* MifareClassic Type definition
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* MifareClassic Type definition
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
enum MifareClassicType {
/**
* Mifare Type unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Type unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_UNKNOWN = 0,
/**
* Mifare Classic
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Classic
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_CLASSIC = 1,
/**
* Mifare Plus
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Plus
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_PLUS = 2,
/**
* Mifare Pro
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Pro
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_PRO = 3
}
/**
* MifareClassic Tag size.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* MifareClassic Tag size.
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
enum MifareClassicSize {
/**
* 5 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* 5 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
MC_SIZE_MINI = 320,
/**
* 16 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* 16 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
MC_SIZE_1K = 1024,
/**
* 32 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* 32 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
MC_SIZE_2K = 2048,
/**
* 40 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* 40 sectors per tag, 4 blocks per sector
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
MC_SIZE_4K = 4096
}
/**
* MifareUltralight Type definition
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* MifareUltralight Type definition
*
* @enum { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
enum MifareUltralightType {
/**
* Mifare Type unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Type unknown
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_UNKNOWN = 0,
/**
* Mifare Ultralight
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare Ultralight
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_ULTRALIGHT = 1,
/**
* Mifare UltralightC
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Mifare UltralightC
*
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
TYPE_ULTRALIGHT_C = 2
}
/**
* Obtains an {@link NfcATag} object based on the tag information.
* <p>During tag reading, if the tag supports the NFC-A technology, an {@link NfcATag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo Indicates the tag information.
* @returns { NfcATag } The {@link NfcATag} object.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
* @deprecated since 9
* @useinstead ohos.nfc.tag/tag#getNfcA
*/
function getNfcATag(tagInfo: TagInfo): NfcATag;
/**
* Obtains an {@link NfcATag} object based on the tag information.
* During tag reading, if the tag supports the NFC-A technology, an {@link NfcATag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcATag } {@link NfcATag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NfcATag} object based on the tag information.
* During tag reading, if the tag supports the NFC-A technology, an {@link NfcATag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcATag } {@link NfcATag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNfcA(tagInfo: TagInfo): NfcATag;
/**
* Obtains an {@link NfcBTag} object based on the tag information.
* <p>During tag reading, if the tag supports the NFC-B technology, an {@link NfcBTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo Indicates the tag information.
* @returns { NfcBTag } The {@link NfcBTag} object.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
* @deprecated since 9
* @useinstead ohos.nfc.tag/tag#getNfcB
*/
function getNfcBTag(tagInfo: TagInfo): NfcBTag;
/**
* Obtains an {@link NfcBTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-B technology, an {@link NfcBTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcBTag } The {@link NfcBTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NfcBTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-B technology, an {@link NfcBTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcBTag } The {@link NfcBTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNfcB(tagInfo: TagInfo): NfcBTag;
/**
* Obtains an {@link NfcFTag} object based on the tag information.
* <p>During tag reading, if the tag supports the NFC-F technology, an {@link NfcFTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo Indicates the tag information.
* @returns { NfcFTag } The {@link NfcFTag} object.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
* @deprecated since 9
* @useinstead ohos.nfc.tag/tag#getNfcF
*/
function getNfcFTag(tagInfo: TagInfo): NfcFTag;
/**
* Obtains an {@link NfcFTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-F technology, an {@link NfcFTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcFTag } The {@link NfcFTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NfcFTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-F technology, an {@link NfcFTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcFTag } The {@link NfcFTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNfcF(tagInfo: TagInfo): NfcFTag;
/**
* Obtains an {@link NfcVTag} object based on the tag information.
* <p>During tag reading, if the tag supports the NFC-V technology, an {@link NfcVTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo Indicates the tag information.
* @returns { NfcVTag } The {@link NfcVTag} object.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
* @deprecated since 9
* @useinstead ohos.nfc.tag/tag#getNfcV
*/
function getNfcVTag(tagInfo: TagInfo): NfcVTag;
/**
* Obtains an {@link NfcVTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-V technology, an {@link NfcVTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcVTag } The {@link NfcVTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NfcVTag} object based on the tag information.
* During tag reading, if the tag supports the NFC-V technology, an {@link NfcVTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NfcVTag } The {@link NfcVTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNfcV(tagInfo: TagInfo): NfcVTag;
/**
* Obtains an {@link IsoDepTag} object based on the tag information.
* During tag reading, if the tag supports the IsoDep technology, an {@link IsoDepTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { IsoDepTag } The {@link IsoDepTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link IsoDepTag} object based on the tag information.
* During tag reading, if the tag supports the IsoDep technology, an {@link IsoDepTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { IsoDepTag } The {@link IsoDepTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getIsoDep(tagInfo: TagInfo): IsoDepTag;
/**
* Obtains an {@link NdefTag} object based on the tag information.
* During tag reading, if the tag supports the NDEF technology, an {@link NdefTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NdefTag } The {@link NdefTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NdefTag} object based on the tag information.
* During tag reading, if the tag supports the NDEF technology, an {@link NdefTag} object
* will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NdefTag } The {@link NdefTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNdef(tagInfo: TagInfo): NdefTag;
/**
* Obtains an {@link MifareClassicTag} object based on the tag information.
* During tag reading, if the tag supports the MIFARE Classic technology,
* an {@link MifareClassicTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { MifareClassicTag } The {@link MifareClassicTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link MifareClassicTag} object based on the tag information.
* During tag reading, if the tag supports the MIFARE Classic technology,
* an {@link MifareClassicTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { MifareClassicTag } The {@link MifareClassicTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getMifareClassic(tagInfo: TagInfo): MifareClassicTag;
/**
* Obtains an {@link MifareUltralightTag} object based on the tag information.
* During tag reading, if the tag supports the MIFARE Ultralight technology,
* an {@link MifareUltralightTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { MifareUltralightTag } The {@link MifareUltralightTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link MifareUltralightTag} object based on the tag information.
* During tag reading, if the tag supports the MIFARE Ultralight technology,
* an {@link MifareUltralightTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { MifareUltralightTag } The {@link MifareUltralightTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getMifareUltralight(tagInfo: TagInfo): MifareUltralightTag;
/**
* Obtains an {@link NdefFormatableTag} object based on the tag information.
* During tag reading, if the tag supports the NDEF Formatable technology,
* an {@link NdefFormatableTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NdefFormatableTag } The {@link NdefFormatableTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Obtains an {@link NdefFormatableTag} object based on the tag information.
* During tag reading, if the tag supports the NDEF Formatable technology,
* an {@link NdefFormatableTag} object will be created based on the tag information.
*
* @param { TagInfo } tagInfo - Indicates the dispatched tag information.
* @returns { NdefFormatableTag } The {@link NdefFormatableTag} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100201 - Tag running state is abnormal in service.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getNdefFormatable(tagInfo: TagInfo): NdefFormatableTag;
/**
* Parse a {@link TagInfo} object from Want.
*
* @param { Want } want - The want object that contains the values of TagInfo.
* @returns { TagInfo } The {@link TagInfo} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Parse a {@link TagInfo} object from Want.
*
* @param { Want } want - The want object that contains the values of TagInfo.
* @returns { TagInfo } The {@link TagInfo} object.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function getTagInfo(want: Want): TagInfo;
/**
* Register tag foreground dispatch. Dispatches to this application only if a tag discovered.
*
* @permission ohos.permission.NFC_TAG
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}.
* @param { AsyncCallback<TagInfo> } callback - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 10
*/
/**
* Register tag foreground dispatch. Dispatches to this application only if a tag discovered.
*
* @permission ohos.permission.NFC_TAG
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}.
* @param { AsyncCallback<TagInfo> } callback - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100202 - The element state is invalid.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function registerForegroundDispatch(
elementName: ElementName,
discTech: number[],
callback: AsyncCallback<TagInfo>
): void;
/**
* Unregister tag foreground dispatch.
*
* @permission ohos.permission.NFC_TAG
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 10
*/
/**
* Unregister tag foreground dispatch.
*
* @permission ohos.permission.NFC_TAG
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function unregisterForegroundDispatch(elementName: ElementName): void;
/**
* Set reader mode enabled when the specific application is foreground. Dispatches to this application only if a tag discovered.
*
* @permission ohos.permission.NFC_TAG
* @param { 'readerMode' } type - The callback type to be registered.
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}.
* @param { AsyncCallback<TagInfo> } callback - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100202 - The element state is invalid.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 11
*/
/**
* Set reader mode enabled when the specific application is foreground. Dispatches to this application only if a tag discovered.
*
* @permission ohos.permission.NFC_TAG
* @param { 'readerMode' } type - The callback type to be registered.
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { number[] } discTech - The technologies list to set for discovering. From {@link NFC_A} to {@link MIFARE_ULTRALIGHT}.
* @param { AsyncCallback<TagInfo> } callback - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100202 - The element state is invalid.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function on(type: 'readerMode', elementName: ElementName, discTech: number[], callback: AsyncCallback<TagInfo>): void;
/**
* Disable foreground reader mode settings explicitly.
*
* @permission ohos.permission.NFC_TAG
* @param { 'readerMode' } type - The callback type to be unregistered.
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { AsyncCallback<TagInfo> } [callback] - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100203 - The off() can be called only when the on() has been called.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 11
*/
/**
* Disable foreground reader mode settings explicitly.
*
* @permission ohos.permission.NFC_TAG
* @param { 'readerMode' } type - The callback type to be unregistered.
* @param { ElementName } elementName - The element name of application, must include the bundleName and abilityName.
* @param { AsyncCallback<TagInfo> } [callback] - The callback to dispatched the TagInfo object for application.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 3100203 - The off() can be called only when the on() has been called.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function off(type: 'readerMode', elementName: ElementName, callback?: AsyncCallback<TagInfo>): void;
/**
* Provides tag information.
* <p>This class provides the technology a tag supports, for example, NFC-A. Applications can create
* different tags based on the supported technology.
*
* @typedef TagInfo
* @permission ohos.permission.NFC_TAG
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Provides tag information.
* <p>This class provides the technology a tag supports, for example, NFC-A. Applications can create
* different tags based on the supported technology.
*
* @typedef TagInfo
* @permission ohos.permission.NFC_TAG
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export interface TagInfo {
/**
* The uid of this tag, it.
*
* @permission ohos.permission.NFC_TAG
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* The uid of this tag, it.
*
* @permission ohos.permission.NFC_TAG
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
uid: number[];
/**
* The supported technology list of this tag.
*
* @permission ohos.permission.NFC_TAG
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* The supported technology list of this tag.
*
* @permission ohos.permission.NFC_TAG
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
technology: number[];
/**
* The extra data for each technology of this tag.
*
* @permission ohos.permission.NFC_TAG
* @type { PacMap[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @systemapi hide for inner use.
* @since 9
*/
extrasData: PacMap[];
/**
* The the RF discovery id of this tag.
*
* @permission ohos.permission.NFC_TAG
* @type { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @systemapi hide for inner use.
* @since 9
*/
tagRfDiscId: number;
/**
* The extra data for the technology of this tag.
*
* @permission ohos.permission.NFC_TAG
* @type { rpc.RemoteObject }
* @syscap SystemCapability.Communication.NFC.Tag
* @systemapi hide for inner use.
* @since 9
*/
remoteTagService: rpc.RemoteObject;
/**
* The supported technology list of this tag.
*
* @permission ohos.permission.NFC_TAG
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
* @deprecated since 9
* @useinstead ohos.nfc.tag/tag.TagInfo#technology
*/
supportedProfiles: number[];
}
/**
* NDEF records definition, see NFCForum-TS-NDEF_1.0.
*
* @typedef NdefRecord
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* NDEF records definition, see NFCForum-TS-NDEF_1.0.
*
* @typedef NdefRecord
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export interface NdefRecord {
/**
* tnf of NdefRecord
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* tnf of NdefRecord
*
* @type { number }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
tnf: number;
/**
* RTD type of NdefRecord
*
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* RTD type of NdefRecord
*
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
rtdType: number[];
/**
* id of NdefRecord
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* id of NdefRecord
*
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
id: number[];
/**
* payload of NdefRecord
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* payload of NdefRecord
*
* @type { number[] }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
payload: number[];
}
/**
* Provides methods for accessing NDEF tag.
*
* @namespace ndef
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Provides methods for accessing NDEF tag.
*
* @namespace ndef
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
namespace ndef {
/**
* Creates an NDEF record with uri data.
*
* @param { string } uri - Uri data for new NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF record with uri data.
*
* @param { string } uri - Uri data for new NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function makeUriRecord(uri: string): NdefRecord;
/**
* Creates an NDEF record with text data.
*
* @param { string } text - Text data for new an NDEF record.
* @param { string } locale - Language code for the NDEF record. if locale is null, use default locale.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF record with text data.
*
* @param { string } text - Text data for new an NDEF record.
* @param { string } locale - Language code for the NDEF record. if locale is null, use default locale.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function makeTextRecord(text: string, locale: string): NdefRecord;
/**
* Creates an NDEF record with mime data.
*
* @param { string } mimeType type of mime data for new an NDEF record.
* @param { number[] } mimeData mime data for new an NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF record with mime data.
*
* @param { string } mimeType type of mime data for new an NDEF record.
* @param { number[] } mimeData mime data for new an NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function makeMimeRecord(mimeType: string, mimeData: number[]): NdefRecord;
/**
* Creates an NDEF record with external data.
*
* @param { string } domainName - Domain name of issuing organization for the external data.
* @param { string } type - Domain specific type of data for the external data.
* @param { number[] } externalData - Data payload of an NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF record with external data.
*
* @param { string } domainName - Domain name of issuing organization for the external data.
* @param { string } type - Domain specific type of data for the external data.
* @param { number[] } externalData - Data payload of an NDEF record.
* @returns { NdefRecord } The instance of NdefRecord.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function makeExternalRecord(domainName: string, type: string, externalData: number[]): NdefRecord;
/**
* Creates an NDEF message with raw bytes.
*
* @param { number[] } data - The raw bytes to parse NDEF message.
* @returns { NdefMessage } The instance of NdefMessage.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF message with raw bytes.
*
* @param { number[] } data - The raw bytes to parse NDEF message.
* @returns { NdefMessage } The instance of NdefMessage.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function createNdefMessage(data: number[]): NdefMessage;
/**
* Creates an NDEF message with record list.
*
* @param { NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message.
* @returns { NdefMessage } The instance of NdefMessage.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Creates an NDEF message with record list.
*
* @param { NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message.
* @returns { NdefMessage } The instance of NdefMessage.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function createNdefMessage(ndefRecords: NdefRecord[]): NdefMessage;
/**
* Parses an NDEF message into raw bytes.
*
* @param { NdefMessage } ndefMessage - An NDEF message to parse.
* @returns { number[] } Returns the raw bytes of an NDEF message.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Parses an NDEF message into raw bytes.
*
* @param { NdefMessage } ndefMessage - An NDEF message to parse.
* @returns { number[] } Returns the raw bytes of an NDEF message.
* @throws { BusinessError } 401 - The parameter check failed. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
function messageToBytes(ndefMessage: NdefMessage): number[];
}
/**
* Exports type NfcATag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Exports type NfcATag.
*
* @typedef { _NfcATag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NfcATag = _NfcATag;
/**
* Exports type NfcBTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Exports type NfcBTag.
*
* @typedef { _NfcBTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NfcBTag = _NfcBTag;
/**
* Exports type NfcFTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Exports type NfcFTag.
*
* @typedef { _NfcFTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NfcFTag = _NfcFTag;
/**
* Exports type NfcVTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Exports type NfcVTag.
*
* @typedef { _NfcVTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NfcVTag = _NfcVTag;
/**
* Exports type IsoDepTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type IsoDepTag.
*
* @typedef { _IsoDepTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type IsoDepTag = _IsoDepTag;
/**
* Exports type NdefTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type NdefTag.
*
* @typedef { _NdefTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NdefTag = _NdefTag;
/**
* Exports type MifareClassicTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type MifareClassicTag.
*
* @typedef { _MifareClassicTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type MifareClassicTag = _MifareClassicTag;
/**
* Exports type MifareUltralightTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type MifareUltralightTag.
*
* @typedef { _MifareUltralightTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type MifareUltralightTag = _MifareUltralightTag;
/**
* Exports type NdefFormatableTag.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type NdefFormatableTag.
*
* @typedef { _NdefFormatableTag }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NdefFormatableTag = _NdefFormatableTag;
/**
* Exports type NdefMessage.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 9
*/
/**
* Exports type NdefMessage.
*
* @typedef { _NdefMessage }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type NdefMessage = _NdefMessage;
/**
* Exports type TagSession.
*
* @syscap SystemCapability.Communication.NFC.Tag
* @since 7
*/
/**
* Exports type TagSession.
*
* @typedef { _TagSession }
* @syscap SystemCapability.Communication.NFC.Tag
* @atomicservice
* @since 12
*/
export type TagSession = _TagSession;
}
export default tag;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助