OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
E–38 056783 Tandem Computers Incorporated
--
-- Retrieve user data from the API.
--
------------------------------------------------------------
PROC retrieve_user_data;
BEGIN
--
-- user_data is large enough to hold all of the data.
-- Real applications might call this procedure several
-- times, using next_position and more_data.
--
start_position := 0D; -- Start at the beginning.
error := APS_DATA_GETPARAM_( cepi
, $UDBL( $LEN( user_data ) )
, user_data
, more_data
, next_position
, start_position
);
IF ( error <> ZAPS^ERR^OK ) AND
( error <> ZAPS^ERR^NO^DATA ) THEN
CALL display_aps_error( error_data_getparam_proc );
END; -- proc retrieve_user_data
? PAGE
------------------------------------------------------------
--
-- Wait for an event and make certain it is the one that
-- is expected.
--
------------------------------------------------------------
PROC wait_for_event( expected_event_code );
INT expected_event_code; -- i : expected event
BEGIN
LITERAL time_limit = -1D; -- wait indefinitely
status := APS_EVENT_RECEIVE_( cepi
, time_limit
, ! tag !
);
IF ( status <> ZAPS^VAL^STATUS^EVENT ) THEN
CALL display_aps_status( error_event_proc );
--
-- Find out which event was received.
--
error := APS_STATUS_( cepi
, event_code
, device_name
, error_code
, error_subcode
, service_id
, diagnostic_buffer