GeoCOM Reference Manual
File Transfer - FTR
Leica TPS1200 – Version 1.50
123
13.3.5
FTR_Download – Download file
AUT_ReadTol ...............................................
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 9008
.............................................................................................................................................................................................................................
9013
.................................................................................................................................................
AUT_ReadTol
C-Declaration
FTR_Download(unsigned short unBlockNumber, FTR_BLOCK &rBlock)
VB-Declaration
VB_FTR_Download(BlockNumber As Integer, Block As FTR_BLOCK)
Request
%R1Q,23304:
unBlockNumber
ASCII-Response
%R1P,0,0:
RC
,
FTR_BLOCK_val,FTR_BLOCK_len
Remarks
This command gets one single block of data. The command FTR_SetupDownload has to be called first.
Note:
The maximum block number in C/VB is 65535/32767 therefore the file size is limited to 28MB/14MB.
Visual Basic does not know data type unsigned integer.
Parameters
unBlockNumber in
Blocknumber. The block number starts with 1. If block
number is 0 then the download process is aborted
rBlock out
Block of data.
Return-Codes
GRC_OK
0 Execution
successful.
GRC_FTR_MISSINGSETUP
13060 Missing
setup.
GRC_FTR_INVALIDINPUT
13059
First block is missing.
GRC_FTR_FILEACCESS
13056
File access error.
See Also
FTR_SetupDownload
FTR_AbortDownload
Example
GRC_TYPE
rc;
FTR_DEVICETYPE eDeviceType;
FTR_FILETYPE eFileType;
FTR_BLOCK Block;
char szFileNameSrc[128];
unsigned short unBlockNumber;
unsigned short unBlockSize;
unsigned short unNumOfBlocks;
FILE
*pFile;
unsigned short unWritten;
eDeviceType = FTR_DEVICE_PCPARD;
eFileType = FTR_FILE_IMAGES;
strcpy(szFileNameSrc, "image000.jpg");
unBlockSize = FTR_MAX_BLOCKSIZE;
rc = FTR_SetupDownload(eDeviceType, eFileType, szFileNameSrc,
unBlockSize, unNumOfBlocks);
if(rc == GRC_OK)
{
// open the file
pFile = fopen(szFileNameSrc, "wb");
if(pFile == NULL)
{
//
error
return;
}
for(unBlockNumber = 1; unBlockNumber <= unNumOfBlocks; unBloc+)
{
rc = FTR_Download(unBlockNumber, Block);
if(rc != GRC_OK)