NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
/**
|
|
|
|
* @file nfc_supported_cards.h
|
|
|
|
* @brief Supported card plugin loader interface.
|
|
|
|
*
|
|
|
|
* @see nfc_supported_card_plugin.h for instructions on adding a new plugin.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <core/string.h>
|
|
|
|
|
|
|
|
#include <nfc/nfc.h>
|
|
|
|
#include <nfc/nfc_device.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-12-15 21:09:52 +03:00
|
|
|
/**
|
|
|
|
* @brief NfcSupportedCards opaque type definition.
|
|
|
|
*/
|
|
|
|
typedef struct NfcSupportedCards NfcSupportedCards;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Allocate NfcSupportedCards instance.
|
|
|
|
*
|
|
|
|
* @return pointer to allocated NfcSupportedCards instance.
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
NfcSupportedCards* nfc_supported_cards_alloc(void);
|
2023-12-15 21:09:52 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Delete an NfcSupportedCards instance
|
|
|
|
*
|
|
|
|
* @param[in] instance pointer to instance to be deleted.
|
|
|
|
*/
|
|
|
|
void nfc_supported_cards_free(NfcSupportedCards* instance);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Load plugins information to cache.
|
|
|
|
*
|
|
|
|
* @note This function must be called before calling read and parse fanctions.
|
|
|
|
*
|
|
|
|
* @param[in, out] instance pointer to NfcSupportedCards instance.
|
|
|
|
*/
|
|
|
|
void nfc_supported_cards_load_cache(NfcSupportedCards* instance);
|
|
|
|
|
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
/**
|
|
|
|
* @brief Read the card using a custom procedure.
|
|
|
|
*
|
|
|
|
* This function will load all suitable supported card plugins one by one and
|
|
|
|
* try to execute the custom read procedure specified in each. Upon first success,
|
|
|
|
* no further attempts will be made and the function will return.
|
|
|
|
*
|
2023-12-15 21:09:52 +03:00
|
|
|
* @param[in, out] instance pointer to NfcSupportedCards instance.
|
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
* @param[in,out] device pointer to a device instance to hold the read data.
|
|
|
|
* @param[in,out] nfc pointer to an Nfc instance.
|
|
|
|
* @returns true if the card was successfully read, false otherwise.
|
|
|
|
*
|
|
|
|
* @see NfcSupportedCardPluginRead for detailed description.
|
|
|
|
*/
|
2023-12-15 21:09:52 +03:00
|
|
|
bool nfc_supported_cards_read(NfcSupportedCards* instance, NfcDevice* device, Nfc* nfc);
|
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Parse raw data into human-readable representation.
|
|
|
|
*
|
|
|
|
* This function will load all suitable supported card plugins one by one and
|
|
|
|
* try to parse the data according to each implementation. Upon first success,
|
|
|
|
* no further attempts will be made and the function will return.
|
|
|
|
*
|
2023-12-15 21:09:52 +03:00
|
|
|
* @param[in, out] instance pointer to NfcSupportedCards instance.
|
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
* @param[in] device pointer to a device instance holding the data is to be parsed.
|
|
|
|
* @param[out] parsed_data pointer to the string to contain the formatted result.
|
|
|
|
* @returns true if the card was successfully parsed, false otherwise.
|
|
|
|
*
|
|
|
|
* @see NfcSupportedCardPluginParse for detailed description.
|
|
|
|
*/
|
2023-12-15 21:09:52 +03:00
|
|
|
bool nfc_supported_cards_parse(
|
|
|
|
NfcSupportedCards* instance,
|
|
|
|
NfcDevice* device,
|
|
|
|
FuriString* parsed_data);
|
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 06:08:09 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|