tencent cloud

Feedback

NFC-NfcA

Last updated: 2024-11-21 18:48:11

    .connect

    The method is utilized as NfcA.connect().
    Function Description: Establishes a connection with the NFC tag.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed at the conclusion of the interface invocation (both successful and unsuccessful invocations)
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .close

    The method is utilized as NfcA.close().
    Function Description: Disconnect.
    Parameters and Description: Object object
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .setTimeout

    The method is employed as NfcA.setTimeout(Object object).
    Function Description: Setting the timeout duration.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    timeout
    number
    -
    Supported
    Setting the timeout duration (ms)
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .isConnected

    The method is utilized as NfcA.isConnected().
    Note:
    This interface has been deprecated; developers can maintain the connection status independently.
    Function Description: Verifies if a connection has been established.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .getMaxTransceiveLength

    The method is utilized as NfcA.getMaxTransceiveLength().
    Function Description: Retrieves the maximum transmission length.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    object.success Callback Function Parameters: Object res.
    Attributes
    Types
    Note
    length
    number
    Maximum Transmission Length
    Error Codes
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .transceive

    The method is employed as NfcA.transceive(Object object).
    Function Description: Transmits data.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    data
    ArrayBuffer
    -
    Supported
    Binary data required for transmission
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    object.success Callback Function Parameters: Object res.
    Attributes
    Types
    Note
    data
    ArrayBuffer
    -
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .getAtqa

    The method is utilized as NfcA.getAtqa().
    Function Description: Retrieves ATQA information.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    object.success Callback Function Parameters: Object res.
    Attributes
    Types
    Note
    atqa
    ArrayBuffer
    Returns ATQA/SENS_RES data.
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed

    .getSak

    The method is employed as NfcA.getSak().
    Function Description: Acquires SAK information.
    Parameters and Description: Object object.
    Attributes
    Types
    Default value
    Required
    Note
    success
    function
    -
    Not required
    Callback function for successful interface invocation
    fail
    function
    -
    Not required
    Callback function for unsuccessful interface invocation
    complete
    function
    -
    Not required
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    object.success Callback Function Parameters: Object res.
    Attributes
    Types
    Note
    sak
    number
    Returns SAK/SEL_RES data.
    Error Code
    Error Codes
    Error Message
    Note
    13000
    The device does not support NFC
    -
    13001
    The system's NFC switch is not activated.
    -
    13010
    An unknown error occurred.
    -
    13019
    user is not authorized
    User Authorization Denied
    13011
    invalid parameter
    Invalid parameter
    13012
    parse NdefMessage failed
    Failed to parse the parameter into NdefMessage.
    13021
    NFC discovery already started
    NFC scanning has already commenced.
    13018
    NFC discovery has not started
    Attempted to halt NFC scanning without initiating it.
    13022
    Tech already connected
    The tag has been successfully connected.
    13023
    Tech has not connected
    Attempted to disconnect without a tag being connected.
    13013
    NFC tag has not been discovered
    No NFC tag was detected.
    13014
    invalid tech
    Invalid tag technology.
    13015
    unavailable tech
    Failed to acquire the corresponding technology from the tag.
    13024
    function not support
    The current tag technology does not support this feature.
    13017
    system internal error
    The related read-write operation has failed.
    13016
    connect fail
    Connection failed
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support