Intermec 5055 Guide De Référence
im_event_wait
5-13
5
im_event_wait (continued)
Example
/********************* im_event_wait *********************************/
#include "im5055.h"
#include "ctype.h"
#include "conio.h"
#include "im5055.h"
#include "ctype.h"
#include "conio.h"
void main (void)
{
IM_UCHAR inChar='x', szNetBuffer[1024];
IM_USHORT iLength, iCountMinutes=0;
IM_ORIGIN iSource;
IM_STATUS iStatus;
{
IM_UCHAR inChar='x', szNetBuffer[1024];
IM_USHORT iLength, iCountMinutes=0;
IM_ORIGIN iSource;
IM_STATUS iStatus;
im_set_time_event (60000);
while ( toupper (inChar != 'Q') )
{
iSource = IM_KEYBOARD_SELECT | IM_TX_NET_SELECT | IM_TIMER_SELECT;
iStatus = im_event_wait(30X0, &iSource);
if (IM_ISGOOD (iStatus) )
{
if (iSource == IM_KEYBOARD_SELECT)
inChar = getch ( );
if (iSource == IM_TX_NET_SELECT)
iStatus = im_receive_buffer( IM_NET, 1024, szNetBuffer, 600,
&iLength);
if (iSource == IM_TIMER_SELECT) /* Get this once per minute even if
receive messages in between */
{
iCountMinutes++;
im_set_time_event (60000);
}
}
else
{
im_puts((IM_UCHAR *)"Timeout on event wait", IM_BOLD);
}
}
printf (“Ran %d minutes\n\r", iCountMinutes);
}
while ( toupper (inChar != 'Q') )
{
iSource = IM_KEYBOARD_SELECT | IM_TX_NET_SELECT | IM_TIMER_SELECT;
iStatus = im_event_wait(30X0, &iSource);
if (IM_ISGOOD (iStatus) )
{
if (iSource == IM_KEYBOARD_SELECT)
inChar = getch ( );
if (iSource == IM_TX_NET_SELECT)
iStatus = im_receive_buffer( IM_NET, 1024, szNetBuffer, 600,
&iLength);
if (iSource == IM_TIMER_SELECT) /* Get this once per minute even if
receive messages in between */
{
iCountMinutes++;
im_set_time_event (60000);
}
}
else
{
im_puts((IM_UCHAR *)"Timeout on event wait", IM_BOLD);
}
}
printf (“Ran %d minutes\n\r", iCountMinutes);
}