]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfviking.c
USB comms: part 3 towards @micolous PR#463
[proxmark3-svn] / client / cmdlfviking.c
index 601c29f22e712de36a07d9111c5764cced73b70c..779156c8d9d4301708c6c1ab0a0153c6ab5c4e62 100644 (file)
@@ -4,7 +4,8 @@
 // at your option, any later version. See the LICENSE.txt file for the text of
 // the license.
 //-----------------------------------------------------------------------------
-// Low frequency Viking tag commands
+// Low frequency Viking tag commands (AKA FDI Matalec Transit)
+// ASK/Manchester, RF/32, 64 bits (complete)
 //-----------------------------------------------------------------------------
 #include <stdio.h>
 #include <string.h>
@@ -51,7 +52,6 @@ uint64_t getVikingBits(uint32_t id) {
        return ((uint64_t)0xF2 << 56) | ((uint64_t)id << 8) | checksum;
 }
 
-//could be moved to a viking file
 //by marshmellow
 //see ASKDemod for what args are accepted
 int CmdVikingDemod(const char *Cmd) {
@@ -73,7 +73,8 @@ int CmdVikingDemod(const char *Cmd) {
        uint8_t  checksum = bytebits_to_byte(DemodBuffer+ans+32+24, 8);
        PrintAndLog("Viking Tag Found: Card ID %08X, Checksum: %02X", cardid, (unsigned int) checksum);
        PrintAndLog("Raw: %08X%08X", raw1,raw2);
-       setDemodBuf(DemodBuffer+ans, 64, 0);
+       setDemodBuf(DemodBuffer, 64, ans);
+       setClockGrid(g_DemodClock, g_DemodStartIdx + (ans*g_DemodClock));
        return 1;
 }
 
@@ -81,9 +82,7 @@ int CmdVikingDemod(const char *Cmd) {
 //see ASKDemod for what args are accepted
 int CmdVikingRead(const char *Cmd) {
        // read lf silently
-       CmdLFRead("s");
-       // get samples silently
-       getSamples("10000",false);
+       lf_read(true, 10000);
        // demod and output viking ID   
        return CmdVikingDemod(Cmd);
 }
Impressum, Datenschutz