Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get device capabilities #104

Merged
merged 10 commits into from
Sep 7, 2023

Conversation

Foxushka
Copy link
Contributor

@Foxushka Foxushka commented Aug 28, 2023

Implement hw raw to send raw commands to chameleon (for easier development)
Implement hf mf info to get UID/SAK/ATQA from current slot

Implement DATA_CMD_GET_DEVICE to fetch all available commands from chameleon
Implement DATA_CMD_GET_DEVICE_CAPABILITIES to get current chameleon type (ultra or lite)
Implement DATA_CMD_GET_SETTINGS to get all chameleon settings in one command

@github-actions
Copy link

You are welcome to add an entry to the CHANGELOG.md as well

@github-actions
Copy link

github-actions bot commented Aug 28, 2023

Built artifacts for commit 902deed

Firmware

Client

@doegox
Copy link
Contributor

doegox commented Aug 28, 2023

ok if I push a fix to GET_DEVICE on your PR ? (wrong (uint8_t*)1 makes fw crashing)
and I'll also augment max-line-size of autopep8 to 120 else all your style changes to avoid carriage return will be reverted by the next make_style call.

Generally speaking, please avoid massive style changes mixed with functional changes, it makes hard to review your changes.

@doegox
Copy link
Contributor

doegox commented Aug 28, 2023

For endianness we should use systematically everywhere functions to convert to/from "Network byte order" and not make any assumption on host byte order.
In C: htonl, htons, ntohl, ntohs
In Python: '!H' and '!L' with struct.pack/unpack
Probably existing functions to be fixed but you can start with this good habit on GET_DEVICE_CAPABILITIES :)

@Foxushka
Copy link
Contributor Author

In C: htonl, htons, ntohl, ntohs

I've tried to search for them, but they exists only in newer nRF Connect SDK (or I searched incorrectly)
https://github.com/nrfconnect/sdk-nrf/blob/main/ext/iperf3/portable_endian.h

@doegox
Copy link
Contributor

doegox commented Aug 28, 2023

Hmm it seems they were available as macros (HTONL) in previous nRF SDKs, from nRF IoT SDK, e.g. https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__iot__defines.html
but I don't know why it's gone in latest...
Maybe reintegrate the defs e.g. from https://github.com/mwaylabs/fruitymesh/blob/bb0a16a2d5750c96978adcb4307ebee5b4931a6b/sdk/sdk15/components/iot/common/iot_defines.h#L64

@doegox
Copy link
Contributor

doegox commented Aug 28, 2023

They are in SDK 17.1.0 in external/lwip/src/include/lwip/def.h as PP_HTONS etc but external/lwip/src/include/lwip/def.h was not committed in this repo. Still probably it's better just to add the macros ourselves

@Foxushka
Copy link
Contributor Author

@doegox I'm still waiting for your fix and correct hto* porting

@doegox
Copy link
Contributor

doegox commented Aug 30, 2023

ha sorry you never replied so I thought you did on your side.
done.

@Foxushka Foxushka marked this pull request as ready for review September 6, 2023 20:38
@Foxushka Foxushka changed the title [WIP] Get device capabilities Get device capabilities Sep 6, 2023
@doegox
Copy link
Contributor

doegox commented Sep 7, 2023

i'd say it's good enough for merge now, even if I would avoid reusing existing structs with weird things like non-typed enums, and hardcoding sizes because struct is not declared for Lite. Yes I'm looking at cmd_processor_get_mf1_anti_coll_data() .
But as all previous commands should be screened for that as well, let's do it in a future step.

@doegox doegox merged commit 1bb6840 into RfidResearchGroup:main Sep 7, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants