Functions
- GrdHandle grdOpen(uint32_t publicCode, uint32_t readCode, uint32_t writeCode)
- GrdHandle grdOpenByFindMode (uint32_t findFlags, const GrdFindMode *findMode, size_t findModeSize, uint32_t readCode, uint32_t writeCode)
- uint32_t grdCodeRun (GrdHandle handle, uint16_t algorithmName, uint32_t p1, const void *inBuffer, size_t inBufferSize, void *outBuffer, size_t outBufferSize, uint32_t *codeRet)
- uint32_t grdCodeLoadFile (GrdHandle handle, uint16_t algorithmName, const char *filePath)
- uint32_t grdCodeLoad (GrdHandle handle, uint16_t algorithmName, const void *buffer, size_t bufferSize)
- uint32_t grdGetDongleInfo (GrdHandle handle, GrdDongleInfo *dongleInfo, size_t dongleInfoSize)
- uint32_t grdGetFindInfo (GrdHandle handle, GrdFindInfo *findInfo, size_t findInfoSize)
- uint32_t grdUpdateVendorInfo (GrdHandle handle, const GrdVendorInfo *vendorInfo, size_t vendorInfoSize)
- uint32_t grdClose (GrdHandle handle)
Detailed Description
To interact with the dongle using a standard scenario
Function Documentation
GrdHandle grdOpen (uint32_tpublicCode, uint32_treadCode, uint32_twriteCode)
This function opens a handle to the dongle
Parameters:
publicCode - Public code
readCode - Read code
writeCode - Write code
Returns:
If the function succeeds, the return value is a handle to the dongle. If the function fails or fails to locate dongles from the search terms, the return value is INVALID_HANDLE
GrdHandle grdOpenByFindMode (uint32_tfindFlags, const GrdFindMode *findMode, size_tfindModeSize, uint32_treadCode, uint32_twriteCode)
This function opens a handle to the dongle that matches a specific search criteria
Parameters:
findFlags - Combination of GrdFM_xxx flags
findMode - A pointer to the GrdFindMode structure
findModeSize - Size of the GrdFindMode structure
readCode - Read code
writeCode - Write code
Returns:
If the function succeeds, the return value is a handle to the dongle. If the function fails or fails to locate dongles from the search terms, the return value is INVALID_HANDLE
uint32_t grdCodeRun (GrdHandlehandle, uint16_talgorithmName, uint32_tp1, const void *inBuffer, size_tinBufferSize, void *outBuffer, size_toutBufferSize, uint32_t *codeRet)
Run user-defined loadable code
Parameters:
handle - A valid handle value
algorithmName - Algorithm numerical name
p1 - Parameter (subfunction code) for loadable code
inBuffer - A pointer to the buffer that contains the data to be sent into the user-defined loadable code
inBufferSize - The amount of data to be sent to the dongle
outBuffer - A pointer to the buffer that is to receive the data returned by the user-defined loadable code
outBufferSize - The amount of data to be received from the dongle
codeRet - Pointer to the return code returned by the user-defined loadable code
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdCodeLoadFile (GrdHandlehandle, uint16_talgorithmName, const char *filePath)
Load user-defined loadable code
Parameters:
handle - A valid handle value
algorithmName - Algorithm numerical name
filePath - A pointer to zero terminating string, which contains the full path to the GCEXE-file.
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdCodeLoad (GrdHandlehandle, uint16_talgorithmName, const void *buffer, size_tbufferSize)
Load user-defined loadable code
Parameters:
handle - A valid handle value
algorithmName - Algorithm numerical name
buffer - A pointer to the buffer for GCEXE-file
bufferSize - Buffer size for GCEXE-file
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdGetDongleInfo (GrdHandlehandle, GrdDongleInfo *dongleInfo, size_tdongleInfoSize)
The function returns detailed information about the dongle, that was previously opened by grdOpen function
Parameters:
handle - A valid handle value
dongleInfo - A pointer to the DongleInfo structure
dongleInfoSize - Size of the dongleInfo buffer
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdGetFindInfo (GrdHandlehandle, GrdFindInfo *findInfo, size_tfindInfoSize)
The function returns information about finding dongle, that was previously opened by grdOpen function
Parameters:
handle - A valid handle value
findInfo - A pointer to the FindInfo structure
findInfoSize - Size of the findInfo buffer
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdUpdateVendorInfo (GrdHandlehandle, const GrdVendorInfo *vendorInfo, size_tvendorInfoSize)
Update vendor dongle fields
Parameters:
handle - A valid handle value
vendorInfo - A pointer to the GrdVendorInfo structure
vendorInfoSize - Size of the GrdVendorInfo structure
Returns:
Returns zero if successful, otherwise an error code is returned
uint32_t grdClose (GrdHandlehandle)
The grdCloseHandle function closes handles previously opened with grdOpen function
Parameters:
handle - A valid handle value
Returns:
Returns zero if successful, otherwise an error code is returned