SECOM
Overview Cluster Class Classes Index          Top Features

secom.windows

Class COM_TIMEOUTS


Direct ancestors

EWG_STRUCT, KL_SHARED_EXCEPTIONS, COM_ABSTRACT_TIMEOUTS, COM_SHARED_WINDOWS_ERROR

Creation

Features

Invariants

indexing

description

Objects that set and query the timeout properties of a communications device.

library

Serial Communications Library

copyright

Copyright (c) 2005, Brian E. Heilig

license

Eiffel Forum License v2 (see license.txt)

class COM_TIMEOUTS

inherit

EWG_STRUCT
COM_ABSTRACT_TIMEOUTS

create

make

-- Create an uninitialized com timeouts structure.

ensure

exists: exists
not_shared: not is_shared
blocking: is_blocking

make_existing (comm: COM_DEVICE)

-- Create this structure from an extant, open communications device.
-- Throws an exception if GetCommTimeouts fails.

require

exists: comm /= Void
handle_available: comm.is_open

ensure

exists: exists
not_shared: not is_shared

feature -- Access

read_interval: INTEGER

-- Maximum time allowed to elapse between the arrival of two
-- characters on the communications line, in milliseconds.
-- During a read operation, the time period begins when the
-- first character is received. If the interval between the
-- arrival of any two characters exceeds this amount, the
-- read operation is completed and any buffered data is returned.
-- A value of zero indicates that interval time-outs are not used.
-- A value of -1, combined with zero values for both the
-- read_total_constant and read_total_multiplier specifies
-- that the read operation is to return immediately with the
-- characters that have already been received, even if no
-- characters have been received.

read_total_constant: INTEGER

-- Constant used to calculate the total time-out period for read
-- operations, in milliseconds. For each read operation, this value
-- is added to the product of read_total_multiplier and the
-- requested number of bytes.
-- A value of zero for both read_total_multiplier and this
-- indicates that total time-outs are not used for read operations.

read_total_multiplier: INTEGER

-- Multiplier used to calculate the total time-out period for read
-- operations, in milliseconds. For each read operation, this value
-- is multiplied by the requested number of bytes to be read.

write_total_constant: INTEGER

-- Constant used to calculate the total time-out period for write
-- operations, in milliseconds. For each write operation, this value
-- is added to the product of write_total_multiplier member and
-- the number of bytes to be written.
-- A value of zero for both the write_total_multiplier and this
-- indicates that total time-outs are not used for write operations.

write_total_multiplier: INTEGER

-- Multiplier used to calculate the total time-out period for write
-- operations, in milliseconds. For each write operation, this value
-- is multiplied by the number of bytes to be written.

feature -- Status report

is_blocking: BOOLEAN

-- Indicates read operations block until the requested
-- number of bytes have been read.

is_non_blocking: BOOLEAN

-- Indicates read operations return immediately with the number of
-- bytes already received, even if no bytes have been received?

feature -- Element change

get_comm_timeouts (comm: COM_DEVICE)

-- Fill this structure with the timeout properties of an extant,
-- open communications device. Throw an exception if call to
-- GetCommTimeouts fails.

require

exists: comm /= Void
is_open: comm.is_open

set_blocking

-- Set the timeout properties to be a pure blocking read.

ensure then

definition: read_interval = 0 and read_total_multiplier = 0 and read_total_constant = 0

set_inter_character_timer (time: INTEGER)

-- Set the timeout properties to include an inter-character
-- timer.

ensure then

definition: read_interval = time

set_non_blocking

-- Set the timeout properties to be a non-blocking read.

ensure then

definition: read_interval = -1 and read_total_multiplier = 0 and read_total_constant = 0

set_overall_timer (time: INTEGER)

-- Set the timeout properties to include an overall timer.

ensure then

definition: read_total_multiplier = 0 and read_total_constant = time

set_read_interval (an_interval: INTEGER)

-- Set read_interval with an_interval

require

valid_setting: an_interval >= -1

ensure

read_interval_set: read_interval = an_interval

set_read_total_constant (a_constant: INTEGER)

-- Set read_total_constant with a_constant

require

not_negative: a_constant >= 0

ensure

read_total_constant_set: read_total_constant = a_constant

set_read_total_multiplier (a_multiplier: INTEGER)

-- Set read_total_multiplier with a_multiplier

require

not_negative: a_multiplier >= 0

ensure

read_total_multiplier_set: read_total_multiplier = a_multiplier

set_write_total_constant (a_constant: INTEGER)

-- Set write_total_constant with a_constant

require

not_negative: a_constant >= 0

ensure

write_total_constant_set: write_total_constant = a_constant

set_write_total_multiplier (a_multiplier: INTEGER)

-- Set write_total_multiplier with a_multiplier

require

not_negative: a_multiplier >= 0

ensure

write_total_multiplier_set: write_total_multiplier = a_multiplier

invariant


Documentation generated by edoc