background image
C H A P T E R 2 3
Endpoint Interface
Using the Endpoint Interface
When you set endpoint options, the cloned option frame is returned to you so that
you can check the result codes for individual options. If you set options with an
asynchronous method call, the cloned option frame is returned as a parameter to
callback method. If you set options with a synchronous
method call, the cloned option frame is returned as the value of the synchronous
method itself.
slot in each option frame is always set for returned options. It can be
set to any of the error codes listed in "Option Error Code Constants" (Table 20-5
on page 20-5) in Newton Programmer's Reference. If an option succeeds without
errors, the
slot is set to
Exceptions are not thrown when individual options fail. This allows a request to
succeed if, for example, every specified option except one succeeds. If you need to
determine whether a particular option succeeds or fails, you must check the
slot of the option in question.
Note that in one array of option frames, you can specify options that are of the
same type, and that seem to conflict. Since options are processed one at a time, in
order, the last option of a particular type is the one that is actually implemented by
the communication tool.
When instantiating an endpoint for use with the modem tool, you
can have options specified by the options parameter to the
method, as well as options specified by a modem
setup package (see Chapter 25, "Modem Setup Service."). Any
options from a modem setup package are appended to those set by
For details on the specific options you can set for the built-in communication tools,
see Chapter 24, "Built-in Communications Tools."
Initialization and Termination
Before using an endpoint, you must instantiate it using the
This method allocates memory in the system and creates the endpoint object.
Then, you must bind the endpoint object to the communication hardware by calling
method. This allocates the communication tool resources for use by
the endpoint.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна