4 control, 1 s26_comstartbreak(), 2 s26_comendbreak() – Sensoray 2600 User Manual

Page 75

Advertising
background image

Sensoray 2600 Programming Guide

71

Comport Transaction Functions

if ( errstat & GWERRMASK )

printf( "COM1 error detected.\n" );

else if ( errstat & COM_REJECTED )

printf( "COM1 is not open.\n" );

else

printf( "There are %d characters in the Tx buffer.\n", TxCount );

8.4 Control

8.4.1 S26_ComStartBreak()

Function:

Initiates a break transmission on a comport.

Prototype:

u32 S26_ComStartBreak( u32 hbd, u8 LogDev, u32 msec, u32 retries );

Returns:

Error/status value, as described in section 8.1.1.

Notes:

S26_ComStartBreak()

is used to initiate a break transmission on a comport. The break condition will continue

until

S26_ComEndBreak()

is called or the MM is reset.

The target comport must be open when this function is called. If the comport is already closed when this command
is issued, the command will be rejected and the status byte’s

COM_REJECTED

flag will be set.

Example:

See the example in section 8.4.2.

8.4.2 S26_ComEndBreak()

Function:

Terminates a break transmission on a comport.

Prototype:

u32 S26_ComEndBreak( u32 hbd, u8 LogDev, u32 msec, u32 retries );

Returns:

Error/status value, as described in section 8.1.1.

Notes:

S26_ComEndBreak()

is used to terminate a break transmission that was started by calling the

S26_ComStartBreak()

function.

The target comport must be open when this function is called. If the comport is already closed when this command
is issued, the command will be rejected and the status byte’s

COM_REJECTED

flag will be set.

Example:

// For a duration of 250 milliseconds, transmit a break on MM number 0, COM1.

// Error detection is omitted here for clarity.

S26_ComStartBreak( 0, 1, 1000, 1 );

Sleep( 250 );

S26_ComEndBreak( 0, 1, 1000, 1 );

Parameter

Type

Description

hbd

u32

MM handle.

LogDev

u8

Logical device identifier for the target comport. Specify a value from 1 to 4 to
address comport 1 to 4, respectively.

msec

u32

Maximum time, in milliseconds, to wait for the MM to respond.

retries

u32

Maximum number of transaction retry attempts.

Parameter

Type

Description

hbd

u32

MM handle.

LogDev

u8

Logical device identifier for the target comport. Specify a value from 1 to 4 to
address comport 1 to 4, respectively.

msec

u32

Maximum time, in milliseconds, to wait for the MM to respond.

retries

u32

Maximum number of transaction retry attempts.

Advertising