📄 classreceiver.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Copley Motion Library: Receiver Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.4 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>Receiver Class Reference</h1><!-- doxytag: class="Receiver" --><p>Inheritance diagram for Receiver:<p><center><img src="classReceiver.png" usemap="#Receiver_map" border="0" alt=""></center><map name="Receiver_map"><area href="classLSS.html" alt="LSS" shape="rect" coords="0,56,115,80"><area href="classNode.html" alt="Node" shape="rect" coords="125,56,240,80"><area href="classNodeEmcyRcvr.html" alt="NodeEmcyRcvr" shape="rect" coords="250,56,365,80"><area href="classSDO.html" alt="SDO" shape="rect" coords="375,56,490,80"><area href="classTPDO.html" alt="TPDO" shape="rect" coords="500,56,615,80"><area href="classCopleyNode.html" alt="CopleyNode" shape="rect" coords="62,112,177,136"><area href="classIOModule.html" alt="IOModule" shape="rect" coords="187,112,302,136"><area href="classIOModule_1_1AlgInPDO.html" alt="IOModule::AlgInPDO" shape="rect" coords="312,112,427,136"><area href="classIOModule_1_1DigInPDO.html" alt="IOModule::DigInPDO" shape="rect" coords="437,112,552,136"><area href="classTPDO__PvtBuffStat.html" alt="TPDO_PvtBuffStat" shape="rect" coords="562,112,677,136"><area href="classTPDO__Status.html" alt="TPDO_Status" shape="rect" coords="687,112,802,136"><area href="classAmp.html" alt="Amp" shape="rect" coords="62,168,177,192"></map><a href="classReceiver-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>CANopen receiver object. <p>This class allows the programmer to create routines that are run whenever a CAN frame with a specific ID is received.<p>To run code when a message is received, create a new class that extends Receiver. The <a class="el" href="classReceiver.html#a3">Receiver::Init()</a> function should be called with the COB-ID of the frames to be received. Whenever this new class is Enabled(), the member function <a class="el" href="classReceiver.html#a5">NewFrame()</a> will be called once for every frame received with a matching ID.<p><p>Definition at line <a class="el" href="CML__CanOpen_8h-source.html#l00217">217</a> of file <a class="el" href="CML__CanOpen_8h-source.html">CML_CanOpen.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0"></a><!-- doxytag: member="Receiver::Receiver" ref="a0" args="()" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a0">Receiver</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor for a CANopen receiver object. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a1">Receiver</a> (<a class="el" href="classCanOpen.html">CanOpen</a> &canOpen, <a class="el" href="CML__Utils_8h.html#a10">uint32</a> id)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a new CANopen receiver. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a2">~Receiver</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor for CANopen receiver objects. <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classError.html">Error</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a3">Init</a> (<a class="el" href="classCanOpen.html">CanOpen</a> &canOpen, <a class="el" href="CML__Utils_8h.html#a10">uint32</a> id)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the CANopen receiver object. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classError.html">Error</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a4">UnInit</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Un-initialize a CANopen receiver. <a href="#a4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a5">NewFrame</a> (<a class="el" href="structCanFrame.html">CanFrame</a> &frame)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Process a new received CAN bus frame. <a href="#a5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="CML__Utils_8h.html#a10">uint32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a6">getRecvID</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Return the receive COB ID associated with this CANopen message receiver. <a href="#a6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classError.html">Error</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a7">EnableReceiver</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Enable reception of this message type. <a href="#a7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classError.html">Error</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a8">DisableReceiver</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Disable reception of this message type. <a href="#a8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCanOpen.html">CanOpen</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a9">GetCanOpen</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Return a reference to the <a class="el" href="classCanOpen.html">CanOpen</a> object associated with this receiver. <a href="#a9"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#a10">IsInitialized</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Return true if this receiver has been initialized. <a href="#a10"></a><br></td></tr><tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p0"></a><!-- doxytag: member="Receiver::co" ref="p0" args="" --><a class="el" href="classCanOpen.html">CanOpen</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#p0">co</a></td></tr><tr><td colspan="2"><br><h2>Friends</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="n0"></a><!-- doxytag: member="Receiver::CanOpen" ref="n0" args="" -->class </td><td class="memItemRight" valign="bottom"><a class="el" href="classReceiver.html#n0">CanOpen</a></td></tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a1"></a><!-- doxytag: member="Receiver::Receiver" ref="a1" args="(CanOpen &canOpen, uint32 id)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classReceiver.html">Receiver</a> </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCanOpen.html">CanOpen</a> & </td> <td class="mdname" nowrap> <em>canOpen</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="CML__Utils_8h.html#a10">uint32</a> </td> <td class="mdname" nowrap> <em>id</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Initialize a new CANopen receiver. <p>After construction, the receiver will be disabled. Call Enable() to allow messages to be received. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>canOpen</em> </td><td>Reference to the CANopen network object that this receiver is associated with. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>COB ID of the receive message</td></tr> </table></dl><p>Definition at line <a class="el" href="CanOpen_8cpp-source.html#l00323">323</a> of file <a class="el" href="CanOpen_8cpp-source.html">CanOpen.cpp</a>. </td> </tr></table><a class="anchor" name="a2"></a><!-- doxytag: member="Receiver::~Receiver" ref="a2" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">~<a class="el" href="classReceiver.html">Receiver</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destructor for CANopen receiver objects. <p>This destructor ensures that the receiver is disabled before it is destroyed.<p>Definition at line <a class="el" href="CanOpen_8cpp-source.html#l00336">336</a> of file <a class="el" href="CanOpen_8cpp-source.html">CanOpen.cpp</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a8"></a><!-- doxytag: member="Receiver::DisableReceiver" ref="a8" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">const <a class="el" href="classError.html">Error</a> * DisableReceiver </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Disable reception of this message type. <p>Any CAN frames received by the CANopen object of a disabled message type will be ignored by the CANopen object. <dl compact><dt><b>Returns:</b></dt><dd>A pointer to an error object, or NULL on success.</dd></dl><p>Definition at line <a class="el" href="CanOpen_8cpp-source.html#l00545">545</a> of file <a class="el" href="CanOpen_8cpp-source.html">CanOpen.cpp</a>. </td> </tr></table><a class="anchor" name="a7"></a><!-- doxytag: member="Receiver::EnableReceiver" ref="a7" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">const <a class="el" href="classError.html">Error</a> * EnableReceiver </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Enable reception of this message type. <p>Once enabled, any messages received over the CANopen network of this type will be passed to the Receiver using the member function NewFrame. <dl compact><dt><b>Returns:</b></dt><dd>A pointer to an error object, or NULL on success.</dd></dl><p>Definition at line <a class="el" href="CanOpen_8cpp-source.html#l00424">424</a> of file <a class="el" href="CanOpen_8cpp-source.html">CanOpen.cpp</a>. </td> </tr></table><a class="anchor" name="a9"></a><!-- doxytag: member="Receiver::GetCanOpen" ref="a9" args="(void)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classCanOpen.html">CanOpen</a>& GetCanOpen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -