def reset(stick):
nulls = (pyhsm.defines.YSM_MAX_PKT_SIZE - <NUM_LIT:1>) * '<STR_LIT:\x00>'<EOL>res = YHSM_Cmd(stick, pyhsm.defines.YSM_NULL, payload = nulls).execute(read_response = False)<EOL>unlock = stick.acquire()<EOL>try:<EOL><INDENT>stick.drain()<EOL>stick.flush()<EOL><DEDENT>finally:<EOL><INDENT>unlock()<EOL><DEDENT>return res == <NUM_LIT:0><EOL>
Send a bunch of zero-bytes to the YubiHSM, and flush the input buffer.