Loading...
Searching...
No Matches
nfc_generic_event.h File Reference

Generic Nfc stack event definitions. More...

#include "nfc_protocol.h"
#include <nfc/nfc.h>

Go to the source code of this file.

Data Structures

struct  NfcGenericEvent
 Generic Nfc event type. More...
 

Typedefs

typedef void NfcGenericInstance
 Generic Nfc instance type.
 
typedef void NfcGenericEventData
 Generic Nfc event data type.
 
typedef NfcCommand(* NfcGenericCallback) (NfcGenericEvent event, void *context)
 Generic Nfc event callback type.
 

Detailed Description

Generic Nfc stack event definitions.

Events are the main way of passing information about, well, various events that occur across the Nfc protocol stack.

In order to subscribe to events from a certain instance, the user code must call its corresponding start() function while providing the appropriate callback. During this call, an additional context pointer can be provided, which will be passed to the context parameter at the time of the callback execution.

For additional information on how events are passed around and processed, see protocol-specific poller and listener implementations found in the respectively named subfolders.

Typedef Documentation

◆ NfcGenericCallback

typedef NfcCommand(* NfcGenericCallback) (NfcGenericEvent event, void *context)

Generic Nfc event callback type.

A function of this type must be passed as the callback parameter upon start of a poller, listener or Nfc instance.

Parameters
[in]eventNfc generic event, passed by value, complete with protocol type and data.
[in,out]contextpointer to the user-specific context (set when starting a poller/listener instance).
Returns
the command which the event producer must execute.

◆ NfcGenericEventData

typedef void NfcGenericEventData

Generic Nfc event data type.

Must be cast to a concrete type before use. Usually, it will be the protocol-specific event type.

◆ NfcGenericInstance

typedef void NfcGenericInstance

Generic Nfc instance type.

Must be cast to a concrete type before use. Depending on the context, a pointer of this type may point to an object of the following types:

  • Nfc type,
  • Concrete poller type,
  • Concrete listener type.