RfidResearchGroup / ChameleonUltra

The new generation chameleon based on NRF52840 makes the performance of card emulation more stable. And gave the chameleon the ability to read, write, and decrypt cards.
https://chameleonultra.com
GNU General Public License v3.0
897 stars 148 forks source link

Implement async messages #173

Open doegox opened 11 months ago

doegox commented 11 months ago

Current communication is purely synchrone: the client sends a command and the firmware answers.

We'd like to allow async messages to implement the following features:

Maybe the implementations changes should be done by taking into account a move to asyncio implementations of serial, BLE and TCP communications in the Python client.

doegox commented 11 months ago

This will require new STATUS and possibly new dummy Command code

xianglin1998 commented 11 months ago

Some design ideas for this enhancement:

  1. The data in the receiving buffer is now directly passed to the command function for execution. If need to implement commands similar to canceling the execution of Darkside, maybe need a double buffer, which means we cannot destroy the previous data.

  2. Distinguish between synchronous commands and asynchronous broadcasts using status codes or command codes.

  3. PYTHON CLI already has the ability to handle asynchronous commands, but now it is using implementation functions such as blocking and timeout.