plugin_wiegand.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "plugin_interface.h"
  2. #include <flipper_application/flipper_application.h>
  3. static int wiegand_format_count(uint8_t bit_length, uint64_t bits) {
  4. UNUSED(bit_length);
  5. UNUSED(bits);
  6. FURI_LOG_I(PLUGIN_APP_ID, "count");
  7. return 1;
  8. }
  9. static void wiegand_format_description(
  10. uint8_t bit_length,
  11. uint64_t bits,
  12. size_t index,
  13. FuriString* description) {
  14. FURI_LOG_I(PLUGIN_APP_ID, "description %d", index);
  15. UNUSED(bit_length);
  16. UNUSED(bits);
  17. furi_string_cat_printf(description, "[%i] <name> FC: CN:", index);
  18. }
  19. /* Actual implementation of app<>plugin interface */
  20. static const PluginWiegand plugin_wiegand = {
  21. .name = "Plugin Wiegand",
  22. .count = &wiegand_format_count,
  23. .description = &wiegand_format_description,
  24. };
  25. /* Plugin descriptor to comply with basic plugin specification */
  26. static const FlipperAppPluginDescriptor plugin_wiegand_descriptor = {
  27. .appid = PLUGIN_APP_ID,
  28. .ep_api_version = PLUGIN_API_VERSION,
  29. .entry_point = &plugin_wiegand,
  30. };
  31. /* Plugin entry point - must return a pointer to const descriptor */
  32. const FlipperAppPluginDescriptor* plugin_wiegand_ep(void) {
  33. return &plugin_wiegand_descriptor;
  34. }