broughtong / LibMercuryRFID

Library for interacting with the Mercury API RFID Library from Python
MIT License
3 stars 2 forks source link

tagCallbcack in libmercuryrfid.c #1

Open MFernandezCarmona opened 8 years ago

MFernandezCarmona commented 8 years ago

Just detected an error in this function. Where it says sprintf(msg, "%i:%s:%d:%i:%i:%i:%ui", readerLocation, tagID, t->rssi, t->phase, t->frequency, t->timestampHigh, t->timestampLow); It should be: sprintf(msg, "%i:%s:%d:%i:%i:%u:%u", readerLocation, tagID, t->rssi, t->phase, t->frequency, t->timestampHigh, t->timestampLow); So timestamps are printed as unsigned integers and without the extra 'i' at the end.

Also I found out how to cast timestampHigh and Low to unix miliseconds timestamps: uint64_t timestamp = ((uint64_t) t->timestampHigh<< 32 ) | t->timestampLow;

Cheers!

broughtong commented 8 years ago

Sorted, thanks!

MFernandezCarmona commented 8 years ago

I have just realised that frequency is returned in KiloHertzs. I think we should use Hertzs...