OSI/AS Programming Manual

Example 2: Presentation Layer and ACSE
Sample Programs
E–74 056783 Tandem Computers Incorporated
--
-- Issue ACSE associate response.
--
connect_result := ZAPS^VAL^CON^ACCEPT;
pres_default_context_result := ZAPS^VAL^CNTXT^RSLT^ACCEPT;
tag := $UDBL( error_connectrsp_proc );
print_aps( "APPL2: connect response <-" );
status :=
APS_ASSOC_CONNECTRSP_( cepi
, local_appl
, connect_result
, session_rqmnts
, ! conid !
, user_data
, tag
, pres_context_result_list
, pres_default_context_result
, acse_appl_context_name
, ! acse-local-ae-title !
, ! acse-local-invocation-ids !
, ! acse-diagnostic !
);
CALL wait_for_aps_completion( error_connectrsp_proc );
IF ( status <> ZAPS^VAL^STATUS^OK ) THEN
CALL display_aps_status( error_connectrsp_proc );
--
-- Wait for P-DATA indication.
--
CALL wait_for_event( ZAPS^VAL^EVT^DATA^IND );
--
-- Get P-DATA indication user data.
--
CALL retrieve_user_data;
--
-- Wait for P-TOKEN-GIVE indication.
--
CALL wait_for_event( ZAPS^VAL^EVT^TOKEN^GIVE^IND );
--
-- Find out which tokens were given.
-- Note that we know we got the data token.
--
error := APS_SYNC_GETPARAM_( cepi
, ! sync !
, give_tokens
, ! resync-type !
, ! exception-reason !
);
IF ( error <> ZAPS^ERR^OK ) THEN
CALL display_aps_error( error_sync_getparam_proc );
--