1e41f4b71Sopenharmony_ci# JS API Changes of the Communication Subsystem 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe table below lists the APIs changes of the communication subsystem in OpenHarmony 3.2 Beta2 over OpenHarmony 3.2 Beta1. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci## API Changes 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| 8e41f4b71Sopenharmony_ci|---|---|---|---| 9e41f4b71Sopenharmony_ci| nfctech | NdefFormatableTag | formatReadOnly(message: NdefMessage): Promise\<number>;<br>formatReadOnly(message: NdefMessage, callback: AsyncCallback\<number>): void; | Added| 10e41f4b71Sopenharmony_ci| nfctech | NdefFormatableTag | format(message: NdefMessage): Promise\<number>;<br>format(message: NdefMessage, callback: AsyncCallback\<number>): void; | Added| 11e41f4b71Sopenharmony_ci| nfctech | MifareUltralightTag | getType(): MifareUltralightType; | Added| 12e41f4b71Sopenharmony_ci| nfctech | MifareUltralightTag | writeSinglePages(pageIndex: number, data: string): Promise\<number>;<br>writeSinglePages(pageIndex: number, data: string, callback: AsyncCallback\<number>): void; | Added| 13e41f4b71Sopenharmony_ci| nfctech | MifareUltralightTag | readMultiplePages(pageIndex: number): Promise\<string>;<br>readMultiplePages(pageIndex: number, callback: AsyncCallback\<string>): void; | Added| 14e41f4b71Sopenharmony_ci| nfctech | MifareUltralightType | TYPE_ULTRALIGHT_C = 2 | Added| 15e41f4b71Sopenharmony_ci| nfctech | MifareUltralightType | TYPE_ULTRALIGHT = 1 | Added| 16e41f4b71Sopenharmony_ci| nfctech | MifareUltralightType | TYPE_UNKOWN = -1 | Added| 17e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getSectorIndex(blockIndex: number): number; | Added| 18e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getBlockIndex(sectorIndex: number): number; | Added| 19e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | isEmulatedTag(): boolean; | Added| 20e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getTagSize(): number; | Added| 21e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getType(): MifareClassicType; | Added| 22e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getBlockCountInSector(sectorIndex: number): number; | Added| 23e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | getSectorCount(): number; | Added| 24e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | restoreFromBlock(blockIndex: number): Promise\<number>;<br>restoreFromBlock(blockIndex: number, callback: AsyncCallback\<number>): void; | Added| 25e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | transferToBlock(blockIndex: number): Promise\<number>;<br>transferToBlock(blockIndex: number, callback: AsyncCallback\<number>): void; | Added| 26e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | decrementBlock(blockIndex: number, value: number): Promise\<number>;<br>decrementBlock(blockIndex: number, value: number, callback: AsyncCallback\<number>): void; | Added| 27e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | incrementBlock(blockIndex: number, value: number): Promise\<number>;<br>incrementBlock(blockIndex: number, value: number, callback: AsyncCallback\<number>): void; | Added| 28e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | writeSingleBlock(blockIndex: number, data: string): Promise\<number>;<br>writeSingleBlock(blockIndex: number, data: string, callback: AsyncCallback\<number>): void; | Added| 29e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | readSingleBlock(blockIndex: number): Promise\<string>;<br>readSingleBlock(blockIndex: number, callback: AsyncCallback\<string>): void; | Added| 30e41f4b71Sopenharmony_ci| nfctech | MifareClassicTag | authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean): Promise\<boolean>;<br>authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean, callback: AsyncCallback\<boolean>): void; | Added| 31e41f4b71Sopenharmony_ci| nfctech | MifareTagSize | MC_SIZE_4K = 4096 | Added| 32e41f4b71Sopenharmony_ci| nfctech | MifareTagSize | MC_SIZE_2K = 2048 | Added| 33e41f4b71Sopenharmony_ci| nfctech | MifareTagSize | MC_SIZE_1K = 1024 | Added| 34e41f4b71Sopenharmony_ci| nfctech | MifareTagSize | MC_SIZE_MINI = 320 | Added| 35e41f4b71Sopenharmony_ci| nfctech | MifareClassicType | TYPE_PRO = 2 | Added| 36e41f4b71Sopenharmony_ci| nfctech | MifareClassicType | TYPE_PLUS = 1 | Added| 37e41f4b71Sopenharmony_ci| nfctech | MifareClassicType | TYPE_CLASSIC = 0 | Added| 38e41f4b71Sopenharmony_ci| nfctech | MifareClassicType | TYPE_UNKNOWN = -1 | Added| 39e41f4b71Sopenharmony_ci| nfctech | NdefTag | getNdefTagTypeString(type: NfcForumType): string; | Added| 40e41f4b71Sopenharmony_ci| nfctech | NdefTag | setReadOnly(): Promise\<number>;<br>setReadOnly(callback: AsyncCallback\<number>): void; | Added| 41e41f4b71Sopenharmony_ci| nfctech | NdefTag | canSetReadOnly(): Promise\<boolean>;<br>canSetReadOnly(callback: AsyncCallback\<boolean>): void; | Added| 42e41f4b71Sopenharmony_ci| nfctech | NdefTag | writeNdef(msg: NdefMessage): Promise\<number>;<br>writeNdef(msg: NdefMessage, callback: AsyncCallback\<number>): void; | Added| 43e41f4b71Sopenharmony_ci| nfctech | NdefTag | readNdef(): Promise\<NdefMessage>;<br>readNdef(callback: AsyncCallback\<NdefMessage>): void; | Added| 44e41f4b71Sopenharmony_ci| nfctech | NdefTag | isNdefWritable(): Promise\<boolean>;<br>isNdefWritable(callback: AsyncCallback\<boolean>): void; | Added| 45e41f4b71Sopenharmony_ci| nfctech | NdefTag | getNdefMessage(): NdefMessage; | Added| 46e41f4b71Sopenharmony_ci| nfctech | NdefTag | getNdefTagType(): NfcForumType; | Added| 47e41f4b71Sopenharmony_ci| nfctech | NdefTag | createNdefMessage(data: string): NdefMessage;<br>createNdefMessage(ndefRecords: NdefRecord[]): NdefMessage; | Added| 48e41f4b71Sopenharmony_ci| nfctech | NfcForumType | MIFARE_CLASSIC = 101 | Added| 49e41f4b71Sopenharmony_ci| nfctech | NfcForumType | NFC_FORUM_TYPE_4 = 4 | Added| 50e41f4b71Sopenharmony_ci| nfctech | NfcForumType | NFC_FORUM_TYPE_3 = 3 | Added| 51e41f4b71Sopenharmony_ci| nfctech | NfcForumType | NFC_FORUM_TYPE_2 = 2 | Added| 52e41f4b71Sopenharmony_ci| nfctech | NfcForumType | NFC_FORUM_TYPE_1 = 1 | Added| 53e41f4b71Sopenharmony_ci| nfctech | NdefMessage | messageToString(ndefMessage: NdefMessage): string; | Added| 54e41f4b71Sopenharmony_ci| nfctech | NdefMessage | makeExternalRecord(domainName: string, serviceName: string, externalData: string): NdefRecord; | Added| 55e41f4b71Sopenharmony_ci| nfctech | NdefMessage | makeMimeRecord(mimeType: string, mimeData: string): NdefRecord; | Added| 56e41f4b71Sopenharmony_ci| nfctech | NdefMessage | makeTextRecord(text: string, locale: string): NdefRecord; | Added| 57e41f4b71Sopenharmony_ci| nfctech | NdefMessage | makeUriRecord(uri: string): NdefRecord; | Added| 58e41f4b71Sopenharmony_ci| nfctech | NdefMessage | getNdefRecords(): NdefRecord[]; | Added| 59e41f4b71Sopenharmony_ci| nfctech | RtdType | RTD_URI: 'U'; | Added| 60e41f4b71Sopenharmony_ci| nfctech | RtdType | RTD_TEXT: 'T'; | Added| 61e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_UNCHANGED = 0x6 | Added| 62e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_UNKNOWN = 0x5 | Added| 63e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_EXT_APP = 0x4 | Added| 64e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_ABSOLUTE_URI = 0x3 | Added| 65e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_MEDIA = 0x2 | Added| 66e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_WELL_KNOWN = 0x1 | Added| 67e41f4b71Sopenharmony_ci| nfctech | TnfType | TNF_EMPTY = 0x0 | Added| 68e41f4b71Sopenharmony_ci| nfctech | NdefRecord | payload: string; | Added| 69e41f4b71Sopenharmony_ci| nfctech | NdefRecord | id: string; | Added| 70e41f4b71Sopenharmony_ci| nfctech | NdefRecord | rtdType: string; | Added| 71e41f4b71Sopenharmony_ci| nfctech | NdefRecord | tnf: number; | Added| 72e41f4b71Sopenharmony_ci| nfctech | IsoDepTag | isExtendedApduSupported(): Promise\<boolean>;<br>isExtendedApduSupported(callback: AsyncCallback\<boolean>): void; | Added| 73e41f4b71Sopenharmony_ci| nfctech | IsoDepTag | getHiLayerResponse(): string; | Added| 74e41f4b71Sopenharmony_ci| nfctech | IsoDepTag | getHistoricalBytes(): string; | Added| 75e41f4b71Sopenharmony_ci| ohos.bluetooth | ProfileId | PROFILE_PAN_NETWORK = 7 | Added| 76e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | manufactureDataMask?: ArrayBuffer; | Added| 77e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | manufactureData?: ArrayBuffer; | Added| 78e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | manufactureId?: number; | Added| 79e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | serviceDataMask?: ArrayBuffer; | Added| 80e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | serviceData?: ArrayBuffer; | Added| 81e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | serviceSolicitationUuidMask?: string; | Added| 82e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | serviceSolicitationUuid?: string; | Added| 83e41f4b71Sopenharmony_ci| ohos.bluetooth | ScanFilter | serviceUuidMask?: string; | Added| 84e41f4b71Sopenharmony_ci| ohos.bluetooth | PanProfile | isTetheringOn(): boolean; | Added| 85e41f4b71Sopenharmony_ci| ohos.bluetooth | PanProfile | setTethering(enable: boolean): void; | Added| 86e41f4b71Sopenharmony_ci| ohos.bluetooth | PanProfile | off(type: "connectionStateChange", callback?: Callback\<StateChangeParam>): void; | Added| 87e41f4b71Sopenharmony_ci| ohos.bluetooth | PanProfile | on(type: "connectionStateChange", callback: Callback\<StateChangeParam>): void; | Added| 88e41f4b71Sopenharmony_ci| ohos.bluetooth | PanProfile | disconnect(device: string): boolean; | Added| 89e41f4b71Sopenharmony_ci| ohos.bluetooth | bluetooth | getProfileInst(profileId: ProfileId): A2dpSourceProfile \| HandsFreeAudioGatewayProfile \| HidHostProfile \| PanProfile; | Added| 90e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | remoteTagService: rpc.RemoteObject; | Added| 91e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | tagRfDiscId: number; | Added| 92e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | extrasData: PacMap[]; | Added| 93e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | technology: number[]; | Added| 94e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | uid: string; | Added| 95e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | getNdefFormatableTag(tagInfo: TagInfo): NdefFormatableTag | Added| 96e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | getMifareUltralightTag(tagInfo: TagInfo): MifareUltralightTag | Added| 97e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | getMifareClassicTag(tagInfo: TagInfo): MifareClassicTag | Added| 98e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | getNdefTag(tagInfo: TagInfo): NdefTag | Added| 99e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | getIsoDepTag(tagInfo: TagInfo): IsoDepTag | Added| 100e41f4b71Sopenharmony_ci| ohos.nfc.tag | tag | const NDEF_FORMATABLE = 10; | Added| 101e41f4b71Sopenharmony_ci| ohos.wifi | WifiLinkedInfo | macType: number; | Added| 102e41f4b71Sopenharmony_ci| ohos.wifi | WifiSecurityType | WIFI_SEC_TYPE_WAPI_PSK = 9 | Added| 103e41f4b71Sopenharmony_ci| ohos.wifi | WifiSecurityType | WIFI_SEC_TYPE_WAPI_CERT = 8 | Added| 104e41f4b71Sopenharmony_ci| ohos.wifi | WifiSecurityType | WIFI_SEC_TYPE_OWE = 7 | Added| 105e41f4b71Sopenharmony_ci| ohos.wifi | WifiSecurityType | WIFI_SEC_TYPE_EAP_SUITE_B = 6 | Added| 106e41f4b71Sopenharmony_ci| ohos.wifi | WifiSecurityType | WIFI_SEC_TYPE_EAP = 5 | Added| 107e41f4b71Sopenharmony_ci| ohos.wifi | WifiScanInfo | infoElems: Array\<WifiInfoElem>; | Added| 108e41f4b71Sopenharmony_ci| ohos.wifi | WifiScanInfo | centerFrequency1: number; | Added| 109e41f4b71Sopenharmony_ci| ohos.wifi | WifiScanInfo | centerFrequency0: number; | Added| 110e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_INVALID | Added| 111e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_80MHZ_PLUS = 4 | Added| 112e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_160MHZ = 3 | Added| 113e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_80MHZ = 2 | Added| 114e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_40MHZ = 1 | Added| 115e41f4b71Sopenharmony_ci| ohos.wifi | WifiChannelWidth | WIDTH_20MHZ = 0 | Added| 116e41f4b71Sopenharmony_ci| ohos.wifi | WifiInfoElem | content: Uint8Array; | Added| 117e41f4b71Sopenharmony_ci| ohos.wifi | WifiInfoElem | eid: number; | Added| 118e41f4b71Sopenharmony_ci| ohos.wifi | WifiDeviceConfig | eapConfig: WifiEapConfig; | Added| 119e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | eapSubId: number; | Added| 120e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | plmn: string; | Added| 121e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | realm: string; | Added| 122e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | domainSuffixMatch: string; | Added| 123e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | altSubjectMatch: string; | Added| 124e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | clientCertAliases: string; | Added| 125e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | caPath: string; | Added| 126e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | caCertAliases: string; | Added| 127e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | password: string; | Added| 128e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | anonymousIdentity: string; | Added| 129e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | identity: string; | Added| 130e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | phase2Method: Phase2Method; | Added| 131e41f4b71Sopenharmony_ci| ohos.wifi | WifiEapConfig | eapMethod: EapMethod; | Added| 132e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_AKA_PRIME | Added| 133e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_AKA | Added| 134e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_SIM | Added| 135e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_GTC | Added| 136e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_MSCHAPV2 | Added| 137e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_MSCHAP | Added| 138e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_PAP | Added| 139e41f4b71Sopenharmony_ci| ohos.wifi | Phase2Method | PHASE2_NONE | Added| 140e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_UNAUTH_TLS | Added| 141e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_AKA_PRIME | Added| 142e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_AKA | Added| 143e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_SIM | Added| 144e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_PWD | Added| 145e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_TTLS | Added| 146e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_TLS | Added| 147e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_PEAP | Added| 148e41f4b71Sopenharmony_ci| ohos.wifi | EapMethod | EAP_NONE | Added| 149e41f4b71Sopenharmony_ci| ohos.wifi | wifi | getP2pGroups(): Promise\<Array\<WifiP2pGroupInfo>>;<br>getP2pGroups(callback: AsyncCallback\<Array\<WifiP2pGroupInfo>>): void; | Added| 150e41f4b71Sopenharmony_ci| ohos.wifi | wifi | getP2pLocalDevice(): Promise\<WifiP2pDevice>;<br>getP2pLocalDevice(callback: AsyncCallback\<WifiP2pDevice>): void; | Added| 151e41f4b71Sopenharmony_ci| ohos.wifi | wifi | connectToCandidateConfig(networkId: number): void; | Added| 152e41f4b71Sopenharmony_ci| ohos.wifi | wifi | getCandidateConfigs(): Array\<WifiDeviceConfig>; | Added| 153e41f4b71Sopenharmony_ci| ohos.wifi | wifi | removeCandidateConfig(networkId: number): Promise\<void>;<br>removeCandidateConfig(networkId: number, callback: AsyncCallback\<void>): void; | Added| 154e41f4b71Sopenharmony_ci| ohos.wifi | wifi | addCandidateConfig(config: WifiDeviceConfig): Promise\<number>;<br>addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback\<number>): void; | Added| 155e41f4b71Sopenharmony_ci| ohos.wifi | wifi | getScanInfosSync(): Array\<WifiScanInfo>; | Added| 156e41f4b71Sopenharmony_ci| ohos.bluetooth | A2dpSourceProfile | getPlayingState(device: string): PlayingState; | Deprecated| 157e41f4b71Sopenharmony_ci| ohos.nfc.tag | TagInfo | supportedProfiles: number[]; | Deprecated| 158