Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP 'set hextobin on/off' for uid/reader #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions firmware/Pic32/RFIDler.X/include/rfidler.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ typedef struct {
BOOL BiPhase;
BOOL Invert;
BOOL Manchester;
BOOL Hextobin;
BOOL HalfDuplex;
unsigned int Repeat;
unsigned int PotLow;
Expand Down
23 changes: 21 additions & 2 deletions firmware/Pic32/RFIDler.X/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ void show_usage(char *command)
"SET BIPHASE <ON|OFF> Set BiPhase encoding\r\n",
"SET BITS <BITS> Set number of data bits\r\n",
"SET FC <PERIOD> Set Field Clock in uS/100\r\n",
"SET HEXTOBIN <ON|OFF> Set hextobin conversion\r\n",
"SET INVERT <ON|OFF> Set data inversion\r\n",
"SET MANCHESTER <ON|OFF> Set Manchester encoding\r\n",
"SET MOD <ASK|FSK|PSK1> Set modulation scheme\r\n",
Expand Down Expand Up @@ -1886,7 +1887,10 @@ BYTE ProcessSerialCommand(char *command)
while(!get_user_abort())
{
if(get_interpreted_tag_uid(DataBuff, RFIDlerConfig.TagType))
UserMessage("%s\r\n", DataBuff);
if(RFIDlerConfig.Hex2bin)
printhexasbin(DataBuff);
else
UserMessage("%s\r\n", DataBuff);
mLED_Comms_Toggle();
}
eod();
Expand Down Expand Up @@ -1986,6 +1990,18 @@ BYTE ProcessSerialCommand(char *command)
commandok= command_nack("Invalid FC period!");
}

if (strcmp(command, "SET HEXTOBIN OFF") == 0)
{
RFIDlerConfig.Hextobin= FALSE;
commandok= command_ack(NO_DATA);
}

if (strcmp(command, "SET HEXTOBIN ON") == 0)
{
RFIDlerConfig.Hextobin= TRUE;
commandok= command_ack(NO_DATA);
}

if (strcmp(command, "SET INVERT OFF") == 0)
{
RFIDlerConfig.Invert= FALSE;
Expand Down Expand Up @@ -2359,7 +2375,10 @@ BYTE ProcessSerialCommand(char *command)
if(get_interpreted_tag_uid(DataBuff, RFIDlerConfig.TagType))
{
commandok= command_ack(DATA);
UserMessage("%s\r\n", DataBuff);
if(RFIDlerConfig.Hex2bin)
printhexasbin(DataBuff);
else
UserMessage("%s\r\n", DataBuff);
eod();
}
else
Expand Down
1 change: 1 addition & 0 deletions firmware/Pic32/RFIDler.X/src/nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ void showconfig(void)
UserMessage("\r\n Manchester: %s", (BYTE *) OnOff[RFIDlerConfig.Manchester]);
UserMessage("\r\n BiPhase: %s", (BYTE *) OnOff[RFIDlerConfig.BiPhase]);
UserMessage("\r\n Invert: %s", (BYTE *) OnOff[RFIDlerConfig.Invert]);
UserMessage("\r\n Hextobin: %s", (BYTE *) OnOff[RFIDlerConfig.Hextobin]);
UserMessageNum("\r\n Data Rate RF/n: %d", RFIDlerConfig.DataRate);
UserMessageNum("\r\n Data Rate Sub 0: %d", RFIDlerConfig.DataRateSub0);
UserMessageNum("\r\n Data Rate Sub 1: %d", RFIDlerConfig.DataRateSub1);
Expand Down
1 change: 1 addition & 0 deletions firmware/Pic32/RFIDler.X/src/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ BOOL tag_set(BYTE tag)
RFIDlerConfig.Manchester= FALSE;
RFIDlerConfig.HalfDuplex= FALSE;
RFIDlerConfig.Invert= FALSE;
RFIDlerConfig.Hextobin= FALSE;
RFIDlerConfig.Modulation= MOD_MODE_NONE;
RFIDlerConfig.PotLow= 0;
RFIDlerConfig.PotHigh= 0;
Expand Down