SECOM
Overview Cluster Class Classes Index          Top Features

secom.posix

Class COM_DEVICE


Direct ancestors

KL_SHARED_EXCEPTIONS, COM_ABSTRACT_DEVICE, MEMORY, COM_TERMIOS_CONSTANTS

Features

Invariants

indexing

description

Objects that perform I/O operations on a communications device.

library

Serial Communications Library

copyright

Copyright (c) 2005, Brian E. Heilig

license

Eiffel Forum License v2 (see license.txt)

class COM_DEVICE

inherit

COM_ABSTRACT_DEVICE

feature -- Access

control_settings: COM_TERMIOS

-- Current control parameters for this device

handle: INTEGER

-- Handle to communications resource

termios: COM_TERMIOS

-- Current control parameters for this device

timeouts: COM_TERMIOS

-- Current control parameters for this device

feature -- Status report

is_open: BOOLEAN

-- Is the device open for reading and writing?

feature -- Status setting

close

-- Close the device.

open

-- Open the device. If open was successful set is_open
-- If open failed see errno for details.

feature -- Element change

set_control_settings (a_settings: like termios)

-- Configures the device according to the specifications in a_settings.
-- Overall timers use SIGALRM. If an overall timer is used Current must
-- have exclusive access to SIGALRM.

ensure then

alarm_handler_set: a_settings.overall_timer > 0 implies alarm_handler_installed

set_timeouts (a_settings: like termios)

-- Configures the device according to the specifications in a_settings.
-- Overall timers use SIGALRM. If an overall timer is used Current must
-- have exclusive access to SIGALRM.

ensure then

alarm_handler_set: a_settings.overall_timer > 0 implies alarm_handler_installed

feature -- Removal

dispose

-- If the device is still open then close it

feature -- Input

read_data (data: POINTER; count: INTEGER)

-- Read count bytes into the data buffer. Set last_read_count
-- to the number of bytes read. Set timed_out if less than count
-- bytes were read. See timeouts to determine when read will
-- be completed.

feature -- Output

put_data (data: POINTER; count: INTEGER)

-- Write data to the device. Set last_write_count with the
-- number of bytes written.

feature {COM_TERMIOS} -- Implementation

overall_timer: INTEGER

-- Total read timer, in milliseconds.

invariant


Documentation generated by edoc