PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of nfcTag variables
  • Main remarks
  • Reinitializing the variable
  • List of functions that use the nfcTag variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The nfcTag type is used to define the advanced characteristics of a NFC tag (Near Field Communication). The characteristics of this NFC tag can be defined and modified by several WLanguage properties.
Note: See Declaring a variable for more details.
Example
// Writes a url into a NFC tag
tag is nfcTag
url is nfcData
url..Type = nfcURI
url..Content = "www.pcsoft.com"
Add(tag..Data, url)
NFCWriteTag(tag)
IF ErrorOccurred THEN
Error("Failure writing onto the NFC tag.", ErrorInfo())
END
tag is nfcTag = NFCReadTag()
TagID is string = StringFormat(BufferToHexa(tag..Identifier), ...
ccUpCase + ccIgnorePonctuationAndSpace)
Remarks

Properties specific to the description of nfcTag variables

The following properties can be used to handle a NFC tag:
Property nameType usedEffect
DataArray of nfcDataArray containing:
  • the data read in a NFC tag (after a call to NFCReadTag).
  • the data to write into a NFC tag (after a call to NFCWriteTag).
IdentifierBinary bufferIdentifier of the NFC tag (corresponds to "hardware identifier" of a badged tag). This identifier is automatically filled after a read operation.
This property is available in read-only.
ReadOnlyBoolean
  • True if the tag is read-only,
  • False if it is not protected in write mode.
During a read operation, this property is automatically filled.
During a write operation, if ..DisplayOnly is set to True, the tag will be automatically protected in write mode: its data can no longer be modified. This operation is irreversible. Some NFC tags do not support this mode. See the help about NFCWriteTag for more details.
MaxSizeIntegerMaximum size (in bytes) of the data that can be stored in the NFC tag.
This property is automatically filled after a read operation.
This property is available in read-only.
TypeInteger constantType of tag corresponding to one of the following values:
  • nfcUnknown: unknown type. Default value if no read operation was performed with the tag.
  • nfcMifareClassic: NFC Mifare Classic
  • nfcType1: NFC Forum Type 1
  • nfcType2: NFC Forum Type 2
  • nfcType3: NFC Forum Type 3
  • nfcType4: NFC Forum Type 4
The type of tag is automatically filled after a read operation.
This property is available in read-only.
Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

Main remarks

  • The NFC functions support the tags corresponding to the standardized types 1 to 4 defined by the NFC Forum (http://www.nfc-forum.org/specs/spec_list/) and they can only read and write data encoded to the NDEF format (NFC Data Exchange Service).
  • The NFC functions cannot be used in the simulator or in the emulator.
  • The NFC functions are available for the devices running Android version 2.3.3 or later (api level 10).
    A fatal error will occur if the function is used with an earlier system version.
    Reminder: To find out the version of Android system on which the application is run, use SysAndroidVersion.

Reinitializing the variable

To reinitialize the content of a nfcTag variable, you have the ability to use VariableReset.

List of functions that use the nfcTag variables

Versions 18 and later
NFCReadTag
New in version 18
NFCReadTag
NFCReadTag
Starts reading a NFC tag or enables the detection of NFC tags for the current window.
Versions 18 and later
NFCSendTag
New in version 18
NFCSendTag
NFCSendTag
Sends a NFC tag to another device.
Versions 18 and later
NFCWriteTag
New in version 18
NFCWriteTag
NFCWriteTag
Starts writing data onto a NFC tag.
Minimum required version
  • Version 18
Comments
Click [Add] to post a comment