WMT-GmbH / pn532

no_std implementation of the Pn532 protocol using embedded_hal traits
Apache License 2.0
20 stars 19 forks source link

What is the meaning of the result received from `process` when not an error? #23

Open yanshay opened 1 month ago

yanshay commented 1 month ago

process returns either an error or &[u8].

I couldn't find an explanation of what is the content of the returned data when it isn't 0. 0 seems to be ok, but from my experiments other values are not necessarily error scenarios.

For example, when I write multiple pages I get 0x0B quite a few times when eventually the write succeeds. So I can't treat it as an error and try to write again because I always get one of the writes to result with 0x0B as return value along the way.

On reads I also saw 0x0B returned, in that case I was able to re-read and it worked (it was over 10 reads until one returned 0).

I've also seen 0x01 returned, and 0x06.

So I can't figure out how to deal with those values, I can't just treat them as errors because some operations would never complete, at least not in the way I understand how to deal with those values.