mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
Merge pull request #72 from doegox/uid7_fix_manufacturer_byte
Add option to fix manufacturer byte on UID_LEFT_(DE/IN)CREMENT on 7-byte UID
This commit is contained in:
@@ -47,11 +47,17 @@ static void ExecuteButtonAction(ButtonActionEnum ButtonAction)
|
||||
|
||||
case BUTTON_ACTION_UID_LEFT_INCREMENT:
|
||||
{
|
||||
uint8_t offset = 0;
|
||||
#ifdef SUPPORT_UID7_FIX_MANUFACTURER_BYTE
|
||||
if (ActiveConfiguration.UidSize == 7) {
|
||||
offset = 1;
|
||||
}
|
||||
#endif
|
||||
ApplicationGetUid(UidBuffer);
|
||||
bool Carry = 1;
|
||||
uint8_t i;
|
||||
|
||||
for (i=0; i<ActiveConfiguration.UidSize; i++) {
|
||||
for (i=offset; i<ActiveConfiguration.UidSize; i++) {
|
||||
if (Carry) {
|
||||
if (UidBuffer[i] == 0xFF) {
|
||||
Carry = 1;
|
||||
@@ -91,11 +97,17 @@ static void ExecuteButtonAction(ButtonActionEnum ButtonAction)
|
||||
|
||||
case BUTTON_ACTION_UID_LEFT_DECREMENT:
|
||||
{
|
||||
uint8_t offset = 0;
|
||||
#ifdef SUPPORT_UID7_FIX_MANUFACTURER_BYTE
|
||||
if (ActiveConfiguration.UidSize == 7) {
|
||||
offset = 1;
|
||||
}
|
||||
#endif
|
||||
ApplicationGetUid(UidBuffer);
|
||||
bool Carry = 1;
|
||||
uint8_t i;
|
||||
|
||||
for (i=0; i<ActiveConfiguration.UidSize; i++) {
|
||||
for (i=offset; i<ActiveConfiguration.UidSize; i++) {
|
||||
if (Carry) {
|
||||
if (UidBuffer[i] == 0x00) {
|
||||
Carry = 1;
|
||||
|
||||
@@ -16,6 +16,9 @@ SETTINGS += -DCONFIG_ISO14443A_READER_SUPPORT
|
||||
#Support magic mode on mifare classic configuration
|
||||
SETTINGS += -DSUPPORT_MF_CLASSIC_MAGIC_MODE
|
||||
|
||||
#Don't touch manufacturer byte with BUTTON_ACTION_UID_LEFT_(DE/IN)CREMENT
|
||||
SETTINGS += -DSUPPORT_UID7_FIX_MANUFACTURER_BYTE
|
||||
|
||||
#Support activating firmware upgrade mode through command-line
|
||||
SETTINGS += -DSUPPORT_FIRMWARE_UPGRADE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user