if(!p->json_text) {
continue;
}
- if(!p->mode || (p->mode && (mode & p->mode) == mode)) {
+ if(p->mode && (mode & p->mode) == mode) {
int set = (ycfg.tktFlags & p->flag) == p->flag;
json_object *jsetting = json_object_new_boolean(set);
json_object_object_add(options_json, p->json_text, jsetting);
if(!p->json_text) {
continue;
}
- if(!p->mode || (p->mode && (mode & p->mode) == mode)) {
+ if(p->mode && (mode & p->mode) == mode) {
int set = (ycfg.cfgFlags & p->flag) == p->flag;
json_object *jsetting = json_object_new_boolean(set);
json_object_object_add(options_json, p->json_text, jsetting);
if(!p->json_text) {
continue;
}
- if(!p->mode || (p->mode && (mode & p->mode) == mode)) {
+ if(p->mode && (mode & p->mode) == mode) {
int set = (ycfg.extFlags & p->flag) == p->flag;
json_object *jsetting = json_object_new_boolean(set);
json_object_object_add(options_json, p->json_text, jsetting);
for (p = _ticket_flags_map; p->flag; p++) {
if ((ycfg.tktFlags & p->flag) == p->flag
&& p->capability(cfg)
- && (!p->mode || (mode & p->mode) == mode)) {
+ && (mode & p->mode) == mode) {
if (*buffer) {
strcat(buffer, str_flags_separator);
strcat(buffer, p->flag_text);
for (p = _config_flags_map; p->flag; p++) {
if ((t_flags & p->flag) == p->flag
&& p->capability(cfg)
- && (!p->mode || (mode & p->mode) == mode)) {
+ && (mode & p->mode) == mode) {
if (*buffer) {
strcat(buffer, str_flags_separator);
strcat(buffer, p->flag_text);
for (p = _extended_flags_map; p->flag; p++) {
if ((ycfg.extFlags & p->flag) == p->flag
&& p->capability(cfg)
- && (!p->mode || (mode & p->mode) == mode)) {
+ && (mode & p->mode) == mode) {
if (*buffer) {
strcat(buffer, str_flags_separator);
strcat(buffer, p->flag_text);
{ TKTFLAG_APPEND_DELAY1,"APPEND_DELAY1","appendDelay1", capability_has_ticket_mods, MODE_OUTPUT }, /* XXX: name? */
{ TKTFLAG_APPEND_DELAY2,"APPEND_DELAY2","appendDelay2", capability_has_ticket_mods, MODE_OUTPUT }, /* XXX: name? */
{ TKTFLAG_APPEND_CR, "APPEND_CR", "appendCR", capability_has_ticket_mods, MODE_OUTPUT },
- { TKTFLAG_PROTECT_CFG2, "PROTEXT_CFG2", "protectSecond",capability_has_slot_two, 0 },
+ { TKTFLAG_PROTECT_CFG2, "PROTEXT_CFG2", "protectSecond",capability_has_slot_two, MODE_ALL },
{ TKTFLAG_OATH_HOTP, "OATH_HOTP", 0, capability_has_oath, MODE_OATH_HOTP },
{ TKTFLAG_CHAL_RESP, "CHAL_RESP", 0, capability_has_chal_resp, MODE_CHAL_RESP },
{ 0, 0, 0, 0, 0 }
};
struct map_st _extended_flags_map[] = {
- { EXTFLAG_SERIAL_BTN_VISIBLE, "SERIAL_BTN_VISIBLE", "serialBtnVisible", capability_has_serial, 0 },
- { EXTFLAG_SERIAL_USB_VISIBLE, "SERIAL_USB_VISIBLE", "serialUsbVisible", capability_has_serial, 0 },
- { EXTFLAG_SERIAL_API_VISIBLE, "SERIAL_API_VISIBLE", "serialApiVisible", capability_has_serial_api, 0 },
- { EXTFLAG_USE_NUMERIC_KEYPAD, "USE_NUMERIC_KEYPAD", "useNumericKeypad", capability_has_numeric, 0 },
- { EXTFLAG_FAST_TRIG, "FAST_TRIG", "fastTrig", capability_has_fast, 0 },
- { EXTFLAG_ALLOW_UPDATE, "ALLOW_UPDATE", "allowUpdate", capability_has_update, 0 },
- { EXTFLAG_DORMANT, "DORMANT", "dormant", capability_has_dormant, 0 },
- { EXTFLAG_LED_INV, "LED_INV", "ledInverted", capability_has_led_inv, 0 },
+ { EXTFLAG_SERIAL_BTN_VISIBLE, "SERIAL_BTN_VISIBLE", "serialBtnVisible", capability_has_serial, MODE_ALL },
+ { EXTFLAG_SERIAL_USB_VISIBLE, "SERIAL_USB_VISIBLE", "serialUsbVisible", capability_has_serial, MODE_ALL },
+ { EXTFLAG_SERIAL_API_VISIBLE, "SERIAL_API_VISIBLE", "serialApiVisible", capability_has_serial_api, MODE_ALL },
+ { EXTFLAG_USE_NUMERIC_KEYPAD, "USE_NUMERIC_KEYPAD", "useNumericKeypad", capability_has_numeric, MODE_ALL },
+ { EXTFLAG_FAST_TRIG, "FAST_TRIG", "fastTrig", capability_has_fast, MODE_ALL },
+ { EXTFLAG_ALLOW_UPDATE, "ALLOW_UPDATE", "allowUpdate", capability_has_update, MODE_ALL },
+ { EXTFLAG_DORMANT, "DORMANT", "dormant", capability_has_dormant, MODE_ALL },
+ { EXTFLAG_LED_INV, "LED_INV", "ledInverted", capability_has_led_inv, MODE_ALL },
{ 0, 0, 0, 0, 0 }
};