2 functions, 1 mtecsdk_getdevice, Functions – MagTek EC2000 99875713 User Manual

Page 10: Mtecsdk_getdevice, 2functions

Advertising
background image

2 - Functions

ExpressCard 2000| Instant Issuance Card Personalization System | Programmer’s Reference (Windows SDK)

Page 10 of 21

2

Functions

After including the ExpressCard SDK in your custom card personalization software project (see section
1.4 How to Use the ExpressCard SDK), use the functions described in the following sections to
communicate with the device. For details about specific XML properties involved in transactions, see
99875611 ExpressCard 2000 Programmer’s Reference (XML).

2.1 MTECSDK_GetDevice

This function returns the name of the EC2000 device configured in mtecsdk.ini. See section 1.5
How to Set Up the ExpressCard SDK
for information about that file.

ULONG MTECSDK_GetDevice (

DWORD dwDeviceContext,

char *pcDevName

);


Parameters:
dwDeviceContext - Specifies the device number of the device. This must be set to 1 to get the first device
found on the network. Increment it by 1 to get the name of the next device.
pcDevName - Pointer to the buffer where the device name will be stored.

Return Values:
EC_ST_OK
EC_ST_DEVICE_NOT_FOUND
EC_ST_BAD_PARAMETER

Remarks:
If the function succeeds, the return value is EC_ST_OK, and pcDevName points to the name of the
device.

If no device is present or if no device is associated with the given dwDeviceContext, the function fails
and returns EC_ST_DEVICE_NOT_FOUND.

If there is no memory allocated for the pcDevName parameter, the function returns
EC_ST_BAD_PARAMETER.

Example:
#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN]="";

while ((dwResult = MTECSDK_GetDevice(i,(char*) pcDevName)) !=
EC_ST_DEVICE_NOT_FOUND)
{

// Device found, increment the device number

i++;

}

Advertising