ADIC 601355 Rev A Benutzerhandbuch

Seite von 1192
API Guide
2-340
API Functions
601355 Rev A
50
51  printf(“\nlistening
\n” );
52
53  
/* create the notify handle */
54  
if ( (h = VS_Notify_Create()) != 
(VST_NOTIFY_HANDLE) NULL )
55  {
56  
/* initialize the notify handle */
57  
VS_Notify_SetFields ( h,
58  VSID_PROTOCOL, 
VSE_PROT_TCP,
59  VSID_PROGRAM_NUMBER, 
prognum,
60  VSID_VERSION_NUMBER, 
versnum,
61  VSID_PROCEDURE_NUMBER,procnum,
62  VSID_CLIENT_DISPATCH, 
vst_notify_dispatch,
63  VSID_TIMEOUT_VALUE, 
 
t,
64  VSID_ENDFIELD 
);
65
66  
done = VSE_FALSE;
67  
while ( ! done )
68  {
69  
/* “listen” for callbacks and 
act on the */
70
/* error code */
71  
switch ( (i = VS_Notify_Listen( 
h )) )
72  {
73  case 
VSE_ERR_TIMEOUT:
74  
printf(“Timed out\n” );
75  timeout--;
76  break;
77  case 
VSE_ERR_NONE:
78  
/* This is the successful 
case. */
79  
/* Nothing is printed 
here because */
80  
/* the notify handle is 
printed in */
81  /* 
vst_notify_dispatch 
*/
82  break;
83  default: