mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
This adds automatic cloning of Mifare Ultralight cards to the selected setting. Currently, only the DUMP_MFU command existed. In order to clone a Mifare Ultralight card, the user had to convert the hex output of DUMP_MFU to binary and upload the result to the card. The CLONE_MFU command will attempt to read and store the Mifare Ultralight contents directy to the slot which is then transitioned to emulation mode. The CLONE_MFU button action does the same, so the board can be configured to clone cards by simply selecting a slot with one button and cloning with the other.
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
/*
|
|
* Button.h
|
|
*
|
|
* Created on: 13.05.2013
|
|
* Author: skuser
|
|
*/
|
|
|
|
#ifndef BUTTON_H_
|
|
#define BUTTON_H_
|
|
|
|
#include "Common.h"
|
|
|
|
typedef enum {
|
|
BUTTON_R_PRESS_SHORT = 0,
|
|
BUTTON_R_PRESS_LONG,
|
|
BUTTON_L_PRESS_SHORT,
|
|
BUTTON_L_PRESS_LONG,
|
|
|
|
/* Must be last element */
|
|
BUTTON_TYPE_COUNT
|
|
} ButtonTypeEnum;
|
|
|
|
typedef enum {
|
|
BUTTON_ACTION_NONE,
|
|
BUTTON_ACTION_UID_RANDOM,
|
|
BUTTON_ACTION_UID_LEFT_INCREMENT,
|
|
BUTTON_ACTION_UID_RIGHT_INCREMENT,
|
|
BUTTON_ACTION_UID_LEFT_DECREMENT,
|
|
BUTTON_ACTION_UID_RIGHT_DECREMENT,
|
|
BUTTON_ACTION_CYCLE_SETTINGS,
|
|
BUTTON_ACTION_STORE_MEM,
|
|
BUTTON_ACTION_RECALL_MEM,
|
|
BUTTON_ACTION_TOGGLE_FIELD,
|
|
BUTTON_ACTION_STORE_LOG,
|
|
BUTTON_ACTION_CLONE,
|
|
BUTTON_ACTION_CLONE_MFU,
|
|
|
|
/* This has to be last element */
|
|
BUTTON_ACTION_COUNT
|
|
} ButtonActionEnum;
|
|
|
|
void ButtonInit(void);
|
|
void ButtonTick(void);
|
|
|
|
void ButtonGetActionList(char *List, uint16_t BufferSize);
|
|
void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action);
|
|
void ButtonGetActionByName(ButtonTypeEnum Type, char *Action, uint16_t BufferSize);
|
|
bool ButtonSetActionByName(ButtonTypeEnum Type, const char *Action);
|
|
|
|
#endif /* BUTTON_H_ */
|