X25AM Management Programming Manual

Commands and Responses
X25AM Management Programming Manual528037-001
6-152
Examples of Commands and Responses
! ***************************************************************
! * call^scp *
! ***************************************************************
INT PROC call^scp;
BEGIN
! This procedure sends a command to SCP and retrieves the
! response. The value returned by call^scp is the value of
! the return token in the response.
INT error, ! error code for WRITEREAD error
sserror, ! returned by call on SPI procedure
return^token, ! the value of the return token
init^buffer,
write^count,
read^count,
count^read;
sserror := SSGETTKN(buffer, zspi^tkn^usedlen, write^count);
IF sserror THEN
CALL handle^spi^error(sserror); ! error on the call
read^count := zx25^val^buflen;
CALL WRITEREAD(scp^file^num, buffer, write^count, read^count,
count^read);
IF <> THEN
BEGIN ! an error occurred during WRITEREAD
CALL FILEINFO(scp^file^num, error); ! get error code
CALL DEBUG;
END;
! reinitialize the buffer length in the buffer
buffer.z^buflen := zx25^val^buflen;
! reinitialize the initial position in the buffer
init^buffer := zspi^val^initial^buffer;
sserror := SSPUTTKN(buffer, zspi^tkn^initial^position,
init^buffer);
IF sserror THEN
CALL handle^spi^error(sserror); ! error on the call