User's Manual
29
Use of each field can vary according to the executed command, but is generally as follows.
lpt
Parallel or USB port identifier where the SmartKey dongle is located
command
Code of the command to be executed
label
The SmartKey's LABEL: The label is necessary for all commands.
password
The SmartKey's PASSWORD. The PASSWORD is necessary for all commands requiring
access to SmartKey's memory
data
The contents of SmartKey's memory and a generic buffer for operations requiring exchange of
data
fail_counter
Counter of failed accesses to SmartKey.
status
Result of the execution of the command. Value 0 indicates that the command was correctly
executed.
ext_data
Content of SmartKey's extended memory.
It should be considered that, although some fields have the same name as the dongle's physical registers, they are
different entities. For example, the content of SmartKey's memory is actually present in the structure's data field only
during READING and WRITING operations. For example, during the SCRAMBLING operation, the data field
contains the data for scrambling between PC and SmartKey. The SCRAMBLING function uses the data field only as a
variable in support of its own operations, and does not modify the content of SmartKey's memory.
To execute a command:
• State a structure type variable with SmartKey fields.
• Fill the variable's fields with the values requested by the command.
In particular, the command field must be set to include the command to be executed, and all other fields
required for executing the command itself.
•
Call up the function defined in the SmartKey driver, passing the structure variable as the subject. The name of
the function and the structure's passing method depend on the development environment being used. The
function is generally called msclink () and the variable is passed according to address and not value.
• From the status field, read the result of the command and every other output value.
The SDK SmartKey contains examples of the main development environments. Refer to the LEGGIMI.TXT file of
each example for more details on how to use the SmartKey driver in that specific environment.
If you wish to use a development environment differing from the environments explicitly supported, you can, in any
event, make direct use of the available libraries, if the language being used is able to import static (in format .OBJ/.LIB)
or dynamic (in format .DLL) external libraries.
9.2 Locating mode
The LOCATING mode searches the SmartKey with a label pre-fixed on all the ports of the system, whether
parallel or USB
, and enables the protected software to detect on which of these ports the dongle is fitted.
The result of the LOCATING operation is the identifier of the port on which the dongle is installed. This identifier must
be used for subsequent operations on the dongle. You cannot make assumption on this value, it may change depending
on the SmartKey model, driver version, operating system installed and PC configuration. You must only get it in the
LPT field after the LOCATING command and use it in all the other commands until the application end.
Use of the LOCATING function makes the protected software independent of the parallel/USB port on which the user
installs the dongle.
After the LOCATING command the LPT field is filled with the identifier of the port on which the dongle is present.
Remember that with the FX dongles, the Label cannot be programmed and coincides with the Id-Code, whereas by
using the programmable dongles, the Label can be programmed with any sequence of 16 bytes. In both cases, the
LOCATING mode is fully operational
The exchange of information is organized like this:
Models ALL
Input COMMAND ‘L’