AppNearMe µNFC stack for the NXP PN532 chip License: You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Dependents:   IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers transaction_event.h Source File

transaction_event.h

00001 /*
00002     transaction_event.h
00003     Copyright (c) Donatien Garnier 2012
00004     donatien.garnier@appnearme.com
00005     http://www.appnearme.com/
00006 */
00007 
00008 
00009 #ifndef TRANSACTION_EVENT_H_
00010 #define TRANSACTION_EVENT_H_
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 #include "core/fwk.h"
00017 
00018 typedef enum __transaction_event
00019 {
00020   TRANSACTION_STARTED, //< Transaction with reader/tag started (anticollision successful)
00021   TRANSACTION_SUCCESSFUL, //< Transaction with reader/tag successful
00022   TRANSACTION_FAILED //< Transaction with reader/tag failed
00023 } transaction_event;
00024 
00025 typedef enum __transaction_type
00026 {
00027   TRANSACTION_READER, //< Transaction in reader mode (with a tag)
00028   TRANSACTION_TARGET, //< Transaction in target mode (with a reader)
00029 } transaction_type;
00030 
00031 typedef void (*transaction_event_callback)(transaction_event event, transaction_type type, void* param);
00032 
00033 void transaction_event_init(void);
00034 
00035 void transaction_event_register_callback(transaction_event_callback cb, void* param);
00036 
00037 void transaction_event_fire(transaction_event event, transaction_type type);
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 
00043 #endif /* TRANSACTION_EVENT_H_ */