📄 simudisp.c
字号:
/* ============================================================================ Project Name : jayaCard Module Name : proto/hal/simu/simudisp.c Version : $Id: simudisp.c,v 1.12 2004/01/11 09:56:33 dgil Exp $ Description: Simulator SIMUMSG Dispacher The Original Code is jayaCard code. The Initial Developer of the Original Code is Gilles Dumortier. Portions created by the Initial Developer are Copyright (C) 2002-2004 the Initial Developer. All Rights Reserved. Contributor(s): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see http://www.gnu.org/licenses/gpl.html History Rev Description 051303 dgil wrote it from scratch ============================================================================*/#include "precomp.h"/* ========================================================================= __simu_dispatch() ========================================================================= */void __simu_dispatch(PSIMUMSG msg){ jbyte param; switch (msg->h.kindof) { case SIMUMSG_RESET: LOG("Simu","RESET"); free_simumsg(msg); throw THROW_WARMRESET; return; case SIMUMSG_POWEROFF: LOG("Simu","POWEROFF"); free_simumsg(msg); throw THROW_COLDRESET; return; case SIMUMSG_CLOSE: LOG("Simu","CLOSE"); param = msg->h.param; free_simumsg(msg); if (param == SIMUMSG_CLOSE_AND_EXIT) { throw THROW_EXIT; } else { throw THROW_RECONNECT; } break; case SIMUMSG_UNLOCK: LOG("Simu","UNLOCK"); /* reset the lock !! */ gEEPROM[BASE_OTP+msg->h.param] = 0x00; gEEPROM[BASE_OTP+msg->h.param+8] = 0x00; free_simumsg(msg); /* re-read tag_life NOW */ BIOS_INIT_TAGLIFE(); return; case SIMUMSG_SAVE_EEPROM: LOG1("Simu","SAVE_EEPROM %d",msg->h.param); (void)__simu_save_eeprom(msg->h.param); (void)__simu_save_XML_eeprom(msg->h.param); free_simumsg(msg); return; case SIMUMSG_BAUDRATE: #ifdef JAYACFG_CONTACTLESS_BAUDRATE /* __x temporary fix to ignore */ simu_baudrate_to_card = (msg->h.param >> 4) & 0x0F; simu_baudrate_from_card = msg->h.param & 0x0F; LOG3("Simu","BAUDRATE to_card %d, from_card %d / tcl_baudrate=%d", simu_baudrate_to_card, simu_baudrate_from_card, tcl_baudrate); #endif free_simumsg(msg); return; case SIMUMSG_SAVE_RAM: LOG1("Simu","SAVE_RAM %d",msg->h.param); dumpAllSimuVar(msg->h.param); free_simumsg(msg); return; case SIMUMSG_CLEAR_EEPROM: LOG("Simu","CLEAR_EEPROM"); (void)__simu_blank_eeprom(); free_simumsg(msg); return; case SIMUMSG_LOAD_EEPROM: LOG1("Simu","LOAD_EEPROM %d",msg->h.param); (void)__simu_load_eeprom(msg->h.param); free_simumsg(msg); return; default: LOG1("Simu","unknown command : 0x%.2X",msg->h.kindof); break; } /* default is to warm reset if we don't understand the message */ free_simumsg(msg); throw THROW_WARMRESET;}/* ========================================================================= That's all folks ! ========================================================================= */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -