p_set_baudformat()
Initializes the specified communications port for printing at a specified baud rate and data format. Accepts a device handle to the printer port, the baud rate, and the data format as parameters. Printer characteristics automatically initialized include: character mode, auto-enable, flow control, and RTS assertion. The following are conditions that must be met before calling p_set_baudformat:
•
The caller must open() the communications port.•
Valid baud rates are: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200.If an invalid rate is specified, the rate defaults to 9600.
•
Valid data formats are: 7E1 7N1, 7O1, 8E1, 8N1 and 8O1.If an invalid format is specified, format defaults to 7E1.
Prototype #include <acldev.h>
int p_set_baudformat(int h_comm_port, int baud_rate, char *data_format);
Parameters
Return Values
Dependencies Verix eVo SDK
Example The linked example code file demonstrates use of p_set_baudformat().
h_comm_port Handle for printer port. baud_rate Baud rate.
data_format Data format.
Success: 0
FUNCTION CALLS pad()
pad()
Accepts a null-terminated string (source) and adds characters as required to produce a null-terminated destination string of the length specified by the call. The location of the source in the destination (left, center, or right) is controlled through the align parameter. The pad character is specified by the caller, and can be any value, including null.
The destination string is an exact duplicate of the source string if the source string is equal to or longer than the desired length, or the length specified is negative or zero. pad() does not truncate the source string to the specified pad length. The source and destination buffers can be the same buffer. In this case, the source contents are altered; otherwise, the source buffer contents are unchanged.
Prototype #include <aclstr.h>
int pad(char *pdest_buf, char *psrc_buf, char pad_char, int pad_size, int align);
Parameters
Return Values
Dependencies Verix eVo SDK
See Also DVLR Function Calls, insert_char(), delete_char() Example The linked example code file demonstrates use of pad().
NOTE The caller must ensure that the destination buffer is the greatest of the two pad length or source buffer. No bounds checking is performed. Passing null as the pad_char parameter results in the destination buffer being filled with pad_size null characters. The previous contents of the destination buffer are destroyed.
pdest_buf Stores the padded string. psrc_buf Source string to pad. pad_char Pad with this character. pad_size Size of the padded string.
align Indicates the position of the source data in the destination string. Valid values are:
Align at: Effect #define (ACLSTR.H)
• 0x00 Source at the beginning LEFT or LEFTJUSTIFY • 0x80 Source at the end RIGHT or RIGHTJUSTIFY • 0x88 Source centered CENTER or
CENTERJUSTIFY
• other value Source at the beginning
Success: > 0: The number of characters added to the source string to produce the destination string.
Failure: 0: The source length was greater than or equal to the pad length, or the pad length was negative.
FUNCTION CALLS pause()
pause()
Waits a designated number of 10-ms intervals. A keypress terminates the function. If the time parameter is zero, the function does not pause and returns immediately with a zero return value. pause() runs until either the time interval has expired or a keypress is detected. If a keypress interrupts pause(), the key value is read and discarded.
Prototype #include <aclconio.h> int pause(unsigned time);
Parameters
Return Values
Dependencies Verix eVo SDK See Also SLEEP()
Example The linked example code file demonstrates use of pause().
time Number of 10-ms intervals to pause.
Success: 0: Pause interval successfully expired.
Failure: 1: Keypress occurred before designated pause interval expired. -1: Keypress error condition.
FUNCTION CALLS prompt()
prompt()
Displays a null-terminated string at the current line, column 1, for a specified duration or until a key is pressed, whichever occurs first. The key pressed remains in the keyboard buffer and can be read on return from prompt().
The opt parameter determines how the display is cleared before writing the display_string on the display. The wait parameter specifies the number of 10-ms increments to display the prompt message.
Prototype #include <aclconio.h>
int prompt(int h_clk, char *display_string, unsigned int wait, unsigned int opt);
Parameters
Return Values
Dependencies Verix eVo SDK
ACL prompt_at()
See Also prompt_at(), display(), display_at()
Example The linked example code file demonstrates use of prompt().
h_clk Handle to clock. display_string String to display.
wait Wait time in 10-ms increments.
opt Clear display option. The clear options, defined in ACLCONIO.H, determine how the display clears before writing the prompt message. Valid clear options are:
• CLR_LINE: Completely clears the current line, but does not change
the cursor position.
• CLR_EOL: Clears from the end of message to the end of the line. • NO_CLEAR: Writes to the display without clearing.
Success: 0: Time expired without a keypress. Failure: 1: A key was pressed before the time out.
FUNCTION CALLS prompt_at()
prompt_at()
Displays a null-terminated string at the specified column and line for a specified duration or until a key is pressed, whichever occurs first. The key pressed remains in the keyboard buffer and can be read on return from prompt_at().
The opt parameter determines how the display is cleared before writing the msg string to the display. The wait parameter specifies the number of 10-ms
increments to display the prompt message.
Prototype #include <aclconio.h>
int prompt_at(int h_clock, unsigned col, unsigned lin, char *msg, unsigned wait, unsigned opt);
Parameters
Return Values
Dependencies Verix eVo SDK
Verix eVo ACT Library display_at()
See Also prompt(), display(), display_at()
Example See also the EXTRANS.C example program. The linked example code file
demonstrates use of prompt_at().
h_clock Clock handle.
col Display column location. lin Display line location. msg Message to display.
wait Display time in 10-ms increments.
opt Clear display option. The clear options, defined in ACLCONIO.H, determine how the display will clear before writing the prompt message. Valid clear options are:
• CLR_LINE: Completely clears the line specified.
• CLR_EOL: Clears from the end of message to the end of the line. • NO_CLEAR: Writes to the display without clearing.
Success: 0: Time expired without a keypress.
FUNCTION CALLS