dolphin_deed.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #include "dolphin_deed.h"
  2. #include <furi.h>
  3. static const DolphinDeedWeight dolphin_deed_weights[] = {
  4. {1, DolphinAppSubGhz}, // DolphinDeedSubGhzReceiverInfo
  5. {3, DolphinAppSubGhz}, // DolphinDeedSubGhzSave
  6. {1, DolphinAppSubGhz}, // DolphinDeedSubGhzRawRec
  7. {2, DolphinAppSubGhz}, // DolphinDeedSubGhzAddManually
  8. {2, DolphinAppSubGhz}, // DolphinDeedSubGhzSend
  9. {1, DolphinAppSubGhz}, // DolphinDeedSubGhzFrequencyAnalyzer
  10. {1, DolphinAppRfid}, // DolphinDeedRfidRead
  11. {3, DolphinAppRfid}, // DolphinDeedRfidReadSuccess
  12. {3, DolphinAppRfid}, // DolphinDeedRfidSave
  13. {2, DolphinAppRfid}, // DolphinDeedRfidEmulate
  14. {2, DolphinAppRfid}, // DolphinDeedRfidAdd
  15. {1, DolphinAppNfc}, // DolphinDeedNfcRead
  16. {3, DolphinAppNfc}, // DolphinDeedNfcReadSuccess
  17. {3, DolphinAppNfc}, // DolphinDeedNfcSave
  18. {2, DolphinAppNfc}, // DolphinDeedNfcEmulate
  19. {2, DolphinAppNfc}, // DolphinDeedNfcAdd
  20. {1, DolphinAppIr}, // DolphinDeedIrSend
  21. {3, DolphinAppIr}, // DolphinDeedIrLearnSuccess
  22. {3, DolphinAppIr}, // DolphinDeedIrSave
  23. {2, DolphinAppIr}, // DolphinDeedIrBruteForce
  24. {1, DolphinAppIbutton}, // DolphinDeedIbuttonRead
  25. {3, DolphinAppIbutton}, // DolphinDeedIbuttonReadSuccess
  26. {3, DolphinAppIbutton}, // DolphinDeedIbuttonSave
  27. {2, DolphinAppIbutton}, // DolphinDeedIbuttonEmulate
  28. {2, DolphinAppIbutton}, // DolphinDeedIbuttonAdd
  29. {3, DolphinAppBadusb}, // DolphinDeedBadUsbPlayScript
  30. {3, DolphinAppU2f}, // DolphinDeedU2fAuthorized
  31. };
  32. static uint8_t dolphin_deed_limits[] = {
  33. 15, // DolphinAppSubGhz
  34. 15, // DolphinAppRfid
  35. 15, // DolphinAppNfc
  36. 15, // DolphinAppIr
  37. 15, // DolphinAppIbutton
  38. 15, // DolphinAppBadusb
  39. 15, // DolphinAppU2f
  40. };
  41. _Static_assert(COUNT_OF(dolphin_deed_weights) == DolphinDeedMAX, "dolphin_deed_weights size error");
  42. _Static_assert(COUNT_OF(dolphin_deed_limits) == DolphinAppMAX, "dolphin_deed_limits size error");
  43. uint8_t dolphin_deed_get_weight(DolphinDeed deed) {
  44. furi_check(deed < DolphinDeedMAX);
  45. return dolphin_deed_weights[deed].icounter;
  46. }
  47. DolphinApp dolphin_deed_get_app(DolphinDeed deed) {
  48. furi_check(deed < DolphinDeedMAX);
  49. return dolphin_deed_weights[deed].app;
  50. }
  51. uint8_t dolphin_deed_get_app_limit(DolphinApp app) {
  52. furi_check(app < DolphinAppMAX);
  53. return dolphin_deed_limits[app];
  54. }