GXTX / YACardEmu

Software emulator for Sanwa CRP-1231BR-10 / CRP-1231LR-10NAB / CR-S31R-10HS3 card readers.
GNU General Public License v2.0
32 stars 10 forks source link

hasCard, waitingForCard statuses exposed over API + some logging #14

Closed hjri closed 2 years ago

hjri commented 2 years ago

I cannot into C++, tried passing cardHandler and using its HasCard() directly but i don't know C++ enough to make it work, therefore I just added hasCard variable/property into CardIO::Settings that is only updated via moving card. Similarly added waitingForCard to show whether card reader is in WAITING_FOR_CARD mode, might be a bit janky since i'm not entirely sure when it's supposed to be reset, but seems to be working on WMMT3DX+ at least.

POST insertedCard now also has loadonly parameter so that you can tell emulator to load specific file without "inserting" it - this way you can prime the emulator to writing into specific file while game creates new card, trying to forcefully "insert" a card while game tries to make new card will result in error.

Also adds some logging to see what's going on with emulator without having to enable debugging/poll the API.

Fixes #12 and #13

GXTX commented 2 years ago

Since the net portion is getting too large I wanted to move it to it's own class/file but i've been quite busy. If this is functional I'll merge now.

hjri commented 2 years ago

It's functional, yeah. I'm still not sure how to properly handle the "shutter open" status, and i forgot to test "no card got inserted within time frame" situation back when i was originally testing it.

GXTX commented 2 years ago

Thanks!