GTlmNfc

GTlmNfc — a helper object that provides NFC functionality to user management code

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GTlmNfc

Includes

#include <gtlm-nfc.h>

Description

GTlmNfc is used by Tizen user and login management to access NFC tags and authenticate users through them. It provides signals to listen for tags appearing and disappearing, and for reading and writing username/password pairs to tags.

Functions

gtlm_nfc_write_username_password ()

void
gtlm_nfc_write_username_password (GTlmNfc *tlm_nfc,
                                  const gchar *nfc_tag_path,
                                  const gchar *username,
                                  const gchar *password,
                                  GError **error);

This function is used to write a username and password to a tag. The tag path can be obtained by listening to “tag-found” signals). error is set to GTLM_NFC_ERROR_NO_TAG if no such tag exists.

Parameters

tlm_nfc

an instance of GTlmNfc object

 

nfc_tag_path

an identificator of the nfc tag (returned by “tag-found”)

 

username

username to write

 

password

password to write

 

error

if non-NULL, set to an error, if one occurs

 

Types and Values

enum GTlmNfcError

This enum provides a list of errors that libtlm-nfc returns.

Members

GTLM_NFC_ERROR_NONE

No error

 

GTLM_NFC_ERROR_NO_TAG

Issued when attempting to write to an absent tag

 

Signal Details

The “no-record-found” signal

void
user_function (GTlmNfc *tlm_nfc,
               gpointer user_data)

This signal is issued by GTlmNfc object when a username and password pair has not been found on a tag

Parameters

tlm_nfc

the object which emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “record-found” signal

void
user_function (GTlmNfc *tlm_nfc,
               gchar   *username,
               gchar   *password,
               gpointer user_data)

This signal is issued by GTlmNfc object when a username and password pair has been found on a tag.

Parameters

tlm_nfc

the object which emitted the signal

 

username

the username on the tag

 

password

the password on the tag

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “tag-found” signal

void
user_function (GTlmNfc *tlm_nfc,
               gchar   *nfc_tag_path,
               gpointer user_data)

This signal is issued by GTlmNfc object when a tag has been found.

Parameters

tlm_nfc

the object which emitted the signal

 

nfc_tag_path

an identifier of the tag (use in gtlm_nfc_write_username_password())

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “tag-lost” signal

void
user_function (GTlmNfc *tlm_nfc,
               gchar   *nfc_tag_path,
               gpointer user_data)

This signal is issued by GTlmNfc object when a tag has been lost.

Parameters

tlm_nfc

the object which emitted the signal

 

nfc_tag_path

an identifier of the tag

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First