Intermec 5055 Reference Guide

Page of 216
im_get_preamble
5-33
5
im_get_preamble
Purpose:
This function retrieves the current preamble.
Syntax:
#include "im5055.h"
IM_STATUS im_get_preamble
    (IM_UCHAR *
pre_string
,
    IM_USHORT *
length
);
IN Parameters:
None.
OUT Parameters:
pre_string    Buffer containing the preamble.
length    Length of the preamble.
Return Value:
IM_SUCCESS
    Success.
Notes:
The buffer must be large enough to contain the preamble string.
See Also:
im_get_postamble, im_get_config_info
Example
/******************** im_get_preamble *******************************/
#include <stdio.h>
#include <string.h>
#include "im5055.h"
void main(void)
{
   IM_STATUS status;
   IM_USHORT length;
   IM_UCHAR  pre_string[128];
// Use im_get_preamble to get the Preamble string
   im_cputs("\nim_get_preamble Example \n", IM_NORMAL);
   status = im_get_preamble(pre_string, &length);
// Print the results
   printf("\nPreamble: %s", pre_string);
   printf("\nlength  : %d", length);
   printf("\nstatus  : %d", status);
}