Files
cdev-1.7.2n/doc/html/cdevTutorial.html
2022-12-13 12:44:04 +01:00

9739 lines
353 KiB
HTML
Executable File

<! This document generated using mif2html Version 1.0 - Walt Akers - 1996 !>
<head>
<title>CDEV Documentation</title>
</head>
<body bgcolor="#E0E0FF">
<body>
<! ************************ FILE : cdevTutorialTITLE.mif *****************************!>
<br><hr><br>
<table width=100%>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start ADDRESS ***!><font size=+12 color=Black><strong><em>
A CDEV Tutorial
<!*** Finish ADDRESS ***!></p></strong></em></font>
<!*** Start ADDRESS-SUBHEAD ***!><font size=+2 color=Black><strong>
Techniques for using the Control Device Interface
<!*** Finish ADDRESS-SUBHEAD ***!></p></strong></font>
<!*** Start ADDRESS-VERSION ***!><font size=+2 color=Black>
</p>
Chip Watson, Jie Chen, Danjin Wu, Walt Akers
</p>
</p>
Version 1.5 - December 9, 1996
</p>
</p>
TJNAF - Thomas Jefferson National Accelerator Facility
<!*** Finish ADDRESS-VERSION ***!></p></font>
</td></tr>
</table>
<! *************************** TABLE OF CONTENTS ****************************!>
<br><hr><br>
<table width=100%>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top align=center>
<!*** Start CLASS-TOC-TITLE ***!><font size=+3><strong>
Table of Contents
<!*** Finish CLASS-TOC-TITLE ***!></p></strong></font>
</td></tr>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<table>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
1.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF1">Developing CDEV Applications</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF2">Overview</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF3">Steps in Developing a CDEV Application</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
2.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF4">Developing Device Definition Language Files</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF5">Device Definition Language (DDL) File Overview</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF6">Service Definitions</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF7">Class Definitions</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF8">Verb Definitions</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF9">Class Inheritance</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF10">Attribute Definitions</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF11">Attribute Service Data</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF12">Message Definitions</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF13">Device Instances</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF14">Device Name Substitution</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF15">Device Name Aliasing</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF16">Defining cdevCollections </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF17">#include Directive</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF18">Sample DDL</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
3.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF19">Using the <em>cdevSystem </em>Object</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF20">Overview of the cdevSystem Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF21">Public Functions of the cdevSystem Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF22">attachRef</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF23">attachPtr</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF24">defaultSystem</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF25">getDevice </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF26">getRequestObject</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF27">name</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF28">prefix</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF29">prefix</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF30">flush</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF31">poll</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF32">pend</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF33">pend</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF34">getFd</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF35">addFdChanged Callback</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF36">autoErrorOn</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF37">autoErrorOff</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF38">reportError</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF39">setErrorHandler</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF40">setThreshold </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF41">Sample Code</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
4.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF42">Using the <em>cdevDevice </em>Object</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF43">Overview of the cdevDevice Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF44">Public Functions of the cdevDevice Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF45">attachRef</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF46">attachPtr</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF47">detach</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF48">detach</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF49">getRequestObject</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF50">name</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF51">system</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF52">setContext</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF53">getContext</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF54">setPrivate</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF55">getPrivate</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF56">send</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF57">sendNoBlock</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF58">sendCallback</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF59">Sample Code</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF60">Attaching to a cdevDevice Object</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF61">Getting and Setting Context for a cdevDevice</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF62">Sending Messages to a Device Synchronously</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF63">Sending Messages to a Device Asynchronously</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF64">Using sendNoBlock</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF65">Managing sendNoBlock Messages with the cdevSystem object</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF66">Grouping sendNoBlock Messages with cdevGroup</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF67">Using deferred groups for repeating lists of operations</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF68">Using sendCallback</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
5.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF69">Using the <em>cdevRequestObject </em>Object</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF70">Overview of the cdevRequestObject Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF71">Public Member Functions of the cdevRequestObject Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF72">attachRef</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF73">attachRef</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF74">attachPtr</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF75">attachPtr</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF76">detach</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF77">detach</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF78">message</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF79">device</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF80">system</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF81">service</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF82">getState</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF83">getAccess</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF84">setContext</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF85">getContext</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF86">getPrivate</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF87">setPrivate</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF88">send</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF89">sendNoBlock</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF90">sendCallback</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF91">Sample Code</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF92">Attaching to a cdevRequestObject Object</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF93">Getting and Setting Context for a cdevRequestObject</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF94">Sending Messages to a Device Synchronously</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF95">Sending Messages to a Device Asynchronously </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF96">Using sendNoBlock</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF97">Managing sendNoBlock Messages with the cdevSystem object</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF98">Grouping sendNoBlock Messages with cdevGroup</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF99">Using deferred groups for repeating lists of operations</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF100">Using sendCallback</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
6.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF101">Using the <em>cdevData </em>Object</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF102">Overview of the cdevData Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF103">cdevData Tags</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF104">XDR Packaging of cdevData Objects</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF105">Public Functions of the cdevData Class</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF106">tagC2I</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF107">tagI2C</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF108">insertTag</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF109">operator =</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF110">Cast operators</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF111">asciiDump</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF112">xdrSize</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF113">xdrExport</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF114">xdrExport</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF115">xdrImport</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF116">remove</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF117">changeTag</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF118">getType</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF119">getDim</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF120">getElems</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF121">getBounds</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF122">setBounds</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF123">insert (<em>scalar</em>)</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF124">insert (array)</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF125">insert (character string)</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF126">get</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF127">get (character string)</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF128">find</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF129">Sample Code</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
7.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF130">Using the <em>cdevDirectory</em> Device</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF131">cdevDirectory Device</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF132">Attaching to the cdevDirectory</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF133">Messages Supported by cdevDirectory</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF134">&quot;query&quot; </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF135">&quot;queryClass&quot;</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF136">&quot;queryAttributes&quot; </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF137">&quot;queryMessages&quot; </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF138">&quot;queryVerbs&quot; </a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF139">&quot;service&quot;</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF140">&quot;serviceData&quot;</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF141">&quot;update&quot;</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF142">&quot;validate&quot;</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
8.
<!*** Finish HEADING1TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF143">Default Service Behavior for Standard Messages</a>
<!*** Finish HEADING1TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF144">Overview</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF145">&quot;get&quot; Message</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF146">&quot;set&quot; Message</a>
<!*** Finish UHEADING2TOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF147">&quot;monitorOn&quot; Message</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF148">CDEV_SUCCESS:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF149">CDEV_DISCONNECTED: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF150">CDEV_RECONNECTED: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF151">CDEV_ERROR:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF152">CDEV_INVALIDOBJ: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF153">CDEV_INVALIDARG:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF154">CDEV_INVALIDSVC:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF155">CDEV_NOTCONNECTED: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF156">CDEV_IOFAILED: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF157">CDEV_CONFLICT:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF158">CDEV_NOTFOUND:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF159">CDEV_TIMEOUT:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF160">CDEV_CONVERT:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF161">CDEV_OUTOFRANGE:</a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF162">CDEV_NOACCESS: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF163">CDEV_ACCESSCHANGED: </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<!*** Finish UHEADING2TOC ***!><br></font>
</td>
<td valign=top>
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF164">&quot;monitorOff&quot; Message</a>
<!*** Finish UHEADING2TOC ***!><br></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF165">device </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF166">attribute </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF167">function </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td>
<td valign=top>
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
<a href="cdevTutorial.html#TOCREF168">userarg </a>
<!*** Finish FUNC_NAMETOC ***!><br></font>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
<! **************************** LIST OF FIGURES *****************************!>
<br><hr><br>
<table width=100%>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top align=center>
<!*** Start CLASS-LOF-TITLE ***!><font size=+3><strong>
List of Figures
<!*** Finish CLASS-LOF-TITLE ***!></p></strong></font>
</td></tr>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 1:
<a href="cdevTutorial.html#LOFREF1">Service definitions in the CDEV DDL file</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 2:
<a href="cdevTutorial.html#LOFREF2">CDEV DDL class definition containing a list of verbs</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 3:
<a href="cdevTutorial.html#LOFREF3">CDEV DDL class definition using inheritance</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 4:
<a href="cdevTutorial.html#LOFREF4">CDEV DDL class definition containing a list of attributes</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 5:
<a href="cdevTutorial.html#LOFREF5">CDEV DDL class definition containing a list of messages</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 6:
<a href="cdevTutorial.html#LOFREF6">CDEV DDL class definition to instantiate a list of devices</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 7:
<a href="cdevTutorial.html#LOFREF7">Implementing device name substitution in a CDEV DDL file</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 8:
<a href="cdevTutorial.html#LOFREF8">Implementing device name aliasing in a CDEV DDL file</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 9:
<a href="cdevTutorial.html#LOFREF9">cdevCollection Definition in the CDEV DDL File</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 10:
<a href="cdevTutorial.html#LOFREF10">Using the #include directive in a CDEV DDL file</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 11:
<a href="cdevTutorial.html#LOFREF11">Sample complete DDL file</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 12:
<a href="cdevTutorial.html#LOFREF12">Methods for obtaining a cdevSystem object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 13:
<a href="cdevTutorial.html#LOFREF13">Installing a user specified error handler</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 14:
<a href="cdevTutorial.html#LOFREF14">Return codes generated by the send method</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 15:
<a href="cdevTutorial.html#LOFREF15">Attaching to a cdevDevice object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 16:
<a href="cdevTutorial.html#LOFREF16">Altering the context of a cdevDevice object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 17:
<a href="cdevTutorial.html#LOFREF17">Using the send method of a cdevDevice object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 18:
<a href="cdevTutorial.html#LOFREF18">Using sendNoBlock to communicate with a cdevDevice </a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 19:
<a href="cdevTutorial.html#LOFREF19">Using the sendCallback method of a cdevDevice object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 20:
<a href="cdevTutorial.html#LOFREF20">Return codes generated by the send method</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 21:
<a href="cdevTutorial.html#LOFREF21">Obtaining a cdevRequestObject from a cdevDevice object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 22:
<a href="cdevTutorial.html#LOFREF22">Altering the context of a cdevRequestObject object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 23:
<a href="cdevTutorial.html#LOFREF23">Using the send method of a cdevRequestObject object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 24:
<a href="cdevTutorial.html#LOFREF24">Using sendNoBlock to communicate with a cdevRequestObject </a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 25:
<a href="cdevTutorial.html#LOFREF25">Using the sendCallback method of a cdevRequestObject object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 26:
<a href="cdevTutorial.html#LOFREF26">Using insertTag to add a new tag</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 27:
<a href="cdevTutorial.html#LOFREF27">Using tagC2I and tagI2C to determine cdevData tag identifiers </a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 28:
<a href="cdevTutorial.html#LOFREF28">Inserting and retrieving scalar data items using a cdevData object </a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 29:
<a href="cdevTutorial.html#LOFREF29">Using the changeTag method of the cdevData object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 30:
<a href="cdevTutorial.html#LOFREF30">Using one-dimensional arrays with cdevData objects</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 31:
<a href="cdevTutorial.html#LOFREF31">Using multi-dimensional arrays with cdevData objects</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 32:
<a href="cdevTutorial.html#LOFREF32">Using character strings with cdevData objects</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 33:
<a href="cdevTutorial.html#LOFREF33">Using character string arrays with cdevData objects</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 34:
<a href="cdevTutorial.html#LOFREF34">Using the find method of the cdevData object</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 35:
<a href="cdevTutorial.html#LOFREF35">Attaching to the cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 36:
<a href="cdevTutorial.html#LOFREF36">cdevData Input/Output associated with a &quot;query&quot; message<ATbl 177></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 37:
<a href="cdevTutorial.html#LOFREF37">Using the &quot;query&quot; Message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 38:
<a href="cdevTutorial.html#LOFREF38">cdevData input/output associated with a &quot;queryClass&quot; message<ATbl 185></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 39:
<a href="cdevTutorial.html#LOFREF39">Using the &quot;queryClass&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 40:
<a href="cdevTutorial.html#LOFREF40">cdevData input/output associated with a &quot;queryAttributes&quot; message<ATbl 178></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 41:
<a href="cdevTutorial.html#LOFREF41">Using the &quot;queryAttributes&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 42:
<a href="cdevTutorial.html#LOFREF42">cdevData input/output associated with a &quot;queryMessages&quot; message<ATbl 180></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 43:
<a href="cdevTutorial.html#LOFREF43">Using the &quot;queryMessages&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 44:
<a href="cdevTutorial.html#LOFREF44">cdevData input/output associated with a &quot;queryVerbs&quot; message<ATbl 179></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 45:
<a href="cdevTutorial.html#LOFREF45">Using the &quot;queryVerbs&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 46:
<a href="cdevTutorial.html#LOFREF46">cdevData input/output associated with a &quot;service&quot; message<ATbl 181></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 47:
<a href="cdevTutorial.html#LOFREF47">Using the &quot;service&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 48:
<a href="cdevTutorial.html#LOFREF48">cdevData input/output associated with a &quot;serviceData&quot; message<ATbl 182></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 49:
<a href="cdevTutorial.html#LOFREF49">Using the &quot;serviceData&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 50:
<a href="cdevTutorial.html#LOFREF50">cdevData input/output associated with a &quot;update&quot; message<ATbl 183></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 51:
<a href="cdevTutorial.html#LOFREF51">Using the &quot;update&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 52:
<a href="cdevTutorial.html#LOFREF52">cdevData input/output associated with a &quot;validate&quot; message<ATbl 184></a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 53:
<a href="cdevTutorial.html#LOFREF53">Using the &quot;update&quot; message with a cdevDirectory device</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 54:
<a href="cdevTutorial.html#LOFREF54">Default behavior of the &quot;get&quot; and &quot;set&quot; messages</a>
<!*** Finish FIGURELOF ***!><br></font>
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
Figure 55:
<a href="cdevTutorial.html#LOFREF55">Default behavior of the &quot;monitorOn&quot; and &quot;monitorOff&quot; messages</a>
<!*** Finish FIGURELOF ***!><br></font>
</td></tr>
</table>
<! ************************ FILE : ./cdevTutorial.mif *****************************!>
<br><hr><br>
<table width=100%>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
1.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF1">
Developing CDEV Applications
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF2">
Overview
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The purpose of this section is to describe the steps that a CDEV user must perform in
order to effectively develop a CDEV application. This section assumes that the user is
either using one of the CDEV services provided in the CDEV distribution, or has a
local or third party developed CDEV service with which the application will
communicate.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF3">
Steps in
Developing a
CDEV Application
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>Construct a CDEV device definition file. </strong>The CDEV device definition file is the
roadmap that CDEV uses to define services and determine which device and
message combinations are associated with those services. This file should be
constructed and defined in the <strong><em>CDEVDDL</strong></em> environment variable prior to executing
a CDEV application. Check with the CDEV adminstrator to determine if this file
already exists on your system.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>Design and write your source code.</strong> This step is intentional broad in scope
because the capabilities provided by various CDEV services may be completely
dissimilar in nature. The primary capability that CDEV provides is standardization
of the interface between any application and any underlying CDEV service.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>Compile and link application with the CDEV library. </strong>This step requires the
source code to include the necessary CDEV C++ header files and linking with the
<strong>libcdev.sl</strong> or <strong>libcdev.a</strong> libraries.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>Set any required environment variables.</strong> The primary environment variables
required by CDEV are <strong>CDEVSHOBJ </strong>and<strong> CDEVDDL</strong>. CDEVSHOBJ is used to
located shared objects, and cdevddl is used to specify the complete path to the
CDEV device definition file. Individual services may have additional requirements.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>Execute your application.</strong>
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
Note: Applications linked with the archive library are not capable of loading
dynamically loadable CDEV services.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
2.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF4">
Developing Device Definition Language Files
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF5">
Device Definition
Language (DDL)
File Overview
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The Device Definition Language File or DDL File is the roadmap that CDEV uses to
associate certain device and message combinations with a CDEV service. The DDL
file provides the mechanism for defining <em>service definitions, class definitions</em> and
<em>instance definitions.</em>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF6">
Service Definitions
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The service definition is used to publicly define the existence of a CDEV service. The
service definition declares the name of the service and the names of any special
cdevData tags that the service will use. The following is a simple service definition.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 1:
<a name="LOFREF1">
Service definitions in the CDEV DDL file
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*
* Definition of service X
*/
service x
{
tags { tag1, tag2 }
}
/*
* Definition of service y
*/
service y
{
tags {}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 98>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The service definition above defines the service &quot;x&quot; and service &quot;y&quot;. During the
execution of a CDEV application, when a device and message combination is related
to the &quot;x&quot; service, CDEV will attempt to load the dynamic library for the service. By
convention the name of the library will be &quot;xService.so&quot;, where &quot;x&quot; is the name of the
service within the DDL file.
</p>
The service definition also defines the tags &quot;tag1&quot; and &quot;tag2&quot; in conjunction with
service &quot;x&quot;. These tags will be used later to define special service data that is related
to a specific device attribute. Service &quot;y&quot; has no special tags associated with it.
</p>
This example also illustrates the formats of comments within the DDL file. The syntax
of the DDL file accommodates the use of C style multi-line comments.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF7">
Class Definitions
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The class definition is used within the DDL file to declare a collection of <em>verbs</em>,
<em>attributes</em> or <em>messages </em>that may be applied to one or more CDEV device instances.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF8">
Verb Definitions
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following examples shows the syntax for declaring a class definition that contains
only a list of verbs.
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 2:
<a name="LOFREF2">
CDEV DDL class definition containing a list of verbs
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
class stdio
{
verbs { get, set, monitorOn, monitorOff }
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 104>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
In the above example, the &quot;<em>stdio</em>&quot; class is defined and it is declared to contain four
verbs: <em>get, set, monitorOn </em>and<em> monitorOff. </em>Any other class that is derived from this
class, or any device that is instantiated from this class will inherit these four verbs.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF9">
Class Inheritance
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The CDEV DDL file supports the notion of inheriting one class from another class. The
pre-existing class is called the <em>super-class</em>, while the class that is inheriting from the
pre-existing class is called the <em>sub-class</em>. To specify inheritance within the CDEV DDL
file, the syntax is similar to the syntax used in C++. The name of the new class is
followed by a colon, which is followed by the name of the <em>super-class</em>.
</p>
<em>In order to support the possibility of a colon as a character in the class name, a space
must separate the name of the class and the colon.</em>
</p>
In the next example, the &quot;magnetIO&quot; class is defined. This class inherits from the
<em>&quot;stdio&quot;</em> class, and receives the verbs <em>get, set, monitorOn, and monitorOff. </em>To this list of
verbs, it adds a new verb: <em>&quot;reset&quot;</em>.<em> </em>
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 3:
<a name="LOFREF3">
CDEV DDL class definition using inheritance
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
class stdio
{
verbs { get, set, monitorOn, monitorOff }
}
class magnetIO : stdio
{
verbs { reset }
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 110>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF10">
Attribute
Definitions
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
Class definitions are also used to define <em>attributes</em>. An attribute is a component of a
CDEV device that can be combined with a <em>verb</em> to define a message. When an
<em>attribute</em> is declared within a class, CDEV will assume that the <em>attribute</em> supports each
of the <em>verbs</em> that exist within the class.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF11">
Attribute Service
Data
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
When the attribute is defined, the user must define the name of the service that will
receive the messages associated with it, and any <em>service data</em> that is associated with
it. This service data is defined using the tag names that are declared in the <em>tags</em>
section of the service definition.
</p>
The following example declares the class <em>&quot;element&quot;. </em>This class inherits its verbs from
the <em>&quot;stdio&quot; </em>class. Each attribute is associated with a <em>service</em> name and is followed by
service data.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 4:
<a name="LOFREF4">
CDEV DDL class definition containing a list of attributes
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************
* Definition of service X
*****************************/
service x
{
tags { tag1, tag2 }
}
/*****************************
* Definition of stdio class
*****************************/
class stdio
{
verbs { get, set, monitorOn, monitorOff }
}
/*****************************
* Definition of element class
*****************************/
class element : stdio
{
attributes
{
value1 x {tag1=1.0, tag2=Value};
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 115>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
Service data also supports the notion of expression replacement. If the character
string <strong><em>&quot;&lt;&gt;&quot;</strong></em><strong> </strong>appears in the service data, it will be replaced with the instance name of
the device that is instantiated from this class.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF12">
Message
Definitions
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
A message definition can be declared within a CDEV DDL class definition to define
one word atomic commands. Unlike attributes and verbs, a message is a stand-alone
instruction that can be sent to a device.
</p>
The structure of a <em>message</em> definition is similar to the <em>attribute</em> definition. The entries
in this section contain the name of the service and special service data that is
associated with the message.
</p>
The following example shows a class that contains a single message definition. Note
that the class does not define any verbs or attributes.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 5:
<a name="LOFREF5">
CDEV DDL class definition containing a list of messages
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************
* Definition of service X
*****************************/
service x
{
tags { tag1, tag2 }
}
/*****************************
* Definition of element class
*****************************/
class element
{
messages
{
on x {tag1=&lt;&gt;.Val, tag2=Text};
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 122>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF13">
Device Instances
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The<em> device instances </em>section is where devices are created from class definitions.
Each device that is instantiated from a class inherits all of the verbs, attributes and
messages from that class, as well as from each class that it inherits from.
</p>
The syntax for instantiating a device is as follows: the name of the class, followed by a
colon, followed by the list of device names that are being defined. The following figure
shows the syntax for defining a list of devices of the <em>&quot;element</em>&quot; class.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 6:
<a name="LOFREF6">
CDEV DDL class definition to instantiate a list of devices
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************
* Instantiation of devices
*****************************/
element :
device1
device2
device3;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 132>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF14">
Device Name
Substitution
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
As described earlier, angle braces &quot;&lt;&gt;&quot; in the service data definition for an attribute
will be replaced with the name of its associated device. A name substitution
technique is available that allows the DDL writer to specify that a different device
name should be inserted. The substitution device name is specified in conjunction
with the actual device name when the device is instanciated.
</p>
The following example illustrates the syntax for instantiating a device and specifing a
substitute name for it. In this example, the string &quot;<em>device1</em>&quot; will be substituted wherever
the string <em>&quot;dev1&quot;</em> would normally be used.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 7:
<a name="LOFREF7">
Implementing device name substitution in a CDEV DDL file
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************
* Device name substitution
*****************************/
element :
dev1 {device1}
device2
device3;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 128>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF15">
Device Name
Aliasing
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
Device name aliasing is a more powerful alternative to device name substitution. A
device's alias may be used in applications to obtain and communicate with its
corresponding device. Device name aliases are specified in the DDL file on an
individual basis by using the <em>alias</em> keyword.
</p>
The syntax for adding an alias to a device is illustrated in the example below. In this
example, the alias <em>&quot;dev1&quot;</em> can be used interchangably with the actual device name
<em>&quot;device1&quot;.</em>
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 8:
<a name="LOFREF8">
Implementing device name aliasing in a CDEV DDL file
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************
* Device name aliasing
*****************************/
alias dev1 device1
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 144>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF16">
Defining
cdevCollections
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
A cdevCollection device can be implemented in one of two ways; the developer can
create an empty cdevCollection dynamically and add devices to it, or a collection entry
can be placed in the CDEV DDL file that identifies the collection and its constituent
devices. The syntax for defining a cdevCollection device in the CDEV DDL file is as
follows.
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 9:
<a name="LOFREF9">
cdevCollection Definition in the CDEV DDL File
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
collection cDevice1 :
device0,
device1,
device2
;
collection cDevice2 :
device3
device4
device5
;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 175>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
In the example above two cdevCollections are defined. A cdevCollection definition is
started by using the keyword &quot;<strong><em>collection</strong></em>&quot;, followed by a space and then the name of
the collection. Note that the name of the collection must be unique and cannot be
shared with any other device in the CDEV system.
</p>
The device name is followed by a white space character (<strong><em>which is required</strong></em>), and
then a colon, followed by another white space character and then the list of devices.
The device names that are in the list may be separated by either white space of a
<strong><em>comma</strong></em> delimiter. The list of devices is terminated by a <strong><em>semicolon</strong></em>.
</p>
The current implementation of the CDEV DDL is order dependent. Because of this,
the developer should place the collection definitions after the definitions of all devices
and aliases.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF17">
#include Directive
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>#include </em>directive is supported within the CDEV DDL file syntax. This directive is
used to include the contents of another DDL file within the current DDL file. The
syntax is the same as its C language counterpart.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 10:
<a name="LOFREF10">
Using the #include directive in a CDEV DDL file
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &quot;filename.ddl&quot;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 138>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
<!*** Finish PROGRAM ***!></strong></font></pre>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF18">
Sample DDL
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample DDL file demonstrates all current features of the Device
Definition Language.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 11:
<a name="LOFREF11">
Sample complete DDL file
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************************************************
* Service Definitions:
* This section contains the definitions for individual services.
*****************************************************************/
/*****************************************************************
* ca Service (channel access)
* The library caService.so will be loaded and called whenever a
* call to this service needs to be executed.
*
* This services support the following special tags:
* PV = Process Variable: this tag is used to specify the
* actual name of the attribute that is being
* defined.
* READONLY = This is a logical tag that indicates if the
* attribute is readonly (1) or read/write (0).
*****************************************************************/
service ca {
tags { PV, READONLY }
}
/*****************************************************************
* Class Definitions
* This section contains the definition for individual classes.
*****************************************************************/
/*****************************************************************
* stdio Class:
* This class defines the basic set of verbs that will be
* supported by all other classes in this DDL file. The verbs
* declared in this class are:
* get = Get the value of an attribute of a device
* set = Set the value of an attribute of a device
* monitorOn = Monitor changes of an attribute's value
* monitorOff = End monitoring changes of an attribute's value
*****************************************************************/
class stdio {
verbs { get, set, monitorOn, monitorOff }
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 140>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 11:
Sample complete DDL file (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
/*****************************************************************
* magnet Class:
* This class inherits its list of verbs from the stdio class. It
* then adds a list of attributes that these verbs may operate
* on. The following attributes are specified.
*
* current : The current attribute will be serviced by ca.
* bdl : The bdl attribute will be serviced by ca.
* length : The length attribute will be serviced by ca.
*
* This class also supports the messages &quot;on&quot; and &quot;off&quot;. For
* illustration purposes, these messages will operate on the val
* field, and therefore, have the same service data.
*****************************************************************/
class magnet : stdio
{
attributes {
current ca {PV=&lt;&gt;.VAL, READONLY=0};
bdl ca {PV=BDL_&lt;&gt;.VAL, READONLY=0};
length ca {PV=LEN_&lt;&gt;.VAL, READONLY=1};
}
messages {
on ca {PV=&lt;&gt;.VAL, READONLY=0};
off ca {PV=&lt;&gt;.VAL, READONLY=0};
}
}
/*****************************************************************
* Device Instances:
* This section contains the instantiations of individual devices.
*****************************************************************/
/*****************************************************************
* The following is a list of devices that are memebers of the
* magnet class. That means that each of these devices supports
* all of the attributes, verbs and messages that are defined by
* the magnet class and the stdio class that it inherits from.
*****************************************************************/
magnet :
MQB1S01
MQB1S02
MQB1S03
MQB1S04
/*****************************************************************
* End of Device Definition File
*****************************************************************/
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 142>
<!*** Finish FIGURE_CONT ***!></p></em></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
3.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF19">
Using the <em>cdevSystem </em>Object
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF20">
Overview of the
cdevSystem Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The cdevSystem C++ class can be described as a communications junction between
a CDEV application and CDEV services. The cdevSystem object is responsible for
interpreting the device definition file, dynamically loading CDEV services upon
request, detecting and responding to I/O events, and providing a mechanism for
polling services for updates.
</p>
Currently, only the default cdevSystem object may be used within an application.
Ultimately, multiple cdevSystem objects may be created, and each of them will
maintain individual copies of CDEV services and devices within them.
</p>
Most CDEV classes that are accessed directly by applications have static factories
(special constructors). Any CDEV object that is constructed by one of these factories
is automatically a member of the <em>default</em> cdevSystem.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF21">
Public Functions
of the
cdevSystem Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF22">
attachRef
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevSystem&amp; attachRef(char *name, char *prefix);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to a new or existing cdevSystem object
that has the specified name. The <em>prefix</em> parameter is optional,
but, if provided will be prepended to the name of each <em>device</em>
that is requested through the named cdevSystem object before
it is found in the device definition file.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF23">
attachPtr
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevSystem* attachPtr(char *name, char *prefix);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a pointer to a new or existing cdevSystem object that
has the specified name. The <em>prefix</em> parameter is optional, but, if
provided will be prepended to the name of each <em>device</em> that is
requested through the named cdevSystem object before it is
found in the device definition file.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF24">
defaultSystem
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevSystem &amp;defaultSystem (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to the default cdevSystem object. In most
applications this mechanism is used to access the cdevSystem
object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF25">
getDevice
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevDevice* getDevice (char *device);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a pointer to a cdevDevice object by name. The object
that is returned by this function will be owned and controlled by
the cdevSystem object that created it. This means that <em>flush,
poll </em>and<em> pend</em> commands must be routed through the owning
cdevSystem object in order to effect this cdevDevice object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF26">
getRequestObject
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getRequestObject ( char *device, char *msg,
</p>
cdevRequestObject &amp;req);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to a cdevRequestObject from a specified
device name and message name. The object that is produced
by this function will be owned and controlled by the
cdevSystem object that created it. This means that <em>flush, poll
</em>and<em> pend</em> commands must be routed through the owning
cdevSystem object in order to effect this cdevRequestObject.
Returns <em>CDEV_SUCCESS</em> or an enumerated error code.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF27">
name
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
char *name (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Returns the name of this cdevSystem object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF28">
prefix
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
char *prefix (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a pointer to the prefix string that is currently being
used by the cdevSystem object. See the <em>attachPtr</em> entry for a
description of the prefix string.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF29">
prefix
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void prefix (char *pre);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Changes the prefix string that is being used by the cdevSystem
object. See the <em>attachPtr</em> entry for a description of the prefix
string.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF30">
flush
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int flush (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Flushes any pending outbound requests to their respective
services.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF31">
poll
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int poll (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Directly polls each of the cdevSystem's underlying services for
activity, and delivers any asynchronous callbacks that are
ready.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF32">
pend
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int pend (int fd);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Waits for a default period of time for the specified file descriptor
to have an I/O event. If the fd parameter is not provided, the
cdevSystem object will wait for an I/O event on any of its
contained file descriptors. When an event occurs on one of the
file descriptors, the cdevSystem object will call the respective
cdevService to process the event and dispatch any
asynchronous callbacks that are ready.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF33">
pend
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int pend (double seconds, int fd);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Processes all I/O events that occur on the file descriptor during
the specified period of time. If the fd parameter is not provided,
the cdevSystem object will wait for I/O events on all of its
contained file descriptors. When an event occurs on one of the
file descriptors, the cdevSystem object will call the respective
cdevService to process the event and dispatch any
asynchronous callbacks that are ready.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF34">
getFd
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getFd (int fd[], int &amp;numFD);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a list of file descriptors that are contained within the
cdevSystem object. The fd array must be preallocated, and the
maximum number of elements should be specified in the
numFD parameter. Upon completion, the fd array will be
populated with the list of file descriptors, and the numFD
parameter will contain the actual count.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF35">
addFdChanged Callback
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
</p>
int addFdChangedCallback (cdevFdChangedCallback cbk,
</p>
void*userarg)
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Adds a new function to be called each time a service
announces to the system that it has opened or closed a file
descriptor. The function will be called with 3 arguments:
<!*** Finish FUNC_DEF ***!></p></font>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void (*cdevFdChangedCallback) (int fd, int opened,
</p>
void *userarg)
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The first argument specifies the file descriptor, the second is 1
for opened, 0 for closed, and the last argument is the user
specified argument.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF36">
autoErrorOn
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int autoErrorOn (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Informs the cdevSystem object that it should use its internal
default error handler to process any error messages that are
generated by objects within its control. This is the default
operating condition for the cdevSystem object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF37">
autoErrorOff
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int autoErrorOff (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Informs the cdevSystem object that it should use the user
supplied error handling function to process any error messages
that are generated by objects within its control.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF38">
reportError
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int reportError ( int severity, char *name,
</p>
cdevRequestObject *obj,
</p>
char *formatString,...);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Emits an error message. The severity field indicates the
<em>severity</em> of the error, the <em>name</em> string identifies the object that
generated the error, the <em>obj </em>parameter is the
cdevRequestObject that was in use when the error occurred,
and the <em>formatString </em>and additional parameters (...) should be
formatted in the same manner as the parameters used by
printf.
</p>
The integer used by severity should have one of the following
values indicating the severity of the error that has occurred.
<!*** Finish FUNC_DEF ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_SEVERITY_INFO:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
No error.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_SEVERITY_WARN:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
An error occurred that should
not impact continued
processing.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_SEVERITY_ERROR:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
An error occurred and should be
corrected before continuing.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_SEVERITY_SEVERE:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
A severe or fatal error has
occurred and CDEV cannot
continue normal execution.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF39">
setErrorHandler
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void setErrorHandler (cdevErrorHandler handler);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Used to to install a user specified error handler. This error
handler will be called when an error occurs if the <em>autoErrorOff</em>
method has been used to disable the default error handler. The
user provided error handler should have the following
prototype:
</p>
void handler (int severity, char *text, cdevRequestObject *obj);
</p>
The <em>severity</em> parameter will contain one of the integers
specified in the <em>reportError </em>documentation, the <em>text</em> parameter
will contain the text of the error, and the <em>obj</em> parameter will
contain the cdevRequestObject that was in use when the error
occurred.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF40">
setThreshold
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void setThreshold (int errorThreshold);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Used to specify the level of severity at which errors should be
submitted to the error handler. The value of <em>errorThreshold</em>
should be one of the severity levels specified in the <em>reportError</em>
method.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF41">
Sample Code
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample application shows the use of the three methods for obtain a
cdevSystem object. For examples of how to use the flush, poll and pend methods, see
the documentation for the cdevDevice object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 12:
<a name="LOFREF12">
Methods for obtaining a cdevSystem object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
void main()
{
// ************************************************************
// * The first and most common approach is to directly request
// * a reference to the default cdevSystem.
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Get a pointer to the name of the default cdevSystem.
// ************************************************************
char * sysName = default.name();
// ************************************************************
// * Use the attachRef method to obtain a reference to the
// * default cdevSystem by name.
// ************************************************************
cdevSystem &amp; default2 = cdevSystem::attachRef(sysName);
// ************************************************************
// * Finally, use the attachPtr method to obtain a pointer to
// * the default cdevSystem by name. Additionally, set the
// * prefix for the default system to &quot;TEST&quot;.
// ************************************************************
cdevSystem * default3 = cdevSystem::attachPtr(sysName, &quot;TEST&quot;);
// ************************************************************
// * Output the name and prefix for all three systems.
// ************************************************************
printf(&quot;%s:%s\\n&quot;, default.name(), default.prefix());
printf(&quot;%s:%s\\n&quot;, default1.name(), default1.prefix());
printf(&quot;%s:%s\\n&quot;, default2-&gt;name(), default2-&gt;prefix());
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 35>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample application illustrates how to install a user specified error
handler into the default cdevSystem object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 13:
<a name="LOFREF13">
Installing a user specified error handler
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
// ****************************************************************
// * This the default error handler. It simply outputs the error.
// ****************************************************************
void myHandler(int severity, char *text, cdevRequestObject &amp;obj)
{
if(severity&gt;0)
{
fprintf(stderr, &quot;ERROR (%i): %s\\n&quot;, severity, text);
}
else fprintf(INFORMATION: %s\\n&quot;, text);
}
void main()
{
// ************************************************************
// * Obtain a reference to the default cdevSystem.
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Call the setErrorHandler method to install the new
// * errorHandler.
// ************************************************************
default.setErrorHandler(myHandler);
// ************************************************************
// * Turn off auto error handling to tell the system to use
// * the new user specified error handing function.
// ************************************************************
default.autoErrorOff();
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 157>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
4.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF42">
Using the <em>cdevDevice </em>Object
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF43">
Overview of the
cdevDevice Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The cdevDevice C++ class is the user's primary interface to CDEV. In fact, it is
possible to develop complete CDEV applications using only cdevDevice and cdevData
objects. The cdevDevice class defines the basic interface that all applications must
use to transmit messages to a CDEV service.
</p>
A cdevDevice may be created using the static member functions <strong><em>attachPtr</strong></em> or
<strong><em>attachRef</strong></em>. If one of these methods is used, the device will be created within the
context of the default <em>cdevSystem</em>. If the application wishes to create a device within a
cdevSystem other than the default, it must use the <strong><em>getDevice</strong></em> method of the desired
cdevSystem object.
</p>
A cdevDevice object is bound by name to a specific device when it is instantiated.
However, the underlying service is not selected until a message is specified with a
<strong><em>send</strong></em> command. Therefore, simply creating a device does not ensure that the device
name is valid, nor that it supports a given message.
</p>
Messages may be sent to a device using one of the three send member functions,
these are: <strong><em>send, sendNoBlock</strong></em><em>, and </em><strong><em>sendCallback</strong></em>. The syntax and functionality of
these methods is described in the section below.
</p>
Input and output to the specified send methods is managed through the use of
cdevData objects. Unlike the cdevDevice object which is bound to a specific system,
the cdevData object is completely independent. These objects store the data values
(called <em>properties</em>) that are sent to and received from devices. The application may
indicate the <em>properties</em> that it wishes to receive as output from the cdevDevice object
by specifying them in a special cdevData object called the <em>context</em>.
</p>
Examples at the end of this section will illustrate the correct ways to implement these
operations.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF44">
Public Functions
of the cdevDevice
Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF45">
attachRef
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevDevice&amp; attachRef (char *name);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to a cdevDevice object by name. By
default, the new object will be managed by the default
cdevSystem.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF46">
attachPtr
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevDevice* attachPtr (char *name);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a pointer to a cdevDevice object specified by name. By
default, the new object will be managed by the default
cdevSystem.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF47">
detach
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static void detach (cdevDevice&amp; dev);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Removes a referenced cdevDevice object from its associated
cdevSystem object. Ordinary applications should never use this
command.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF48">
detach
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static void detach (cdevDevice* dev);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Detaches the cdevDevice object specified by dev from its
associated cdevSystem object. Ordinary applications should
never use this command.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF49">
getRequestObject
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevRequestObject* getRequestObject (char *msg);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a service specific request object. This function uses
the name of the device specified within the cdevDevice object,
and the message provided by the caller to determine which
CDEV service will be used to service this request. The service
is then loaded (if necessary), and is contacted to provided a
request object for the device/message combination. This
cdevRequestObject will then be used to communicate with the
service directly.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF50">
name
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
const char *name (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Returns the name of the device.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF51">
system
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevSystem&amp; system (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to the underlying cdevSystem object that
manages this device.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF52">
setContext
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int setContext (cdevData&amp; cxt);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Used to insert a cdevData object containing tagged values that
control optional behavior of the underlying device. The context
is often used to specify which properties (value, status,
severity) a device returns in response to a &quot;get&quot; message. It is
important to note that any change made to the context of a
<em>cdevDevice</em> will automatically be propagated to all
<em>cdevRequestObjects</em> created from that device. Therefore, any
message specific context settings should be specified directly
to the cdevRequestObject, rather than to the cdevDevice.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF53">
getContext
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevData &amp; getContext (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to the cdevData object that contains the
context for a specific device.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF54">
setPrivate
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void setPrivate (void * data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Associates a user specified data object with this cdevDevice
object. The pointer can be retrieved later using the <em>getPrivate</em>
method.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF55">
getPrivate
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void * getPrivate (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a pointer to a data object that was placed in this
cdevDevice object using the setPrivate function.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF56">
send
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int send (char *msg, cdevData &amp;out, cdevData&amp; result);
</p>
int send (char *msg, cdevData *out, cdevData&amp; result);
</p>
int send (char *msg, cdevData &amp;out, cdevData* result);
</p>
int send (char *msg, cdevData *out, cdevData* result);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
<strong> </strong>The send function is the standard method for synchronously
communicating with a device. The caller provides the message
as a character string in the <em>msg </em>parameter. The <em>out </em>cdevData
object contains any property values that the device will need to
perform the task. The <em>result</em> cdevData object will contain the
output properties that resulted from the call. This function will
return one of the error code defined in cdevErrCode.h.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
<!*** Start FUNCTION_DEF ***!><font size=+1 color=Black>
<!*** Finish FUNCTION_DEF ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 14:
<a name="LOFREF14">
Return codes generated by the send method
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
CDEV_SUCCESS: The message was processed successfully.
CDEV_ERROR: Failed to process message.
CDEV_INVALIDOBJ: Invalid CDEV request object used.
CDEV_INVALIDARG: Invalid argument passed to CDEV call.
CDEV_INVALIDSVC: Wrong service during dynamic loading.
CDEV_NOTCONNECTED: Not connected to low level network
service.
CDEV_IOFAILED: Low level network service IO failed.
CDEV_CONFLICT: Conflicts of data types or tags.
CDEV_NOTFOUND: Cannot find specified data in cdevData.
CDEV_TIMEOUT: Time out.
CDEV_CONVERT: cdevData conversion error.
CDEV_OUTOFRANGE: Value out of range for device attribute.
CDEV_NOACCESS: Insufficient access to perform request.
CDEV_ACCESSCHANGED: Change in access permission of device.
CDEV_DISCONNECTED: The service has lost contact with the
device.
CDEV_RECONNECTED: The service has regained contact with the
device.
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 47>
</a> <!*** Finish FIGURE ***!></p></em></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF57">
sendNoBlock
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int sendNoBlock(char *msg, cdevData &amp;out, cdevData &amp;result);
</p>
int sendNoBlock(char *msg, cdevData *out, cdevData &amp;result);
</p>
int sendNoBlock(char *msg, cdevData &amp;out, cdevData *result);
</p>
int sendNoBlock(char *msg, cdevData *out, cdevData *result);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The <em>sendNoBlock</em> method uses the same parameters and
syntax as the <em>send</em> method. However, rather than waiting for
the underlying service to respond to the request, this function
will return immediately. The caller must utilize some
synchronization method such as a cdevGroup object to detect
when this transaction has been completed, or test for new data
within the result data object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF58">
sendCallback
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int sendCallback ( char *msg, cdevData &amp;out,
</p>
cdevCallback &amp;callback);
</p>
int sendCallback ( char *msg, cdevData *out,
</p>
cdevCallback &amp;callback);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The sendCallback function is the standard method for
asynchronously communicating with a device. Rather than
providing a result cdevData object, this method requires the
user to provide the address of a cdevCallback object. This
object contains a user supplied pointer and the address of a
function to call when the message has been successfully
processed.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF59">
Sample Code
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample applications illustrate many of the uses of the cdevDevice
object. Additionally, these examples show in depth usage of the cdevData object and
the concept of context.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF60">
Attaching to a
cdevDevice Object
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
Within a cdevSystem object, a cdevDevice is created only once for any specified
device name. After that, all requests for that device are given a pointer to the same
cdevDevice object. This technique is called <em>attaching</em> to a device.
</p>
There are two approaches to attaching to a cdevDevice; through a specific
cdevSystem object, or through the cdevDevice interface. Attaching to the device using
the cdevSystem object has the benefit of making it possible to manage the device
through a system other than the default system. Using the cdevDevice interface
directly always places the new device in the default system, but has the benefit of
reducing the complexity of the source code by hiding the use of the cdevSystem
object.
</p>
The next example illustrates how to attach to a cdevDevice using the <em>attachRef</em> and
the <em>attachPtr</em> methods. The <em>attachRef</em> method allows the caller to obtain a reference to
the cdevDevice object, while the <em>attachPtr</em> method allows the user to obtain a pointer
to the same object. This example also demonstrates the long hand approach for
retrieving a cdevDevice pointer from the system object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 15:
<a name="LOFREF15">
Attaching to a cdevDevice object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
void main()
{
// ************************************************************
// * Use the attachPtr and attachRef methods to attach to
// * devices &quot;MQB1S01&quot; &amp;&amp; &quot;MQB1S02&quot;.
// ************************************************************
cdevDevice * devicePtr = cdevDevice::attachPtr(&quot;MQB1S01&quot;);
cdevDevice &amp; deviceRef = cdevDevice::attachRef(&quot;MQB1S02&quot;);
// ************************************************************
// * To use the long-hand approach, obtain a pointer to the
// * default cdevSystem (or any other cdevSystem object).
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Next, use the getDevice method of the system to obtain
// * a pointer to the specific device (MQB1S03).
// ************************************************************
cdevDevice * dev = default.getDevice(&quot;MQB1S03&quot;);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 39>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF61">
Getting and
Setting Context for
a cdevDevice
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
In CDEV, <em>context</em> refers to a collection of options that may be used to alter the way a
CDEV device responds to a specific message. How context information effects the
bahvior of a device is defined by the associated cdevService. Context may be used to
set any number of I/O options, such as timeouts, data acquisition specifications, or
flags to control optional return data. The context is stored and retrieved in the form of
a cdevData object containing a collection of tagged data items (called <em>properties</em>).
</p>
The example below illustrates how the caller may obtain a copy of the context of a
device, install a new context for a specific call, and then restore the previous context to
the device.
</p>
Note: Whenever the context of a device is directly manipulated, each of its underlying
cdevRequestObjects are updated to reflect the new change. Therefore, altering the
context directly in the cdevDevice is not recommended. The preferred approach is to
obtain a copy of the cdevRequestObject and alter the context there.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 16:
<a name="LOFREF16">
Altering the context of a cdevDevice object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
// ************************************************************
// * Obtain a pointer to the cdevDevice &quot;MQB1S01&quot;
// ************************************************************
cdevDevice * devicePtr = cdevDevice::attachPtr(&quot;MQB1S01&quot;);
cdevData oldContext, newContext;
// ************************************************************
// * Indicate in the newContext cdevData object that devices
// * should return their value, status and severity information
// ************************************************************
newContext.insert(&quot;value&quot;, 1);
newContext.insert(&quot;status&quot;, 1);
newContext.insert(&quot;severity&quot;, 1);
// ************************************************************
// * Preserve the contexts of the original device context, and
// * then install the new device context.
// ************************************************************
oldContext = devicePtr-&gt;getContext();
devicePtr-&gt;setContext(newContext);
// ************************************************************
// * After performing the context specific operations, restore
// * the old context to the device.
// ************************************************************
devicePtr-&gt;setContext(oldContext);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 42>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF62">
Sending Messages
to a Device
Synchronously
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
In most CDEV applications, the caller will want to send a message to a device and
then wait until a response is received. In order to do this, the send method of the
cdevDevice object should be used. The send method receives three parameters; the
message to be sent, a cdevData object containing data required by the device, and a
cdevData object to receive the data returned by the device.
</p>
The following example demonstrates reading an attribute of a device and handling
each class of error inline. A return code of <em>CDEV_SUCCESS </em>indicates that the
message was successfully transmitted and processed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 17:
<a name="LOFREF17">
Using the send method of a cdevDevice object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
// ************************************************************
// * Obtain a pointer to the cdevDevice &quot;MQB1S01&quot;
// ************************************************************
cdevDevice * device = cdevDevice::attachPtr(&quot;MQB1S01&quot;);
cdevData input, output;
double value = 0.0;
// ************************************************************
// * Use the send method to obtain the value from the device.
// * Because there is no outbound data, the parameter is NULL.
// ************************************************************
switch(device-&gt;send(&quot;get bdl&quot;, NULL, &amp;output))
{
// **** Message transmitted and processed successfuly. ****
case CDEV_SUCCESS:
output.get(&quot;value&quot;, &amp;value);
printf(&quot;Value of MQB1S01 is %f\\n&quot;, value);
break;
// ****** Unknown device or device/message mismatch ******
case CDEV_INVALIDOBJ:
printf(&quot;Unknown device or device/message mismatch\\n&quot;);
break;
// * Communications error between application and service *
case CDEV_NOTCONNECTED:
case CDEV_IOFAILED:
case CDEV_TIMEOUT:
printf(&quot;Communications error while sending\\n&quot;);
break;
// ******************* Generic error **********************
case CDEV_ERROR:
case default:
printf(&quot;Unable to send message\\n&quot;);
break;
}
// ************************************************************
// * Increment the value, and use the &quot;set bdl&quot; command
// ************************************************************
value += 1.0;
input.insert(&quot;value&quot;, value);
device-&gt;send(&quot;set bdl&quot;, &amp;input, NULL);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 45>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF63">
Sending Messages
to a Device
Asynchronously
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
There are two methods provided by the cdevDevice object for sending messages
asynchronously; <em>sendNoBlock</em> and <em>sendCallback</em>.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF64">
Using
sendNoBlock
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>sendNoBlock </em>method is identical in interface to the <em>send</em> method, however, if it is
unable to immediately transmit to and receive a response from the device, it will not
wait. In order to determine if a <em>sendNoBlock</em> operation has completed successfully, the
caller must poll the <em>cdevSystem</em> object, implement a grouping scheme using the
<em>cdevGroup </em>object, or explicitly test for new data in the result data object.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF65">
Managing
sendNoBlock
Messages with
the cdevSystem
object
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
To manage asynchronous messages using the cdevSystem object, the caller should
use the <em>pend</em> or <em>poll</em> method. These methods will submit the message to the
underlying device, and will wait for a period of time for a response to arrive. If all
messages have not been processed during the specified (or default) period of time,
these methods will return a <em>CDEV_TIMEOUT</em> status code. If all transactions have
been processed, these methods will return a <em>CDEV_SUCCESS</em> status code.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF66">
Grouping
sendNoBlock
Messages with
cdevGroup
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
An alternative way to manage messages transmitted with sendNoBlock is to create
and <em>start</em> a <em>cdevGroup</em> object prior to sending the first message. The application then
transmits all of the messages that it wishes to manage within a single group. Once all
messages have been transmitted, the caller will <em>end</em> the <em>cdevGroup</em> and then may call
the <em>pend </em>member function of the <em>cdevGroup</em> object until the return value is
<em>CDEV_SUCCESS. </em>The caller should always specify a discrete amount of time to wait
when using the <em>pend</em> operation, otherwise, the application can enter an indefinite wait.
</p>
<em>Note: Once a cdevGroup object has been started, it will remain open until its end
method is executed </em><strong><em>OR</strong></em><strong> </strong><em>until the pend method of the cdevGroup object is executed. If
a sendNoBlock is executed after the group has been ended, it will not be managed by
that group.</em>
</p>
The example below illustrates how to transmit multiple messages to a device using the
<em>sendNoBlock</em> method and the <em>cdevGroup</em> object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 18:
<a name="LOFREF18">
Using sendNoBlock to communicate with a cdevDevice
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevGroup.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
// ************************************************************
// * Obtain a pointer to the cdevDevice &quot;MQB1S01&quot; and &quot;MQB1S02&quot;
// ************************************************************
cdevDevice * device1 = cdevDevice::attachPtr(&quot;MQB1S01&quot;);
cdevDevice * device2 = cdevDevice::attachPtr(&quot;MQB1S02&quot;);
cdevGroup group;
cdevData output1, output2;
// ************************************************************
// * Start the cdevGroup object to group all of the requests.
// ************************************************************
group.start();
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 53>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 18:
Using sendNoBlock to communicate with a cdevDevice (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ************************************************************
// * Use the sendNoBlock command to transmit the messages to
// * the selected devices. The &quot;get VAL&quot; message requires no
// * input, so the outbound cdevData object is NULL.
// ************************************************************
device1-&gt;sendNoBlock(&quot;get VAL&quot;, NULL, &amp;output1);
device2-&gt;sendNoBlock(&quot;get VAL&quot;, NULL, &amp;output2);
// ************************************************************
// * Use the end method to terminate the group.
// ************************************************************
group.end();
// ************************************************************
// * Use the pend method of the group to wait for 1 second
// * for all of the messages to be processed. The allFinished
// * method can be used to obtain the completioon status of
// * the group (0=NOT DONE, 1=DONE).
// *
// * As a simple example, this function will wait no more than
// * 5 seconds for all messages to be processed.
// ************************************************************
{
group.pend(1.0);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 55>
<!*** Finish FIGURE_CONT ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF67">
Using deferred
groups for
repeating lists of
operations
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
A cdevGroup may be placed into a <em>deferred</em> mode prior to starting it, and in this case
messages will not be transmitted until the group is flushed. After all operations within
the group have completed, the group may be flushed again, causing the same set of
operations to be executed again. See the reference manual for details.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF68">
Using
sendCallback
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>sendCallback </em>method provides the second mechanism for transmitting messages
asynchronously. This method is used in CDEV for a variety of purposes, the most
common of these is to establish monitors on a specific cdevDevice attribute. Once the
monitor has been established, the user specified callback function will be contacted
whenever the property's value is altered.
</p>
This method is more complex than the others because it <strong>REQUIRES</strong> the caller to
utilize a <em>cdevSystem </em>object in order to poll the underlying services, and it requires the
caller to predefine a <em>cdevCallbackFunction</em> to be executed when the message has
been processed.
</p>
The <em>cdevCallbackFunction </em>has a very specific prototype that the caller must comply
with. The user specified callback function must be of type void, and must receive the
following parameters.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>int status</strong>: This is equivalent to the return status of a synchronous <em>send</em> call. It
should receive one of the error codes that are defined in <em>cdevErrCode.h</em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>void * arg</strong>: This is a pointer to data that was specified by the user when creating
the <em>cdevCallback</em> object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>cdevRequestObject &amp; obj</strong>: This is the <em>cdevRequestObject </em>that the system used
to transmit the message to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>cdevData &amp; data</strong>: This is the cdevData object that contains the output generated
by the device when it processed the message.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>cdevCallbackFunction</em> and a user provided argument are passed to the<em>
sendCallback </em>method through the use of the <em>cdevCallback</em> object. The <em>cdevCallback</em>
object is a simple container class.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 19:
<a name="LOFREF19">
Using the sendCallback method of a cdevDevice object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#incldue &lt;cdevRequestObject.h&gt;
#include &lt;cdevCallback.h&gt;
#include &lt;cdevData.h&gt;
// ****************************************************************
// * callback:
// * This is the callback function that will be called when the
// * message has been processed to completion. This function is
// * disregarding CDEV_DISCONNECTED and CDEV_RECONNECTED messages.
// ****************************************************************
void callback(int status,
void * arg,
cdevRequestObject &amp; req,
cdevData &amp; data)
{
double result;
int &amp; userFlag = *arg;
// ************************************************************
// * Save the completion status and print the result
// ************************************************************
if(status!=CDEV_DISCONNECTED &amp;&amp; status!=CDEV_RECONNECTED)
{
userFlag = status;
data.get(&quot;value&quot;, &amp;result);
printf(&quot;I have received value %f&quot;, result);
}
}
void main()
{
// ************************************************************
// * Integer flag for detecting callback completion
// ************************************************************
int userFlag = 100;
// ************************************************************
// * Obtain a reference to the default system.
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Obtain a pointer to the device &quot;MQB1S01&quot;.
// ************************************************************
cdevDevice * device = default.getDevice(&quot;MQB1S01&quot;);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 58>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 19:
Using the sendCallback method of a cdevDevice object (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ************************************************************
// * Construct the cdevCallback object that will be used to
// * specify the callback function and the user argument.
// ************************************************************
cdevCallback cb(callback, &amp;userFlag);
// ************************************************************
// * Transmit the message to the device using the sendCallback
// * mechanism. Since the message requires no outbound data,
// * the outbound cdevData object is NULL.
// ************************************************************
if(device-&gt;sendCallback(&quot;get current&quot;, NULL, cb)==CDEV_SUCCESS)
{
// *********************************************************
// * Now, poll the cdevSystem object until the message has
// * been successfully processed.
// *********************************************************
while(userFlag==100) default.poll();
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 60>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
5.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF69">
Using the <em>cdevRequestObject </em>Object
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF70">
Overview of the
cdevRequestObject
Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>cdevRequestObject</em> C++ class is the provides the user with a higher performance
interface to devices in CDEV. Each time a <em>cdevDevice</em> receives a message string, it
must parse the message and then connect to the appropriate service. The
<em>cdevRequestObject</em> allows the user to bind a <em>device</em> name to a <em>message</em><strong> </strong>and then
connect to the underlying service only <strong><em>once</strong></em>. Thereafter, the <em>cdevRequestObject</em> will
remain connected to the service and can process its associated message with much
higher efficiency.
</p>
A <em>cdevRequestObject</em> may be created using the static member functions <strong><em>attachPtr</strong></em> or
<strong><em>attachRef</strong></em>. If one of these methods is used, the object will be created within the
context of the default <em>cdevSystem</em>. If the application wishes to create a device within a
<em>cdevSystem</em> other than the default, it must first obtain a pointer to the associated
<em>cdevDevice</em> object from the desired system, and then use the <strong><em>getRequestObject</strong></em>
method of that <em>cdevDevice</em>.
</p>
The message associated with a <em>cdevRequestObject</em> may be sent to a device using
one of the three send member functions, these are: <strong><em>send, sendNoBlock</strong></em><em>, and
</em><strong><em>sendCallback</strong></em>. The syntax and functionality of these methods is described in the
section below.
</p>
Input and output to the specified send methods is managed through the use of
<em>cdevData</em> objects. Unlike the <em>cdevRequestObject</em> object which is bound to a specific
system, the <em>cdevData</em> object is completely independent. These objects store the data
values (called <em>properties</em>) that are sent to and received from devices. The application
may indicate the <em>properties</em> that it wishes to receive as output from the
<em>cdevRequestObject</em> object by specifying them in a special <em>cdevData</em> object called the
<em>context</em>.
</p>
Examples at the end of this section will illustrate the correct ways to implement these
operations.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF71">
Public Member
Functions of the
cdevRequestObject
Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF72">
attachRef
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevRequestObject&amp; attachRef (char *device, char * msg);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to a <em>cdevRequestObject</em> object by
specifying the name of the device and the message string. By
default, the new object will be managed by the default
<em>cdevSystem</em>.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF73">
attachRef
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevRequestObject&amp; attachRef (cdevDevice &amp;dev, char * msg);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a reference to a <em>cdevRequestObject</em> object by
providing a reference to the associated <em>cdevDevice</em> object and
the message string. By default, the new object will be managed
by the default <em>cdevSystem</em>.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF74">
attachPtr
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevRequestObject* attachPtr (char *device, char * msg);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a pointer to a <em>cdevRequestObject</em> by specifying the
name of the device and the message string. By default, the new
object will be managed by the default <em>cdevSystem</em>.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF75">
attachPtr
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static cdevRequestObject* attachPtr (cdevDevice &amp;dev, char * msg);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains a pointer to a <em>cdevRequestObject</em> by providing a
reference to the associated <em>cdevDevice</em> object and the
message string. By default, the new object will be managed by
the default <em>cdevSystem</em>.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF76">
detach
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static void detach (cdevRequestObject&amp; dev);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Removes a referenced cdevRequestObject object from its
associated cdevSystem object. Ordinary applications should
never use this command.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF77">
detach
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static void detach (cdevRequestObject* dev);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Detaches the cdevRequestObject object specified by dev from
its associated cdevSystem object. Ordinary applications should
never use this command.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF78">
message
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
char *message (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves the message string that is associated with this
cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF79">
device
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevDevice &amp;device (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to the cdevDevice object that is
associated with this cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF80">
system
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevSystem&amp; system (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to the underlying cdevSystem object that
manages this cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF81">
service
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevService&amp; service (void) const;
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to the underlying cdevService object that
this cdevRequestObject is attached to.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF82">
getState
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getState (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains the state of the underlying device. This function returns
one of the following values as defined in <em>cdevErrCode.h</em>.
<!*** Finish FUNC_DEF ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_STATE_CONNECTED:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
Object is connected.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_STATE_NOTCONNECTED:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
Object is not connected.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_STATE_INVALID:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
Object is invalid.
</p>
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
</table>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The service developer is responsible for implementing this
function correctly in the service related cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF83">
getAccess
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getAccess (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains access control information about the underlying
device. This function returns one of the following values as
defined in cdevErrCode.h.
<!*** Finish FUNC_DEF ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_ACCESS_NONE:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
No access to attribute.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_ACCESS_READONLY:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
Read-only access.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_ACCESS_WRITE:
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
Read-write access.
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
</table>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The service developer is responsible for implementing this
function correctly in the service related cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF84">
setContext
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int setContext (cdevData&amp; cxt);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Used to insert a cdevData object containing tagged values that
control optional behavior of the underlying device. The context
is often used to specify which properties (value, status,
severity) a device returns in response to a &quot;get&quot; message. The
service developer may override the default behavior of this
method to better accomodate the requirements of the service.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF85">
getContext
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevData &amp; getContext (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a reference to the cdevData object that contains the
context for a specific cdevRequestObject. The service
developer may override the default behavior of this method to
better accomodate the requirements of the service.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF86">
getPrivate
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void * getPrivate (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a pointer to a data object that was placed in this
object using the setPrivate function.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF87">
setPrivate
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void setPrivate (void * data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Associates a user specified data object with this
<em>cdevRequestObject</em>. The pointer can be retrieved later using
the <em>getPrivate</em> method.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF88">
send
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int send (cdevData &amp;out, cdevData&amp; result);
</p>
int send (cdevData *out, cdevData&amp; result);
</p>
int send (cdevData &amp;out, cdevData* result);
</p>
int send (cdevData *out, cdevData* result);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The send function is the standard method for synchronously
communicating with a device. The <em>out </em>cdevData object
contains any property values that the device will need to
perform the task. The <em>result</em> cdevData object will contain the
output properties that resulted from the call. The service
developer is responsible for implementing this method in the
service specified cdevRequestObject. This function will return
one of the error code defined in cdevErrCode.h.
</p>
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 20:
<a name="LOFREF20">
Return codes generated by the send method
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
CDEV_SUCCESS: The message was processed successfully.
CDEV_ERROR: Failed to process message.
CDEV_INVALIDOBJ: Invalid CDEV request object used.
CDEV_INVALIDARG: Invalid argument passed to CDEV call.
CDEV_INVALIDSVC: Wrong service during dynamic loading.
CDEV_NOTCONNECTED: Not connected to low level network
service.
CDEV_IOFAILED: Low level network service IO failed.
CDEV_CONFLICT: Conflicts of data types or tags.
CDEV_NOTFOUND: Cannot find specified data in cdevData.
CDEV_TIMEOUT: Time out.
CDEV_CONVERT: cdevData conversion error.
CDEV_OUTOFRANGE: Value out of range for device attribute.
CDEV_NOACCESS: Insufficient access to perform request.
CDEV_ACCESSCHANGED: Change in access permission of device.
CDEV_DISCONNECTED: The service has lost contact with the
device.
CDEV_RECONNECTED: The service has regained contact with the
device.
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 50>
</a> <!*** Finish FIGURE ***!></p></em></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF89">
sendNoBlock
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int sendNoBlock (cdevData &amp;out, cdevData &amp;result);
</p>
int sendNoBlock (cdevData *out, cdevData &amp;result);
</p>
int sendNoBlock (cdevData &amp;out, cdevData *result);
</p>
int sendNoBlock (cdevData *out, cdevData *result);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The <em>sendNoBlock</em> method uses the same parameters and
syntax as the <em>send</em> method. However, rather than waiting for
the underlying service to respond to the request, this function
will return immediately.The caller may use a cdevGroup object
in order to detect when the transaction has been completed.
The service developer is responsible for implementing this
method in the service's cdevRequestObject.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF90">
sendCallback
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int sendCallback (cdevData &amp;out, cdevCallback &amp;callback);
</p>
int sendCallback (cdevData *out, cdevCallback &amp;callback);
<!*** Finish FUNC_PROTO ***!></p></em></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>sendCallback </em>function is the standard method for asynchronously communicating
with a device. Rather than providing a <em>result</em> cdevData object, this method requires the
user to provide the address of a cdevCallback object. This object contains a user
supplied pointer and the address of a function to call when the message has been
successfully processed. The service developer is responsible for implementing this
method in the service specified cdevRequestObject.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF91">
Sample Code
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample applications illustrate many of the uses of the
cdevRequestObject object. Additionally, these examples show in depth usage of the
cdevData object and the concept of context.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF92">
Attaching to a
cdevRequestObject
Object
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
Within a cdevSystem object, a cdevRequestObject is created only once for any
specified <em>device name</em> / <em>message string</em> combination. After that, all requests for that
combination are given a pointer to the same cdevRequestObject object. This
technique is called <em>attaching</em> to a cdevRequestObject.
</p>
There are two approaches to attaching to a <em>cdevRequestObject</em>; through a specific
<em>cdevDevice</em> object, or through the <em>cdevRequestObject</em> interface. Attaching to the
device using the <em>cdevDevice</em> object has the benefit of making it possible to manage
the <em>cdevRequestObject</em> using the <em>cdevSystem</em> object associated with that device,
rather than using the default system. Using the <em>cdevRequestObject</em> interface directly
always places the new request object into the default system, but has the benefit of
reducing the complexity of the source code by hiding the use of the <em>cdevDevice</em> and
the <em>cdevSystem</em> objects.
</p>
The example below illustrates how to attach to a cdevRequestObject with a device
named &quot;MQB1S01&quot; and the message &quot;get VAL&quot; using the cdevDevice interface.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 21:
<a name="LOFREF21">
Obtaining a cdevRequestObject from a cdevDevice object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevRequestObject.h&gt;
void main()
{
// ************************************************************
// * LONG-HAND METHOD
// * The first step in this approach is to obtain a pointer or
// * reference to the desired system. For this example, the
// * defaultSystem will be used.
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Next, use the getDevice method of the system to obtain
// * a pointer to the specific device.
// ************************************************************
cdevDevice * device = default.getDevice(&quot;MQB1S01&quot;);
// ************************************************************
// * Finally, use the getRequestObject method of the cdevDevice
// * class to obtain a cdevRequestObject for the message
// * &quot;get VAL&quot; on device &quot;MQB1S01&quot;.
// ************************************************************
cdevRequestObject *req = device-&gt;getRequestObject(&quot;get bdl&quot;);
// ************************************************************
// * SHORT-HAND METHOD
// * The following shortcut code directly creates a
// * cdevRequestObject and installs it in the default
// * cdevSystem object.
// ************************************************************
cdevRequestObject *req1 =
cdevRequestObject::attachPtr(&quot;MQB1S01&quot;, &quot;get bdl&quot;);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 160>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF93">
Getting and Setting
Context for a
cdevRequestObject
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
In CDEV, <em>context</em> refers to a collection of options that may be used to alter the way a
CDEV device responds to a specific message. How context information effects the
bahvior of a device is defined by the associated cdevService. Context may be used to
set any number of I/O options, such as timeouts, data acquisition specifications, or
flags to control optional return data. The context is stored and retrieved in the form of
a cdevData object containing a collection of tagged data items (called <em>properties</em>).
</p>
The example below illustrates how the caller may obtain a copy of the context of a
cdevRequestObject, install a new context for a specific call, and then restore the
previous context to the object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 22:
<a name="LOFREF22">
Altering the context of a cdevRequestObject object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevData oldContext, newContext;
// ************************************************************
// * Obtain a cdevRequestObject for &quot;MQB1S01&quot; / &quot;get bdl&quot;
// ************************************************************
cdevRequestObject *req =
cdevRequestObject::attachPtr(&quot;MQB1S01&quot;, &quot;get bdl&quot;);
// ************************************************************
// * Indicate in the newContext cdevData object that this
// * device should return its value, status and severity
// ************************************************************
newContext.insert(&quot;value&quot;, 1);
newContext.insert(&quot;status&quot;, 1);
newContext.insert(&quot;severity&quot;, 1);
// ************************************************************
// * Preserve the contexts of the original device context, and
// * then install the new device context.
// ************************************************************
oldContext = req-&gt;getContext();
req-&gt;setContext(newContext);
// ************************************************************
// * After performing the context specific operations, restore
// * the old context to the device.
// ************************************************************
req-&gt;setContext(oldContext);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 162>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF94">
Sending Messages
to a Device
Synchronously
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
In most CDEV applications, the caller will want to send a message to a device and
then wait until a response is received. In order to do this, the send method of the
cdevRequestObject object may be used. The send method receives two parameters;
a cdevData object containing data required by the device, and a cdevData object to
receive the data returned by the device.
</p>
The following example demonstrates how to read an attribute of a device, and handle
each class of error inline. A return code of CDEV_SUCCESS indicates that the
message was successfully transmitted and processed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 23:
<a name="LOFREF23">
Using the send method of a cdevRequestObject object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
// ************************************************************
// * Obtain a cdevRequestObject for &quot;MQB1S01&quot; / &quot;get bdl&quot;
// ************************************************************
cdevRequestObject *req =
cdevRequestObject::attachPtr(&quot;MQB1S01&quot;, &quot;get bdl&quot;);
cdevData input, output;
double value = 0.0;
// ************************************************************
// * Use the send method to obtain the value from the device.
// * Since there is no outbound data, the parameter is NULL
// ************************************************************
switch(req-&gt;send(NULL, &amp;output))
{
// **** Message transmitted and processed successfuly. ****
case CDEV_SUCCESS:
output.get(&quot;value&quot;, &amp;value);
printf(&quot;Value of MQB1S01 is %f\\n&quot;, value);
break;
// ******* Unknown device or device/message mismatch ******
case CDEV_INVALIDOBJ:
printf(&quot;Unknown device or device/message mismatch\\n&quot;);
break;
// * Communications error between application and service *
case CDEV_NOTCONNECTED:
case CDEV_IOFAILED:
case CDEV_TIMEOUT:
printf(&quot;Communications error while sending\\n&quot;);
break;
// ************ A generic error has occurred *************
case CDEV_ERROR:
case default:
printf(&quot;Unable to send message\\n&quot;);
break;
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 165>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF95">
Sending Messages
to a Device
Asynchronously
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
There are two methods provided by the cdevRequestObject object for sending
messages asynchronously; <em>sendNoBlock</em> and <em>sendCallback</em>.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF96">
Using
sendNoBlock
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>sendNoBlock </em>method is identical in interface to the <em>send</em> method, however, if it is
unable to immediately transmit to and receive a response from the device, it will not
wait. In order to determine if a <em>sendNoBlock</em> operation has completed successfully, the
caller must poll the <em>cdevSystem</em> object, use the <em>cdevGroup </em>object, or explicitly test for
new data in the result object.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF97">
Managing
sendNoBlock
Messages with
the cdevSystem
object
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
To manage asynchronous messages using the cdevSystem object, the caller should
use the <em>pend</em> or <em>poll</em> method. These methods will submit the message to the
underlying device, and will wait for a period of time for a response to arrive. If all
messages have not been processed during the specified (or default) period of time,
these methods will return a <em>CDEV_TIMEOUT</em> status code. If all transactions have
been processed, these methods will return a <em>CDEV_SUCCESS</em> status code.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF98">
Grouping
sendNoBlock
Messages with
cdevGroup
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
An alternative way to manage messages transmitted with <em>sendNoBlock</em>, is to create
and <em>start</em> a <em>cdevGroup</em> object prior to sending the first message. The application will
then transmit all of the messages that it wishes to manage within a single group. Once
all messages have been transmitted, the caller will <em>end</em> the <em>cdevGroup</em> and then may
call the <em>pend </em>member function of the <em>cdevGroup</em> object until the return value is
<em>CDEV_SUCCESS. </em>The caller should always specify a discrete amount of time to wait
when using the <em>pend</em> operation, otherwise, the application can enter an indefinite wait.
</p>
<em>Note: Once a cdevGroup object has been started, it will remain open until its end
method is executed </em><strong><em>OR</strong></em><strong> </strong><em>until the pend method of the cdevGroup object is executed. If
a sendNoBlock is executed after the group has been ended, it will not be managed by
that group.</em>
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 24:
<a name="LOFREF24">
Using sendNoBlock to communicate with a cdevRequestObject
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevGroup.h&gt;
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevRequestObject *req1, *req2;
cdevGroup group;
cdevData output1, output2;
// ************************************************************
// * Obtain cdevRequestObjects for &quot;MQB1S01&quot; and &quot;MQB1S02&quot;
// ************************************************************
req1 = cdevRequestObject::attachPtr(&quot;MQB1S01&quot;, &quot;get bdl&quot;);
req2 = cdevRequestObject::attachPtr(&quot;MQB1S02&quot;, &quot;get bdl&quot;);
// ************************************************************
// * Start the cdevGroup object to group all of the requests.
// ************************************************************
group.start();
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 167>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 24:
Using sendNoBlock to communicate with a cdevRequestObject (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ************************************************************
// * Use the sendNoBlock command to transmit the messages to
// * the selected devices. The &quot;get bdl&quot; message requires no
// * input, so the outbound cdevData object is NULL.
// ************************************************************
req1-&gt;sendNoBlock(NULL, &amp;output1);
req2-&gt;sendNoBlock(NULL, &amp;output2);
// ************************************************************
// * Use the end method to terminate the group.
// ************************************************************
group.end();
// ************************************************************
// * Use the pend method of the group to wait for 1 second
// * for all of the messages to be processed. The allFinished
// * method can be used to obtain the completion status of
// * the group (0=NOT DONE, 1=DONE).
// *
// * As a simple example, this function will wait no more than
// * 5 seconds for all messages to be processed.
// ************************************************************
{
group.pend(1.0);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 169>
<!*** Finish FIGURE_CONT ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF99">
Using deferred
groups for
repeating lists of
operations
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
A cdevGroup may be placed into a <em>deferred</em> mode prior to starting it, and in this case
messages will not be transmitted until the group is flushed. After all operations within
the group have completed, the group may be flushed again, causing the same set of
operations to be executed again.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF100">
Using
sendCallback
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>sendCallback </em>method provides the second mechanism for transmitting messages
asynchronously. This method is used in CDEV for a variety of purposes, the most
common of these is to establish monitors on a specific device property. Once the
monitor has been established, the user specified callback function will be contacted
whenever the property's value is altered.
</p>
This method is more complex than the others because it requires the caller to utilize a
<em>cdevSystem </em>object in order to poll the underlying services, and it requires the caller to
predefine a <em>cdevCallbackFunction</em> to be executed when the message has been
processed.
</p>
The <em>cdevCallbackFunction </em>has a very specific prototype that the caller must comply
with. The user specified callback function must be of type void, and must receive the
following parameters.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>int status</strong>: This is equivalent to the return status of a synchronous <em>send </em>call. It
should receive one of the values as defined in <em>cdevErrCode.h</em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>void * arg</strong>: This is a pointer to data that was specified by the user when creating
the <em>cdevCallback</em> object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>cdevRequestObject &amp; obj</strong>: This is the <em>cdevRequestObject </em>that the system used
to transmit the message to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>cdevData &amp; data</strong>: This is the cdevData object that contains the output generated
by the device when it processed the message.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>cdevCallbackFunction</em> and a user provided argument are passed to the<em>
sendCallback </em>method through the use of the <em>cdevCallback</em> object. The <em>cdevCallback</em>
object is a simple container class.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 25:
<a name="LOFREF25">
Using the sendCallback method of a cdevRequestObject object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevCallback.h&gt;
#include &lt;cdevData.h&gt;
// ****************************************************************
// * callback:
// * This is the callback function that will be called when the
// * message has been processed to completion. This function is
// * disregarding CDEV_DISCONNECTED and CDEV_RECONNECTED messages.
// ****************************************************************
void callback(int status,
void * arg,
cdevRequestObject &amp; req,
cdevData &amp; data)
{
double result;
int &amp; userFlag = *arg;
// ************************************************************
// * Save the completion status and print the result
// ************************************************************
if(status!=CDEV_DISCONNECTED &amp;&amp; status!=CDEV_RECONNECTED)
{
userFlag = status;
data.get(&quot;value&quot;, &amp;result);
printf(&quot;I have received value %f&quot;, result);
}
}
void main()
{
// ************************************************************
// * Integer flag for detecting callback completion
// ************************************************************
int userFlag = 100;
// ************************************************************
// * Obtain a reference to the default system.
// ************************************************************
cdevSystem &amp; default = cdevSystem::defaultSystem();
// ************************************************************
// * Obtain a cdevRequestObject for &quot;MQB1S01&quot; / &quot;get bdl&quot;.
// ************************************************************
cdevRequestObject * req =
default.getDevice(&quot;MQB1S01&quot;)-&gt;getRequestObject(&quot;get bdl&quot;);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 171>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 25:
Using the sendCallback method of a cdevRequestObject object (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ************************************************************
// * Construct the cdevCallback object that will be used to
// * specify the callback function and the user argument.
// ************************************************************
cdevCallback cb(callback, &amp;userFlag);
// ************************************************************
// * Transmit the message to the device using the sendCallback
// * mechanism. Since the message requires no outbound data,
// * the outbound cdevData object is NULL.
// ************************************************************
if(req-&gt;sendCallback(NULL, cb)==CDEV_SUCCESS)
{
// *********************************************************
// * Now, poll the cdevSystem object until the message has
// * been successfully processed.
// *********************************************************
while(userFlag==100) default.poll();
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 173>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
</p>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
6.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF101">
Using the <em>cdevData </em>Object
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF102">
Overview of the
cdevData Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The cdevData C++ class is a self describing data object. This class is the primary
mechanism for data interchange within the CDEV system. The cdevData object is
capable of storing and retrieving tagged data items of all the primitive data types, as
well as character strings and time stamps. These data items may be scalar or multi-
dimensional arrays.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF103">
cdevData Tags
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
A tag is a unique 32 bit integer that may be defined by the CDEV system, individual
services or by an application. Each tag integer has a corresponding character string
identifier. By using the character string identifier to obtain the integer tag, applications
and services are insulated from problems caused by internal tag renumbering.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF104">
XDR Packaging of
cdevData Objects
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
In addition to storing data, the cdevData object can also encapsulate its contents into
an XDR buffer for portable transport between platforms. The buffer can then be
decoded and reassembled into a cdevData when it has been received. To ensure best
performance, the XDR mechanism only transports the tag integer values, rather than
the tag character string values. Therefore, client/server applications using the XDR
transport must verify that they are using the same version of CDEV in order to avoid
tag number mismatches.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF105">
Public Functions
of the cdevData
Class
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF106">
tagC2I
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static int tagC2I (char *ctag, int *tag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Converts a character string tag name to its unique integer
identifier. The function returns CDEV_SUCCESS if the
conversion was successful, otherwise it returns
CDEV_ERROR.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF107">
tagI2C
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static int tagI2C (int tag, char * &amp;ctag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Converts a unique integer tag number to its related character
string tag. The function returns CDEV_SUCCESS if the
conversion was successful, otherwise it returns
CDEV_ERROR.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF108">
insertTag
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
static void insertTag(int tag, char *ctag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Adds a new, unique tag identifier to the static table of tags. Both
the tag integer and the character string must be unique.
Returns CDEV_SUCCESS on success, or CDEV_ERROR on
failure.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF109">
operator =
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevData &amp; operator = (cdevData &amp; data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
This is the assignment operator for the class. It will copy the
exact contents of the cdevData object specified by data to the
current cdevData object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF110">
Cast operators
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
operator char (void);
</p>
operator short (void);
</p>
operator unsigned short (void);
</p>
operator int (void);
</p>
operator unsigned int (void);
</p>
operator long (void);
</p>
operator unsigned long (void);
</p>
operator float (void);
</p>
operator double (void);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Directly extracts a scalar value that is stored in the &quot;value&quot; data
item, and returns it as the value of the current cdevData object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF111">
asciiDump
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void asciiDump (FILE * fp);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Outputs the complete contents of the cdevData object to a file.
If no file pointer is specified, then stdout will be used.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF112">
xdrSize
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int xdrSize (size_t * bufLen, size_t * elementCount);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Calculates the size of the buffer (<em>bufLen</em>) that will be required to
store this cdevData object as represented by XDR. The total
number of data items (<em>elementCount</em>) that will be placed in the
buffer is also calculated. The values obtained from this function
may be passed to the <em>xdrExport</em> method in order to use a pre-
allocated data buffer.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF113">
xdrExport
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int xdrExport (char ** buf, size_t * bufLen);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Allocates a buffer (<em>buf</em>) of sufficient size to hold the XDR
representation of this cdevData object. It will then translate all
data items stored within the object to XDR and write this data to
the buffer. The size of the allocated buffer will be provided to
the caller in the <em>bufLen</em> variable.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF114">
xdrExport
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int xdrExport (char * buf, size_t bufLen, size_t count);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Populates the preallocated buffer (<em>buf</em>) with the XDR
representation of the contents of this cdevData object. The
buffer length (<em>bufLen</em>) and number of elements (<em>count</em>) must
have been calculated in advance using the <em>xdrSize</em> method.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF115">
xdrImport
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int xdrImport (char * buf, size_t bufLen);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Decodes the caller supplied buffer (<em>buf</em>) from XDR
representation and populates the cdevData object with the
contents. The caller must specify the number of bytes in the
XDR buffer (<em>bufLen</em>).
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF116">
remove
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
void remove(void);
</p>
void remove(int tag);
</p>
void remove(char * ctag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Removes the data item specified by the unique tag name or
integer from this cdevData object. If the tag is not specified,
then all data items will be removed from the object.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF117">
changeTag
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int changeTag(int oldTag, int newTag);
</p>
int changeTag(int oldTag, char *c_newTag);
</p>
int changeTag(char *c_oldTag, int newTag);
</p>
int changeTag(char *c_oldTag, char *c_newTag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
<em>Retags</em> a data item that is currently stored in the cdevData
object from &quot;oldTag&quot; to &quot;newTag&quot;. By using this method the data
can be renamed internally without having to perform a copy or
removal. This function is overloaded to support any
permutation of character string tag or integer tag identifier.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF118">
getType
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
cdevDataTypes getType(int tag);
</p>
cdevDataTypes getType(char *ctag);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves the enumerated data type of the specified tagged
data item within this cdevData object. The following
enumerated types are defined in the file <em>cdevTypes.h</em>.
<!*** Finish FUNC_DEF ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_BYTE
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
8 bit unsigned character
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_INT16
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
16 bit signed integer
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_UINT16
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
16 bit unsigned integer
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_INT32
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
32 bit signed integer
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_UINT32
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
32 bit unsigned integer
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_FLOAT
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
single precision floating point
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_DOUBLE
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
double precision floating point
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_STRING
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
NULL terminated character string
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_TIMESTAMP
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
CDEV time stamp
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME_2 ***!><font size=+1 color=Black><strong>
CDEV_INVALID
<!*** Finish FUNC_NAME_2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF_2 ***!><font size=+1 color=Black>
invalid or unknown data type
<!*** Finish FUNC_DEF_2 ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF119">
getDim
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getDim(int tag, size_t *dim);
</p>
int getDim(char *ctag, size_t *dim);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves the number of dimensions in a data item that is an
array. If dim is 0, then the data item is scalar, otherwise, the
data item is a &quot;dim&quot; dimensional array. This function is
overloaded to support either the integer tag or character string
tag.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF120">
getElems
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getElems(int tag, size_t *elems);
</p>
int getElems(char *ctag, size_t *elems);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves the number of data elements in all dimensions of a
multi-dimensional array. If elems is 1, then the data item is
scalar, otherwise, the data item is an array of &quot;elems&quot; elements.
This function is overloaded to support either the integer tag or
character string tag.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF121">
getBounds
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int getBounds( int tag,
</p>
cdevBounds * bounds,
</p>
size_t numBounds);
</p>
int getBounds( char * ctag,
</p>
cdevBounds * bounds,
</p>
size_t numBounds);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Obtains the bounding dimensions of the array specified by the
caller provided tag. The cdevBounds structure contains two
integers: offset and length. The length variable represents the
number of data elements in that dimension of the array. The
offset integer is provided for use in specifying the position of
arrays that are sub-sets of the actual data. A version of this
function is available that uses an array of integers rather than
the cdevBounds structure. This function is overloaded to
support either the integer tag or character string tag.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF122">
setBounds
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int setBounds( int tag,
</p>
cdevBounds * bounds,
</p>
size_t numBounds);
</p>
int setBounds( char * ctag,
</p>
cdevBounds * bounds,
</p>
size_t numBounds);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Specifies the bounding dimensions of a multi-dimensional array
of data. In order to use this function, the number of dimensions
in the array must be specified as a parameter to the insert
command when placing the data into the cdevData object. The
cdevBounds structure contains two integers: offset and length.
The length variable represents the number of data elements in
that dimension of the array. The offset integer is provided for
use in specifying the position of arrays that are sub-sets of the
actual data. A version of this function is available that uses an
array of integers rather than the cdevBounds structure. This
function is overloaded to support either the integer tag or
character string tag.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF123">
insert (<em>scalar</em>)
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int insert (int tag, BYTE data);
</p>
int insert (int tag, short data);
</p>
int insert (int tag, unsigned short data);
</p>
int insert (int tag, int data);
</p>
int insert (int tag, unsigned int data);
</p>
int insert (int tag, long data);
</p>
int insert (int tag, unsigned long data);
</p>
int insert (int tag, float data);
</p>
int insert (int tag, double data);
</p>
int insert (int tag, cdev_TS_STAMP data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
These methods allow the user to insert a single data item into
the cdevData object using the specified tag. If another data
item already occupies that tag within the cdevData object, the
new data item will override the old one. Although only the
integer tag prototypes are shown, these functions are
overloaded to support both the integer and character string
data tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF124">
insert (array)
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int insert (int tag, BYTE * data, size_t len, size_t ndim);
</p>
int insert (int tag, short * data, size_t len, size_t ndim);
</p>
int insert (int tag, unsigned short * data, size_t len, size_t ndim);
</p>
int insert (int tag, int * data, size_t len, size_t ndim);
</p>
int insert (int tag, unsigned int * data, size_t len, size_t ndim);
</p>
int insert (int tag, long * data, size_t len, size_t ndim);
</p>
int insert (int tag, unsigned long * data, size_t len, size_t ndim);
</p>
int insert (int tag, float * data, size_t len, size_t ndim);
</p>
int insert (int tag, double * data, size_t len, size_t ndim);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
These methods allow the user to insert array data items into the
cdevData object using the specified tag. The len parameter is
used to specify the total number of items in the array. The ndim
parameter is used to specify the number of dimensions in the
array (1 by default). Although only the integer tag prototypes
are shown, these functions are overloaded to support both the
integer and character string data tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF125">
insert (character string)
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
</p>
int insert (int tag, char * data);
</p>
int insert (int tag, char ** data, size_t len, size_t ndim);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
These methods are used to add NULL terminated character
strings to the cdevData object. These methods differ from the
others because a single character string is treated as a scalar
value. The len parameter (where used) specifies the total
number of character strings in the array. The ndim parameter is
used to specify the number of dimensions in the array (1 by
default). Although only the integer tag prototypes are shown,
these functions are overloaded to support both the integer and
character string data tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF126">
get
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int get(int tag, BYTE * data);
</p>
int get(int tag, short * data);
</p>
int get(int tag, unsigned short * data);
</p>
int get(int tag, int * data);
</p>
int get(int tag, unsigned int * data);
</p>
int get(int tag, long * data);
</p>
int get(int tag, unsigned long * data);
</p>
int get(int tag, float * data);
</p>
int get(int tag, double * data);
</p>
int get(int tag, cdev_TS_STAMP * data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
These methods are used to retrieve scalar values and arrays
that are stored in the cdevData object. When retrieving an
array, it is the caller's responsibility to call the <em>getElems</em> method
to obtain the number of elements and then pre-allocate the
buffer to receive the data. If the receiving data type does not
match the data type stored in the cdevData object, then the
data will be converted to the new type when it is extracted.
Although only the integer tag prototypes are shown, these
functions are overloaded to support both the integer and
character string data tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF127">
get (character string)
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
</p>
int get(int tag, char * data, size_t len);
</p>
int get(int tag, char ** data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
These methods are used to retrieve character strings and
arrays of character strings from a cdevData object. When
obtaining a single character string, the length of the allocated
buffer must be specified in the <em>len</em> parameter. When obtaining
an array of character strings, the caller must pre-allocate the
POINTERS for each element in the array. The cdevData object
will allocate sufficient memory to each of the pointers to hold
the individual character strings. It then becomes the
responsibility of the caller to free the memory assigned to those
pointers. If the receiving data type does not match the data
type stored in the cdevData object, then the data will be
converted to the new type when it is extracted. Although only
the integer tag prototypes are shown, these functions are
overloaded to support both the integer and character string
data tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF128">
find
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
int find(int tag, void* &amp;data);
</p>
int find(char * ctag, void* &amp;data);
<!*** Finish FUNC_PROTO ***!></p></em></font>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Retrieves a pointer to the data within the cdevData object. The
caller is responsible for ensuring that the receiving pointer is of
the correct data type for the data within the object. This function
is overloaded to support both integer and character string tag
identifiers.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF129">
Sample Code
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The following sample program shows the steps necessary to add a new tag character
string and tag integer to the global CDEV tag table. This method is most frequently
used by the CDEV system and CDEV services.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 26:
<a name="LOFREF26">
Using insertTag to add a new tag
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
// ************************************************************
// * Unique tag number and character string
// ************************************************************
int tag = 100;
char * tagName = &quot;testTag&quot;;
// ************************************************************
// * Insert the new tag
// ************************************************************
cdevData::insertTag(tag, tagName);
printf(&quot;Inserted tag %s as tag number %i\\n&quot;, tagName, tag);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 62>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The following sample application illustrates the steps necessary to convert between
character string and integer tag values using the <em>tagI2C</em> and <em>tagC2I</em> methods.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 27:
<a name="LOFREF27">
Using tagC2I and tagI2C to determine cdevData tag identifiers
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
int tag;
char * tagName;
// ************************************************************
// * Insert a new tag into cdevData to illustrate this function
// ************************************************************
cdevData::insertTag(100, &quot;testTag&quot;);
// ************************************************************
// * Now use the command tagI2C to obtain the character string
// * name of the tag from the tag number.
// ************************************************************
cdevData::tagI2C(100, tagName);
// ************************************************************
// * Using the newly obtained character string, call tagC2I to
// * obtain the integer tag value.
// ************************************************************
cdevData::tagC2I(tagName, &amp;tag);
printf(&quot;Tag name %s is tag number %i&quot;, tagName, tag);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 64>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The following sample application shows the steps necessary to place scalar data into
a cdevData object using the <em>insert</em> method and then retrieve the data using the <em>get</em>
method.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 28:
<a name="LOFREF28">
Inserting and retrieving scalar data items using a cdevData object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
int x;
double y;
// ************************************************************
// Insert a short integer as the &quot;value&quot; property.
// ************************************************************
data.insert(&quot;value&quot;, (short int)1);
// ************************************************************
// * Insert a double as the &quot;status&quot; property
// ************************************************************
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 67>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 28:
Inserting and retrieving scalar data items using a cdevData object (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
data.insert(&quot;status&quot;, (double)2.0);
// ************************************************************
// * Get the short stored in the &quot;value&quot; property as a double
// ************************************************************
data.get(&quot;value&quot;, &amp;y);
printf(&quot;value is %f\\n&quot;, y);
// ************************************************************
// * Get the double stored in the &quot;status&quot; property as an int
// ************************************************************
data.get(&quot;status&quot;, &amp;x);
printf(&quot;status is %i\\n&quot;, x);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 71>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The following example illustrates the proper usage of the changeTag method to alter
the tag identifier of a data item stored in the cdevData object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 29:
<a name="LOFREF29">
Using the changeTag method of the cdevData object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
short int x;
// ************************************************************
// Insert a short integer as the &quot;value&quot; property.
// ************************************************************
data.insert(&quot;value&quot;, (short int)1);
// ************************************************************
// * Use the changeTag method to convert the tag identifier
// * for the data item from &quot;value&quot; to &quot;status&quot;.
// ************************************************************
data.changeTag(&quot;value&quot;, &quot;status&quot;);
// ************************************************************
// * Use the get method to retrieve the short integer from the
// * &quot;status&quot; property.
// ************************************************************
data.get(&quot;status&quot;, &amp;x);
printf(&quot;Retrieved %i from the status property\\n&quot;, x);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 73>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The following sample application illustrates how to use the cdevData object to insert
and retrieve a 1 dimensional array of doubles.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 30:
<a name="LOFREF30">
Using one-dimensional arrays with cdevData objects
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
size_t count;
double inArray[5] = {1.0, 2.0, 3.0, 4.0, 5.0};
double *outArray;
// ************************************************************
// * Use the insert method to add the array to the value
// * property of the cdevData object.
// ************************************************************
data.insert(&quot;value&quot;, inArray, 5);
// ************************************************************
// * Now we will extract the data that we just inserted.
// * First, use the getElems method to determine the number of
// * elements in the array.
// ************************************************************
data.getElems(&quot;value&quot;, &amp;count);
// ************************************************************
// * Next allocate an array of doubles sufficient to hold
// * the array stored in the cdevData object.
// ************************************************************
outArray = new double[count];
// ************************************************************
// * Finally, retrieve the data from the cdevData object using
// * the get method.
// ************************************************************
data.get(&quot;value&quot;, outArray);
// ************************************************************
// * Output the result and then free any locally allocated
// * memory.
// ************************************************************
{
printf(&quot;Element %i is %f\\n&quot;, i, outArray[i]);
}
delete outArray;
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 76>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The following example illustrates the correct method for inserting and retrieving a
multi-dimensional array of doubles. This sample program also demonstrates the use
of the getBounds and setBounds function calls, and how they are used to define the
bounding dimensions for a multi-dimensional array.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 31:
<a name="LOFREF31">
Using multi-dimensional arrays with cdevData objects
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
int i;
size_t nElems=1;
size_t nDim =1;
cdevBounds inbounds[2];
double inarray[2][5] =
{
{0.0, 1.0, 2.0, 3.0, 4.0},
{5.0, 6.0, 7.0, 8.0, 9.0}
};
double * outarray;
cdevBounds * outbounds;
// ############################################################
// # Inserting multi-dimensional data into a cdevData object.
// ############################################################
// ************************************************************
// * Set the length of each dimension of the array within the
// * cdevBounds structure. Also, set the offset to 0 for each
// * dimension to specify that this array begins at the origen;
// ************************************************************
inbounds[0].offset = 0; // Offset of first dimension
inbounds[0].length = 2; // Length of first dimension
inbounds[1].offset = 0; // Offset of second dimension
inbounds[1].length = 5; // Length of second dimension
// ************************************************************
// * Use the insert method to add the array to the value
// * property of the cdevData object. The third parameter
// * specifies the exact number of elements that will be added,
// * while the fourth parameter specifies that this will be a
// * two dimensional array.
// ************************************************************
data.insert(&quot;value&quot;, (double *)inarray, 10, 2);
// ************************************************************
// * Use the setBounds method to specify the bounding
// * dimensions of the multi-dimensional array.
// ************************************************************
data.setBounds(&quot;value&quot;, inbounds, 2);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 79>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 31:
Using multi-dimensional arrays with cdevData objects (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ############################################################
// # Retrieving multi-dimensional data from a cdevData object.
// ############################################################
// ************************************************************
// * Call the getDim method to obtain the number of dimensions
// * in the array.
// ************************************************************
data.getDim(&quot;value&quot;, &amp;nDim);
// ************************************************************
// * Allocate a cdevBounds structure of sufficient size to
// * hold all dimensions of the array.
// ************************************************************
outbounds = new cdevBounds[nDim];
// ************************************************************
// * Use the getBounds methods to obtain the bounding
// * dimensions of the array.
// ************************************************************
data.getBounds(&quot;value&quot;, outbounds, 2);
// ************************************************************
// * Calculate the number of elements in the complete array.
// * This step is shown for illustrative purposes only. The
// * result of this operation should be the same value that
// * would be returned by the getElems method.
// ************************************************************
// ************************************************************
// * Allocate an outbound buffer of sufficient size to hold
// * the data in all dimensions of the array.
// ************************************************************
outarray = new double[nElems];
// ************************************************************
// * Use the get method to obtain the data from the cdevData
// * object.
// ************************************************************
data.get(&quot;value&quot;, outarray);
// ************************************************************
// * Output the data retrieved.
// ************************************************************
delete(outbounds);
delete(outarray);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 82>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following example shows the correct method to insert and retrieve a character
string using a cdevData object. The treatment of character strings in CDEV differs
from ordinary values, because a character string is an array that is treated as a scalar.
Therefore, the structure of the get method for a character string is unique.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 32:
<a name="LOFREF32">
Using character strings with cdevData objects
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
char * inString = &quot;This is my test string&quot;;
char outString[50];
// ************************************************************
// * Use the insert method to insert the character string into
// * the cdevData object.
// ************************************************************
data.insert(&quot;value&quot;, inString);
// ************************************************************
// * Next, use the get function to retrieve the string. The
// * maximum length of the string to be retrieved is specified
// * by the third parameter (50).
// ************************************************************
data.get(&quot;value&quot;, outString, 50);
printf(&quot;String is: %s\\n&quot;, outString);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 8>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The next example illustrates the correct method for retrieving an array of character
strings. This is a very special case because, with normal arrays, the caller must pre-
allocate the array that the data will be read into when the get method is caller. With an
array of character strings, the user is responsible for allocating only the array of
POINTERS that each string will be assigned to. The get method will then allocate
sufficient memory to each pointer to store the data.
</p>
When finished using the array, the user is responsible for freeing the memory
assigned to each individual POINTER, and then freeing the array of pointers.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 33:
<a name="LOFREF33">
Using character string arrays with cdevData objects
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
cdevData data;
char ** outString;
size_t nElems;
int i;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 85>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 33:
Using character string arrays with cdevData objects (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
char * inStrings[10] =
{
&quot;string 0&quot;,
&quot;string 1&quot;,
&quot;string 2&quot;,
&quot;string 3&quot;,
&quot;string 4&quot;,
&quot;string 5&quot;,
&quot;string 6&quot;,
&quot;string 7&quot;,
&quot;string 8&quot;,
&quot;string 9&quot;
};
// ############################################################
// # Inserting character string arrays
// ############################################################
// ************************************************************
// * Place the array of character strings into the cdevData
// * object using the insert command. (by default, ndim=1)
// ************************************************************
data.insert(&quot;value&quot;, inStrings, 10);
// ############################################################
// # Retrieving character string arrays
// ############################################################
// ************************************************************
// * Use the getElems function to determine the total number
// * of STRINGS that will be retrieved.
// ************************************************************
data.getElems(&quot;value&quot;, &amp;nElems);
// ************************************************************
// * Allocate an array of pointers, 1 for each element.
// ************************************************************
outString = new char *[nElems];
// ************************************************************
// * Use the get method to retrive the data from cdevData.
// ************************************************************
data.get(&quot;value&quot;, outString);
// ************************************************************
// * Output the data recieved from the cdevData object.
// ************************************************************
printf(&quot;String %i: %s\\n&quot;, i, outString[i]);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 88>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 33:
Using character string arrays with cdevData objects (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ************************************************************
// * Free the memory allocated by cdevData.
// ************************************************************
if(outString[i]!=NULL) delete outString[i];
// ************************************************************
// * Free the locally allocated array of pointers.
// ************************************************************
delete outString;
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 91>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
The next sample application shows how to use the find method of the cdevData
object. The find method can be used to obtain a memory pointer to the data array
within the cdevData object without allocating any new memory. However, because the
find method does not perform any data type conversions, the caller is responsible for
ensuring that a pointer to the correct data type is used.
</p>
This example shows how to use the find method as an alternative approach for
obtaining an array of character strings.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 34:
<a name="LOFREF34">
Using the find method of the cdevData object
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevData.h&gt;
void main()
{
char * inStrings[10] =
{
&quot;string 0&quot;,
&quot;string 1&quot;,
&quot;string 2&quot;,
&quot;string 3&quot;,
&quot;string 4&quot;,
&quot;string 5&quot;,
&quot;string 6&quot;,
&quot;string 7&quot;,
&quot;string 8&quot;,
&quot;string 9&quot;
};
cdevData data;
cdevDataTypes datatype;
char ** outString;
size_t nElems;
int i;
// ************************************************************
// * Place the array of character strings into the cdevData
// * object using the insert command.
// ************************************************************
data.insert(&quot;value&quot;, inStrings, 10);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 94>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 34:
Using the find method of the cdevData object (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ############################################################
// # Retrieving a pointer to the data using the find method
// ############################################################
// ************************************************************
// * For this example, we are going to ensure that the value
// * we are obtaining is an array of strings.
// * The getType method will be caller to ensure that the
// * data type of the value is CDEV_STRING, and then the
// * getElems method will be called to make sure that their
// * is more than one string in the cdevData object.
// ************************************************************
datatype = data.getType(&quot;value&quot;);
data.getElems(&quot;value&quot;, &amp;nElems);
if(datatype==CDEV_STRING &amp;&amp; nElems&gt;0)
{
// ********************************************************
// * Call find to obtain a copy of the data.
// ********************************************************
data.find(&quot;value&quot;, (void *&amp;)outString);
// ********************************************************
// * Output the data recieved from the cdevData object.
// ********************************************************
while(outString[i]!=NULL)
printf(&quot;String %i: %s\\n&quot;, i++, outString[i]);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 96>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
</p>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
7.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF130">
Using the <em>cdevDirectory</em> Device
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF131">
cdevDirectory
Device
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The cdevDirectory device is a cdevDevice object that provides an interface to directory
services within CDEV. Directory services allow an application to obtain data that is
specified in the device definition file (DDL file). Information in the DDL file identifies
<em>services</em>, <em>devices</em> and <em>messages </em>that are supported by CDEV.
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF132">
Attaching to the
cdevDirectory
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The cdevDirectory device can be accessed in the same manner as any other CDEV
device. Their are two methods for obtaining a cdevDirectory device. The first
approach is to get a pointer or reference to a cdevDevice object with the device name
set to cdevDirectory: &quot;<strong>cdevDevice::attachPtr(&quot;cdevDirectory&quot;)</strong>&quot; .
</p>
The second approach allows the caller to obtain a pointer to the directory object from
the system object.
</p>
The example below illustrates using the system object to obtain a pointer to a
cdevDirectory device.
<!*** Finish BODY ***!></p></font>
<!*** Start Body ***!><font size=+2 color=Black>
<!*** Finish Body ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 35:
<a name="LOFREF35">
Attaching to the cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ***************************************************************
// * Include required CDEV header files
// ***************************************************************
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
void main()
{
// ***********************************************************
// * Obtain a reference to the default cdevSystem object
// ***********************************************************
cdevSystem &amp; system = cdevSystem::defaultSystem();
// ***********************************************************
// * Obtain a pointer to the &quot;cdevDirectory&quot; device using the
// * getDevice member function of the default cdevSystem
// * object.
// ***********************************************************
cdevDevice * directory = system.getDevice(&quot;cdevDirectory&quot;);
.
.
.
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 1>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF133">
Messages
Supported by
cdevDirectory
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
An application communicates with the cdevDirectory device through the use of
predefined message strings. The following messages are supported by the
cdevDirectory device.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong>query: </strong>Identify the devices that are members of a DDL class.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>queryClass: </strong></em>Identify the DDL <em>class</em> from which a <em>device </em>is instantiated.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>queryAttributes: </strong></em>Identify all <em>attributes</em> supported by a <em>device</em> or a DDL <em>class.</em>
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>queryMessages: </strong></em>Identify all <em>messages</em> supported by a <em>device</em> or DDL <em>class.</em>
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>queryVerbs: </strong></em>Identify all <em>verbs</em> supported by a <em>device</em> or DDL <em>class.</em>
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
6.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>service: </strong></em>Identify the <em>service</em> that is used by a <em>device/message</em> pair.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
7.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>serviceData:</strong></em> Identify <em>service</em> data specified for a <em>device/message</em> pair.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
8.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>update:</strong></em><strong> </strong>Add information to the <em>cdevDirectory</em> data structure.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
9.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
<strong><em>validate: </strong></em>Verify that a <em>device</em> or DDL <em>class</em> contains certain properties.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF134">
&quot;query&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;query&quot; message is submitted to the cdevDirectory object in order to obtain a list
of matching <em>devices</em> that are instantiated from a specified DDL <em>class</em>. The class name
is specified as an absolute string. The device name may be specified either as an
absolute string or as a <em>regular expression</em>.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 36:
<a name="LOFREF36">
cdevData Input/Output associated with a &quot;query&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Regular expression identifying the device names
that should be retrieved.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
class
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the DDL class that the devices should
be instantiated from.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
array of strings
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Names of matching devices
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to request the names of all
<em>devices</em> that are members of the DDL <em>class</em> &quot;magnet&quot;.
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 37:
<a name="LOFREF37">
Using the &quot;query&quot; Message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
// ***********************************************************
// * Use the shorthand method to obtain a pointer to the
// * cdevDirectory device within the default system.
// ***********************************************************
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Insert the name of the DDL class and the regular
// * expression for the device.
// ***********************************************************
input.insert(&quot;class&quot;, &quot;magnet&quot;);
input.insert(&quot;device&quot;, &quot;.*&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object using the
// * send command.
// ***********************************************************
if(dir-&gt;send(&quot;query&quot;, input, output)==CDEV_SUCCESS)
{
// ********************************************************
// * If the command was successful, obtain a pointer to the
// * list of names and output them on stdout.
// ********************************************************
char ** ptr;
output.find(&quot;value&quot;, ptr);
while(*ptr!=NULL) fprintf(stdout, &quot;%s\\n&quot;, ptr++);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 5>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF135">
&quot;queryClass&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;queryClass&quot; message is submitted to the cdevDirectory object in order to identify
the name of the DDL <em>class</em> that a <em>device</em> is instantiated from.
</p>
The request is submitted to the cdevDirectory device through its send, sendCallback,
or sendNoBlock interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 38:
<a name="LOFREF38">
cdevData input/output associated with a &quot;queryClass&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the device to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Names of the associated class
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to determine the name of the
DDL class from which the device &quot;MQB1S01&quot; is derived.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 39:
<a name="LOFREF39">
Using the &quot;queryClass&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Insert the name of the DDL class.
// ***********************************************************
input.insert(&quot;device&quot;, &quot;MQB1S01&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object.
// ***********************************************************
if(dir-&gt;send(&quot;queryClass&quot;, input, output)==CDEV_SUCCESS)
{
// *******************************************************
// * If successful, output the name of the DDL class.
// *******************************************************
char * ptr;
output.find(&quot;value&quot;, ptr);
fprintf(stdout, &quot;MQB1S01 is a %s\\n&quot;, value);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 32>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF136">
&quot;queryAttributes&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;queryAttributes&quot; message is submitted to the cdevDirectory object in order to
obtain a list of all <em>attributes</em> that are contained within a specified <em>device</em> or DDL <em>class</em>.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 40:
<a name="LOFREF40">
cdevData input/output associated with a &quot;queryAttributes&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device or
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the device to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
class
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the DDL class to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
array of strings
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Names of matching attributes
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to request the names of all
<em>attributes</em> that are defined within the DDL <em>class</em> &quot;magnet&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 41:
<a name="LOFREF41">
Using the &quot;queryAttributes&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Insert the name of the DDL class.
// ***********************************************************
input.insert(&quot;class&quot;, &quot;magnet&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object using the
// * send command.
// ***********************************************************
if(dir-&gt;send(&quot;queryAttributes&quot;, input, output)==CDEV_SUCCESS)
{
// *******************************************************
// * If the command was successful, obtain a pointer to
// * the list of attributes and output them on stdout.
// *******************************************************
char ** ptr;
output.find(&quot;value&quot;, ptr);
while(*ptr!=NULL) fprintf(stdout, &quot;%s\\n&quot;, ptr++);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 11>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF137">
&quot;queryMessages&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;queryMessages&quot; message is submitted to the cdevDirectory object in order to
obtain a list of all <em>messages</em> that are contained within a specified <em>device</em> or DDL <em>class</em>.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 42:
<a name="LOFREF42">
cdevData input/output associated with a &quot;queryMessages&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device or
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the device to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
class
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the DDL class to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
array of strings
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Names of matching messages
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to request the names of all
<em>messages</em> that are defined within the DDL <em>class </em>&quot;magnet&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 43:
<a name="LOFREF43">
Using the &quot;queryMessages&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Insert the name of the DDL class.
// ***********************************************************
input.insert(&quot;class&quot;, &quot;magnet&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object using the
// * send command, and output the result if successful.
// ***********************************************************
if(dir-&gt;send(&quot;queryMessages&quot;, input, output)==CDEV_SUCCESS)
{
char ** ptr;
output.find(&quot;value&quot;, ptr);
while(*ptr!=NULL) fprintf(stdout, &quot;%s\\n&quot;, ptr++);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 17>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF138">
&quot;queryVerbs&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;queryVerbs&quot; message is submitted to the cdevDirectory object in order to obtain
a list of all <em>verbs</em> that are contained within a specified <em>device</em> or DDL <em>class</em>.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 44:
<a name="LOFREF44">
cdevData input/output associated with a &quot;queryVerbs&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device or
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the device to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
class
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the DDL class to be queried.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character strings
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Names of matching verbs.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to request the names of all
<em>verbs</em> that are defined within the DDL <em>class </em>&quot;magnet&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 45:
<a name="LOFREF45">
Using the &quot;queryVerbs&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input;
cdevData output;
// ***********************************************************
// * Insert the name of the DDL class.
// ***********************************************************
input.insert(&quot;class&quot;, &quot;magnet&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object using the
// * send command, and output the result if successful.
// ***********************************************************
if(dir-&gt;send(&quot;queryVerbs&quot;, input, output)==CDEV_SUCCESS)
{
char ** ptr;
output.find(&quot;value&quot;, ptr);
while(*ptr!=NULL) fprintf(stdout, &quot;%s\\n&quot;, ptr++);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 14>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF139">
&quot;service&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;service&quot; message is submitted to the cdevDirectory object in order to identify
which CDEV <em>service</em> will respond to a specified <em>device</em> / <em>message</em> combination. The
caller specifies the <em>device</em> name and the <em>message</em> string in the <em>input</em> cdevData object
and can retrieve the result from the value entry in the resulting <em>output</em> cdevData object.
This message will normally only be used internally by CDEV.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 46:
<a name="LOFREF46">
cdevData input/output associated with a &quot;service&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the CDEV device.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
message
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the message.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the service that will respond to the
specified device and message.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to resolve the name of the
service that will respond to the device &quot;DEV1&quot; and the message &quot;get VAL&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 47:
<a name="LOFREF47">
Using the &quot;service&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ************************************************************
// * Insert the name of the device and message to be resolved.
// ************************************************************
input.insert(&quot;device&quot;, &quot;DEV1&quot;);
input.insert(&quot;message&quot;, &quot;get VAL&quot;);
// ************************************************************
// Submit the request to the cdevDirectory object using the
// send command, and output the result if successful.
// ************************************************************
if(dir-&gt;send(&quot;service&quot;, input, output)==CDEV_SUCCESS)
{
char * ptr;
output.find(&quot;value&quot;, ptr);
fprintf(stdout, &quot;Service name is:%s\\n&quot;, ptr);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 20>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF140">
&quot;serviceData&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;serviceData&quot; message is submitted to the cdevDirectory object in order to obtain
<em>service</em> specific data that is associated with a <em>device</em> or a <em>message</em>. The information
will be returned to the caller in the output cdevData object in the form of tagged data
items. This message will normally only be used in the development of a new CDEV
service.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 48:
<a name="LOFREF48">
cdevData input/output associated with a &quot;serviceData&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the CDEV device.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
message
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the message.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
(service
specific)
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Data items specified in the service data section
for the specified device / message combination.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to obtain the serviceData
associated with the device &quot;DEV1&quot; and the message &quot;get VAL&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 49:
<a name="LOFREF49">
Using the &quot;serviceData&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Insert the name of the device and message to be resolved.
// ***********************************************************
input.insert(&quot;device&quot;, &quot;DEV1&quot;);
input.insert(&quot;message&quot;, &quot;get VAL&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object using the
// * send command, and output the result (using asciiDump) if
// * successful.
// ***********************************************************
if(dir-&gt;send(&quot;serviceData&quot;, input, output)==CDEV_SUCCESS)
{
output.asciiDump(stdout);
}
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 23>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF141">
&quot;update&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;update&quot; message is submitted to the cdevDirectory object in order to add new or
updated class definitions or device instances to the internal device definition data
structures. The data that is submitted in the input cdevData object is in the same form
as a corresponding entry in the CDEV DDL file.
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 50:
<a name="LOFREF50">
cdevData input/output associated with a &quot;update&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value or
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
ASCII text definition of a DDL class or device
instanciation.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
file
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Complete path to the file containing the updated
DDL information.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
integer
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Boolean completion status of the operation.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to insert the class definition for
the &quot;stdio&quot; class into the device definition data structure using the cdevDirectory
object.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 51:
<a name="LOFREF51">
Using the &quot;update&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
// ***********************************************************
// * Class definition to insert.
// ***********************************************************
char *def = &quot;class stdio{verbs{get,set,monitorOn,monitorOff}}&quot;;
// ***********************************************************
// * Insert the class definition.
// ***********************************************************
input.insert(&quot;value&quot;, def);
// ***********************************************************
// * Submit the request to the cdevDirectory object.
// ***********************************************************
dir-&gt;send(&quot;update&quot;, input, output)
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 26>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF142">
&quot;validate&quot;
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The &quot;validate&quot; message is submitted to the cdevDirectory object in order to verify that
a combination of <em>device, DDL class, verb, attribute </em>or <em>message </em>represent a valid
combination.
</p>
At least one of <em>device</em> or <em>DDL class</em> must be specified when using this message. If
both are specified, the cdevDirectory object will confirm that the <em>device</em> is a member of
the specified<em> DDL class</em>.
</p>
If <em>verb, attribute </em>or<em> message </em>are included, the cdevDirectory object will determine if
each of them are members of the specified <em>device </em>and/or<em> DDL class.</em>
</p>
The request is submitted to the cdevDirectory device through its <em>send</em>, <em>sendCallback</em>,
or <em>sendNoBlock</em> interface. The following table shows the inputs that must be placed in
the inbound cdevData object prior to submitting the command, and the outputs that
can be retrieved when the command is completed.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 52:
<a name="LOFREF52">
cdevData input/output associated with a &quot;validate&quot; message
<table border=1>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Tag Name
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Data Type
<!*** Finish CELLHEADING ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLHEADING ***!><font size=+1 color=Black>
Content
<!*** Finish CELLHEADING ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Input
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
device or
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the CDEV device.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
class
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the DDL class.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
attribute
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the attribute to validate (optional)
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
message
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the message to validate (optional)
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
verb
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
character string
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Name of the verb to validate (optional)
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
<tr>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Message Output
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
value
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
integer
<!*** Finish CELLBODY ***!><br></font>
</td>
<td valign=top>
<!*** Start CELLBODY ***!><font size=+1 color=Black>
Boolean completion status of the operation.
<!*** Finish CELLBODY ***!><br></font>
</td>
</tr>
</table>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start BODY ***!><font size=+1 color=Black>
The following figure shows the source code necessary to determine if the <em>verb</em>
&quot;monitorOn&quot; is a member of the <em>class</em> &quot;stdio&quot;.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 53:
<a name="LOFREF53">
Using the &quot;update&quot; message with a cdevDirectory device
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevData.h&gt;
void main()
{
cdevDevice *dir = cdevDevice::attachPtr(&quot;cdevDirectory&quot;);
cdevData input, output;
int result;
input.insert(&quot;class&quot;, &quot;stdio&quot;);
input.insert(&quot;verb&quot;, &quot;monitorOn&quot;);
// ***********************************************************
// * Submit the request to the cdevDirectory object.
// ***********************************************************
dir-&gt;send(&quot;validate&quot;, input, output)
result = (int)output;
fprintf(stdout, &quot;monitorOn %s in stdio&quot;, result?&quot;IS&quot;:&quot;IS NOT&quot;);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 29>
</a> <!*** Finish FIGURE ***!></p></em></font>
</td></tr>
<tr><td valign=top align=right>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
8.
<!*** Finish HEADING1 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
<a name="TOCREF143">
Default Service Behavior for Standard Messages
</a> <!*** Finish HEADING1 ***!></p></strong></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF144">
Overview
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The CDEV library is designed to provide a standard calling interface to dissimilar
devices within a control system. This interface is accommodated through the use of
the cdevDevice methods <strong><em>send, sendNoBlock</strong></em> and <strong><em>sendCallback</strong></em><em>.</em> However, because
each service can define the names and behaviors of the messages that it supports,
the user must be increasingly aware of which service may process its messages.
</p>
In order to reduce the required knowledge of the user, and to improve the consistency
of all services, all CDEV services should provide well-defined support for a minimum
list of <em>verbs</em>.
</p>
The following verbs should be implemented to provide a standard behavior in all
CDEV services: <strong><em>get, set, monitorOn,</strong></em> and <strong><em>monitorOff.</strong></em>
<!*** Finish BODY ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF145">
&quot;get&quot; Message
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>&quot;get&quot;</em> verb can be joined with any <em>attribute</em> of a device to form a &quot;get&quot; message.
This message is then sent to the device in order to obtain the value of specified
<em>properties </em>of the <em>attribute. </em>The following steps should be executed in order to utilize a
<em>&quot;get&quot;</em> message.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Obtain a pointer to the <em>cdevDevice</em> object for the device that you wish to address.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a message string by concatenating the <em>attribute </em>that you wish to address
to the <em>&quot;get&quot;</em> verb. For instance, to get the <em>VAL</em> attribute of a device, the message
strings should be: <strong><em>&quot;get VAL&quot;</strong></em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Optionally, use the cdevDevice object created in step 1 and the message string
created in step 2 to obtain a pointer to a <em>cdevRequestObject </em>object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Set the <em>context</em> of the <em>cdevDevice</em> or <em>cdevRequestObject</em> to indicate which
properties you wish to obtain. A non-zero value in any property indicates that its
value should be returned. If no context has been specified, the service should
return the <em>value</em> property by default. A complete description of the context data
object is provided in the cdevDevice documentation.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Use the <strong><em>send, sendNoBlock, </strong></em>or <strong><em>sendCallback</strong></em> message to submit the message
to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
6.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Evaluate the return value from the <strong><em>send </strong></em>command to determine if the operation
completed successful. Any value other than <strong><em>CDEV_SUCCESS </strong></em>indicates that an
error occurred in handling the message.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
7.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
If the call was completed successfully, extract the desired properties from the
resultant cdevData object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF146">
&quot;set&quot; Message
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>&quot;set&quot;</em> verb can be joined with any <em>attribute</em> of a device to form a &quot;set&quot; message.
This message is then sent to the device in order to set the value <em>property </em>of the
<em>attribute. </em>The following steps should be executed in order to utilize a <em>&quot;set&quot;</em> message.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Obtain a pointer to the <em>cdevDevice</em> object for the device that you wish to address.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a message string by concatenating the <em>attribute </em>that you wish to address
to the <em>&quot;set&quot;</em> verb. For instance, to set the <em>bdl</em> attribute of a device, the message
string should be: <strong><em>&quot;set bdl&quot;</strong></em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Optionally, use the cdevDevice object created in step 1 and the message string
created in step 2 to obtain a pointer to a <em>cdevRequestObject </em>object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Set the <em>value</em> property of the outbound cdevData object to the new value.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Use the <strong><em>send, sendNoBlock, </strong></em>or <strong><em>sendCallback</strong></em> message to submit the message
to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
6.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Evaluate the return value from the specific <strong><em>send </strong></em>command to determine if the
message was transmitted successful. Any value other than <strong><em>CDEV_SUCCESS
</strong></em>indicates that the message was not transmitted successfully.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
In the following example, the <em>&quot;get&quot;</em> message will be used to obtain the properties
<em>value, status and severity </em>from the <em>bdl</em> attribute of device <em>MQB1S01</em>, the <em>&quot;set&quot;
</em>message will then be used to copy the <em>value</em> property to the <em>bdl </em>attribute of device
<em>MQB1S02</em>.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 54:
<a name="LOFREF54">
Default behavior of the &quot;get&quot; and &quot;set&quot; messages
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevData.h&gt;
// ****************************************************************
// * The printError function will be used to output any error that
// * that occurs during the processing of the &quot;get&quot; or &quot;set&quot;
// * messages.
// ****************************************************************
int printError ( int errCode )
{
switch(errCode)
{
// ******* Unknown device or device/message mismatch ******
case CDEV_INVALIDOBJ:
printf(&quot;Unknown device or device/message mismatch\\n&quot;);
break;
// * Communications error between application and service *
case CDEV_NOTCONNECTED:
case CDEV_IOFAILED:
case CDEV_TIMEOUT:
printf(&quot;Communications error while sending\\n&quot;);
break;
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 153>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 54:
Default behavior of the &quot;get&quot; and &quot;set&quot; messages (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ******* No data or bad data passed with message ********
case CDEV_INVALIDARG:
case CDEV_OUTOFRANGE:
case CDEV_NOTFOUND:
case CDEV_CONVERT:
printf(&quot;Bad or missing value passed in message\\n&quot;);
break;
// ******************** Generic Error *********************
case CDEV_ERROR:
case default:
printf(&quot;Unable to send message\\n&quot;);
break;
}
}
void main()
{
cdevRequestObject * req1, *req2;
cdevData ctx;
cdevData output, input;
double val;
int errorCode = CDEV_SUCCESS;
// ***********************************************************
// * Obtain a pointer to the cdevRequestObject for the
// * &quot;get bdl&quot; message on device &quot;MQB1S01&quot;.
// ***********************************************************
req1 = cdevRequestObject::attachPtr(&quot;MQB1S01&quot;, &quot;get bdl&quot;);
// ***********************************************************
// * Place a non-zero value in the properties value, status,
// * severity.
// ***********************************************************
ctx.set(&quot;value&quot;, 1);
ctx.set(&quot;status&quot;, 1);
ctx.set(&quot;severity&quot;, 1);
// ***********************************************************
// * Set the context of the cdevRequestObject.
// ***********************************************************
req1-&gt;setContext(ctx);
// ***********************************************************
// * Submit the message to the device and test the return
// * value to ensure that the message was processed correctly
// ***********************************************************
if((errorCode=req1-&gt;send(NULL, &amp;output))==CDEV_SUCCESS)
{
// ********************************************************
// * Message was transmitted and processed successfuly.
// ********************************************************
char stat[50], sev[255];
output.get(&quot;value&quot;, &amp;val);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 149>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 54:
Default behavior of the &quot;get&quot; and &quot;set&quot; messages
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
output.get(&quot;status&quot;, stat, 50);
output.get(&quot;severity&quot;, sev, 50);
printf(&quot;Val:%f, status:%s, severity:%s&quot;, val, stat, sev);
}
else printError(errorCode);
// ***********************************************************
// * Obtain a pointer to the cdevRequestObject for the
// * &quot;set bdl&quot; message on device &quot;MQB1S02&quot;.
// ***********************************************************
req2 = cdevRequestObject::attachPtr(&quot;MQB1S02&quot;, &quot;set bdl&quot;);
// ***********************************************************
// * Insert the new value into the input cdevData object.
// ***********************************************************
input.insert(&quot;value&quot;, value);
// ***********************************************************
// * Submit the message <em>&quot;set bdl&quot; </em>to the device and test
// * the return value to ensure that the message was
// * processed successfully. Note that, by default, the set
// * message does not generate any output.
// ***********************************************************
if((errorCode==req2-&gt;send(&amp;input, NULL))==CDEV_SUCCESS)
{
// ********************************************************
// * Message was transmitted and processed successfuly.
// ********************************************************
printf(&quot;Message was transmitted successfully\\n&quot;);
}
else printError(errorCode);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 151>
<!*** Finish FIGURE_CONT ***!></p></em></font>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF147">
&quot;monitorOn&quot;
Message
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>&quot;monitorOn&quot;</em> verb can be joined with any <em>attribute</em> of a device to form a
&quot;<em>monitorOn</em>&quot; message. This message is tells the cdevDevice that each time one of the
monitored <em>properties</em> changes, it should call the user specified callback function with
the updated value. This message should always be submitted using the
<strong>sendCallback </strong>method of the cdevDevice or cdevRequestObject in order to provide
the address of the callback function.
</p>
The following steps should be executed in order to submit a <em>&quot;monitorOn&quot;</em> message.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Obtain a pointer to the <em>cdevDevice</em> object for the device that you wish to address.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a message string by concatenating the <em>attribute </em>that you wish to address
to the <em>&quot;monitorOn&quot;</em> verb. For instance, to monitor a property of the <em>bdl</em> attribute of a
device, the message string should be: <strong><em>&quot;monitorOn bdl&quot;</strong></em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Optionally, use the cdevDevice object created in step 1 and the message string
created in step 2 to obtain a pointer to a <em>cdevRequestObject </em>object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Set the <em>context </em>of the cdevDevice or cdevRequestObject to indicate the <em>properties
</em>that you wish to monitor, and the <em>properties</em> you wish to receive when a change
occurs. The context used by the &quot;<em>monitorOn</em>&quot; message differs from that of the
<em>&quot;get&quot;</em> message in that different non-zero values have special meanings. The
following is a list of integer values that should be supported by the context of a
&quot;<em>monitorOn</em>&quot; message.
<!*** Finish Numbered ***!></p></font>
<!*** Start Indented ***!><font size=+1 color=Black>
0 The value of this property should never be
returned.
</p>
</p>
1 This property should not be monitored, but it
should be returned as context when a monitored
value changes; e.g. a time stamp.
</p>
</p>
2 Monitor this property and call the callback function
when it changes, however, return only this property
in the resultant cdevData object.
</p>
</p>
3 Monitor this property and call the callback function
when it changes and include the value of all
properties whose context is 1 in the resultant
cdevData object.
</p>
<!*** Finish Indented ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a <em>cdevCallback</em> object that contains the address of the cdevCallback
function and a void pointer to any user argument that should be provided to the
callback function.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
6.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Use the <strong><em>sendCallback</strong></em> message to submit the message to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
7.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Evaluate the return value from the specific <strong><em>sendCallback </strong></em>command to determine
if the message was transmitted successful. Any value other than
<strong><em>CDEV_SUCCESS </strong></em>indicates that the message was not transmitted successfully.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
8.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Monitor the status returned to the <em>cdevCallbackFunction </em>to determine if the
callback is operating correctly. Any of the following values may be returned in the
<em>status</em> parameter.
<!*** Finish Numbered ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF148">
CDEV_SUCCESS:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The value has changed and the new value is
stored in the cdevData parameter. This status is
also generated when the monitorOn command
is initially issued.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF149">
CDEV_DISCONNECTED:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The connection has been lost between the
application and the server.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF150">
CDEV_RECONNECTED:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The connection between the application and the
server has been re-established and the updated
value is available in the cdevData parameter.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF151">
CDEV_ERROR:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The message was not processed successfully.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF152">
CDEV_INVALIDOBJ:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Invalid cdev request object used.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF153">
CDEV_INVALIDARG:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Invalid argument passed to cdev call.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF154">
CDEV_INVALIDSVC:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Wrong service during dynamic loading.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF155">
CDEV_NOTCONNECTED:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Not connected to low level network service.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF156">
CDEV_IOFAILED:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Low level network service IO failed.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF157">
CDEV_CONFLICT:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Conflicts of data types or tags.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF158">
CDEV_NOTFOUND:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Cannot find specified data in cdevData.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF159">
CDEV_TIMEOUT:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Time out.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF160">
CDEV_CONVERT:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
cdevData conversion error.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF161">
CDEV_OUTOFRANGE:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Value out of range for device attribute.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF162">
CDEV_NOACCESS:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Insufficient access to perform request.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF163">
CDEV_ACCESSCHANGED:
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
Change in access permission of device.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
9.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Because the monitorOn command is a single message that may generate many
responses, the developer may have difficulty in determining when the last reply
has been received. In order to accomodate this, the developer may call the
cdevCallback::isTransactionDone() method to determine if the callback that is
being processed is the last one that is associated with that request. The service
developer is expected to use the cdevCallback::fireCallback method to ensure that
this parameter is set to the proper value.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
</td></tr>
<tr><td valign=top>
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
<a name="TOCREF164">
&quot;monitorOff&quot;
Message
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start BODY ***!><font size=+1 color=Black>
The <em>&quot;monitorOff&quot;</em> verb can be joined with any <em>attribute</em> of a device to form a
&quot;<em>monitorOff</em>&quot; message. This message is tells the cdevDevice to deactivate a
monitorOn command that was previously set on one or more of its attributes.
</p>
This message should always be called using the <em>sendCallback</em> method in order to
specify the address of the callback function that was used in creating the monitor.
</p>
The service checks the following things to determine which monitor is to be removed.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF165">
device
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
The service will locate all active monitors that
have been placed on the specified device.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF166">
attribute
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
From the list of obtained above, the service will
locate all active monitors on the specified
attribute.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF167">
function
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
From the list obtained above, the service will
locate all active monitors that have the specified
callback function. If this value is NULL, then all
elements from the previous list will be removed.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
<a name="TOCREF168">
userarg
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
</td>
<td valign=top>
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
From the list obtained above, the service will
locate and remove all monitors that have the
same user argument. If this value is NULL, then
all elements from the previous list will be
removed.
<!*** Finish FUNC_DEF ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
The following steps should be executed in order to submit a <em>&quot;monitorOff&quot;</em> message.
<!*** Finish BODY ***!></p></font>
<table>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
1.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Obtain a pointer to the <em>cdevDevice</em> object for the device that you wish to address.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
2.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a message string by concatenating the <em>attribute </em>that you wish to address
to the <em>&quot;monitorOff&quot;</em> verb. For instance, to monitor a property of the <em>bdl</em> attribute of a
device, the message string should be: <strong><em>&quot;monitorOn bdl&quot;</strong></em>.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
3.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Optionally, use the cdevDevice object created in step 1 and the message string
created in step 2 to obtain a pointer to a <em>cdevRequestObject </em>object.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
4.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Create a <em>cdevCallback</em> object that contains the address of the cdevCallback
function and a void pointer to the user argument that was originally provided to the
monitorOn message.
<!*** Finish Numbered ***!></p></font>
</td></tr>
<tr><td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
5.
<!*** Finish Numbered ***!></p></font>
</td>
<td valign=top>
<!*** Start Numbered ***!><font size=+1 color=Black>
Use the <strong><em>sendCallback</strong></em> message to submit the message to the device.
<!*** Finish Numbered ***!></p></font>
</td></tr>
</table>
<!*** Start BODY ***!><font size=+1 color=Black>
The following example illustrates how to use the <em>&quot;monitorOn&quot;</em> and <em>&quot;monitorOff&quot;</em> to
install and remove monitors. This example also demonstrates the to correct way to
utilize the cdevCallback function.
</p>
<!*** Finish BODY ***!></p></font>
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
Figure 55:
<a name="LOFREF55">
Default behavior of the &quot;monitorOn&quot; and &quot;monitorOff&quot; messages
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
#include &lt;cdevSystem.h&gt;
#include &lt;cdevDevice.h&gt;
#include &lt;cdevRequestObject.h&gt;
#include &lt;cdevData.h&gt;
#include &lt;cdevCallback.h&gt;
// ****************************************************************
// * This is the callback function that will be executed each time
// * one of my monitored values changes.
// ****************************************************************
void callback (int status, void * userarg,
cdevRequestObject &amp; req, cdevData &amp; data)
{
switch(status)
{
// *********************************************************
// * If I receive one of these message then I know that
// * updated data is available in the cdevData object.
// *********************************************************
case CDEV_SUCCESS:
case CDEV_RECONNECTED:
// ******************************************************
// * I will call the getType method to determine if the
// * value attribuite is present in the cdevData object.
// * If it is, then I will known that it is responsible
// * for triggering this callback.
// ******************************************************
if(data.getType(&quot;value&quot;)!=CDEV_INVALID)
{
// **************************************************
// * I have specified that I wanted status and
// * severity to be returned as context whenever the
// * value property has changed. Therefore, I will
// * output all of these properties.
// **************************************************
double * valPtr;
char * statPtr;
char * sevPtr;
data.find(&quot;value&quot;, (void *&amp;)valPtr);
data.find(&quot;status&quot;, (void *&amp;)statPtr);
data.find(&quot;severity&quot;, (void *&amp;)sevPtr);
printf(&quot;Val:%f, status:%s, severity:%s&quot;,
*valPtr, statPtr, sevPtr);
}
// ******************************************************
// * I will call the getType method of the cdevData
// * object to determine if the controlHigh property is
// * present. If it is, I will know that it triggered
// * this callback.
// ******************************************************
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 37>
</a> <!*** Finish FIGURE ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 55:
Default behavior of the &quot;monitorOn&quot; and &quot;monitorOff&quot; messages (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
else if(getType(&quot;controlHigh&quot;)!=CDEV_INVALID)
{
double * controlPtr;
data.find(&quot;controlHigh&quot;, (void *&amp;) controlPtr);
printf(&quot;Control High is now %f\\n&quot;, *controlPtr);
}
break;
// *********************************************************
// * This status indicates that the connection has been lost
// * between the application and the server.
// *********************************************************
case CDEV_DISCONNECTED:
fprintf(stderr, &quot;Connection lost to server\\n&quot;);
break;
// *********************************************************
// * This status indicates that an error occurred while
// * installing or operating the monitor.
// *********************************************************
case CDEV_ERROR:
fprintf(stderr, &quot;Error while monitoring&quot;);
break;
}
}
void main()
{
cdevSystem * system;
cdevDevice * dev;
cdevRequestObject * req;
cdevData ctx;
// ***********************************************************
// * Construct a cdevCallback object that has a pointer to the
// * cdevCallback function and a NULL user argument.
// ***********************************************************
cdevCallback cb(callback, NULL);
// ***********************************************************
// * Obtain a pointer to the default cdevSystem in order to
// * accomodate polling.
// ***********************************************************
system = &amp;cdevSystem::defaultSystem();
// ***********************************************************
// * Obtain a pointer to the cdevDevice MQB1S01
// ***********************************************************
dev = cdevDevice::attachPtr(&quot;MQB1S01&quot;);
// ***********************************************************
// * Obtain a pointer to the cdevRequestObject for the
// * &quot;monitorOff bdl&quot; message on device &quot;MQB1S01&quot;.
// ***********************************************************
req = dev-&gt;getRequestObject(&quot;MQB1S01&quot;, &quot;monitorOn bdl&quot;);
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 69>
<!*** Finish FIGURE_CONT ***!></p></em></font>
<!*** Start FIGURE_CONT ***!><font size=+0 color=Black><em>
Figure 55:
Default behavior of the &quot;monitorOn&quot; and &quot;monitorOff&quot; messages (continued)
<table border=1><tr><td>
<table>
<tr><td>
<! ***** Empty Column ***** !>
</td>
<td valign=top>
<!*** Start PROGRAM ***!><pre><font size=+0 color=Black><strong>
// ###########################################################
// # Setup the context to indicate the data that should be
// # returned whenever one of the values is changed.
// ###########################################################
// ***********************************************************
// * Any time the &quot;value&quot; property changes, I want to receive
// * the &quot;status&quot; and &quot;severity&quot; properties.
// ***********************************************************
ctx.insert(&quot;value&quot;, 3);
ctx.insert(&quot;status&quot;, 1);
ctx.insert(&quot;severity&quot;, 1);
// ***********************************************************
// * Any time the &quot;controlhigh&quot; property changes, I only want
// * to receive its new value.
// ***********************************************************
ctx.insert(&quot;controlHigh&quot;, 2);
// ***********************************************************
// * Set the context of the cdevRequestObject to the new
// * context.
// ***********************************************************
req-&gt;setContext(ctx);
// ************************************************************
// * Submit the &quot;monitorOn&quot; message using the sendCallback
// * method of the cdevRequestObject.
// ************************************************************
if(req-&gt;sendCallback(NULL, cb)==CDEV_SUCCESS)
{
// ********************************************************
// * Pend for 60 second.
// ********************************************************
system-&gt;pend(60.0);
// ********************************************************
// * Send a &quot;monitorOff bdl&quot; message to disable the monitor
// * that was just installed.
// ********************************************************
dev-&gt;sendCallback(&quot;monitorOff bdl&quot;, NULL, cb);
}
else fprintf(stderr, &quot;Failed to install monitor\\n&quot;);
}
<!*** Finish PROGRAM ***!></strong></font></pre>
</td></tr>
</table>
</tr></td></table>
<AFrame 155>
<!*** Finish FIGURE_CONT ***!></p></em></font>
</td></tr>
</table>
</body>