Skip to content
Merged
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
3 changes: 2 additions & 1 deletion cyberpunkunicorn-os/apps/frequency/card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ CardStatus waitCard(
CardStatus writeCard(const String &uri, CardInfo &out) {
if (!held || !rfid) return CARD_NO_READER;
CardInfo before;
if (!selectCard(200) || readFull() != RFIDInterface::SUCCESS) return CARD_NONE;
// The card was just seen: losing it here is a slipped card, not an empty reader.
if (!selectCard(200) || readFull() != RFIDInterface::SUCCESS) return CARD_WRITE_FAILED;
fill(before);
if (!before.ntag) return CARD_NOT_NTAG;
if (before.locked) return CARD_LOCKED;
Expand Down
8 changes: 6 additions & 2 deletions cyberpunkunicorn-os/apps/remote/app_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ void cmdWriteTag(remote::Request &r) {
if (!u.ok) return r.fail("bad_url", u.problem.length() ? u.problem : String("not a Frequency URL"));
freq::CardInfo card;
if (!tap(r, card)) return;
freq::CardStatus s = freq::writeCard(u.fixed, card);
// A phone or bank card answers the tap but can't hold a link: say so, not "No card".
freq::CardStatus s = card.ntag ? freq::writeCard(u.fixed, card) : freq::CARD_NOT_NTAG;
freq::readerClose();
if (s != freq::CARD_OK) return r.fail("write_failed", freq::cardStatusText(s));
if (s != freq::CARD_OK) {
Serial.printf("[freq] write: %s (tapped %s, %s)\n", freq::cardStatusText(s), card.type.c_str(), card.uid.c_str());
return r.fail("write_failed", freq::cardStatusText(s));
}
freq::logWrite(label, u, card.uid, false);
putCard(r.data, card);
r.data["written"] = u.host + u.path; // no query: the signature stays out of logs
Expand Down
2 changes: 1 addition & 1 deletion cyberpunkunicorn-os/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PIO_ENV=CYD-2432S028
PLATFORMIO_VERSION=6.2.0
ESPTOOL_VERSION=5.4.0
OS_NAME="CyberUnicorn 5000"
OS_VERSION=0.1.5
OS_VERSION=0.1.6

source ./boot.conf
for var in BOOT_TITLE BOOT_TAGLINE; do
Expand Down
Loading