It’s doable, and here is how you do it:
First, add this to your config file:
#ifdef CONFIG_STYLES
int crystal_blade_id;
struct CrystalBladeID {
float id() { return crystal_blade_id; }
};
#define BLADE_ID_CLASS CrystalBladeId
struct CrystalBladeIDCommand : public CommandParser {
bool Parse(const char *cmd, const char* arg) override {
if (!strcmp(cmd, "set_crystal_blade_id") && arg) {
int new_blade_id = strtol(arg, NULL, 0);
if (new_blade_id == crystal_blade_id) return true;
crystal_blade_id = new_blade_id;
return CommandParser::DoParse("scanid", nullptr);
}
return false;
}
};
CrystalBladeIDCommand crystal_blade_id_command;
#endif
Then in your RFID_Commands
you use “set_crystal_blade_id” instead of “change_preset”, like this:
RFID_Command RFID_Commands[] = {
{ 0x0000000C04ULL /* green */, "set_crystal_blade_id", "1" },
{ 0x09003A8CDCULL, "set_crystal_blade_id", "2" },
};
The numbers you provide to set_crystal_blade_id can technically be anything, but you’ll want to set up your blade array with one entry for each number. So if your RFID_Presets use “1” and “2”, then our blade array would look like this:
BladeConfig blades[] = {
{ 1, /* blade stuff */, CONFIGARRAY(green_presets) },
{ 2, /* blade stuff */, CONFIGARRAY(red_presets) },
{ NO_BLADE, /* blade stuff */, CONFIGARRAY(no_blade) },
};