include/lss.h
changeset 529 c171e11707c5
parent 528 0a30e161d63c
child 801 32d146b64a35
equal deleted inserted replaced
528:0a30e161d63c 529:c171e11707c5
    18 You should have received a copy of the GNU Lesser General Public
    18 You should have received a copy of the GNU Lesser General Public
    19 License along with this library; if not, write to the Free Software
    19 License along with this library; if not, write to the Free Software
    20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    21 */
    21 */
    22 
    22 
    23 /** @defgroup lss Layer setting Object
    23 /** @defgroup lss Layer Setting Services Object
       
    24  * @brief LSS offers the possibility to inquire and change the settings of certain parameters of the local layers on
       
    25  * a CANopen module with LSS Slave capabilities by a CANopen module with LSS Master capabilities via the
       
    26  * CAN Network.
       
    27  * The following parameters can be inquired and/or changed by the use of LSS:
       
    28  *               - Node-ID of the CANopen Slave
       
    29  *               - Bit timing parameters of the physical layer (baud rate)
       
    30  *               - LSS address (/2/ Identity Object, Index 1018H)
    24  *  @ingroup comobj
    31  *  @ingroup comobj
    25  */
    32  */
    26 					 
    33 					 
    27 #ifndef __LSS_h__
    34 #ifndef __LSS_h__
    28 #define __LSS_h__
    35 #define __LSS_h__
   196  * dat1 and dat2: pointers to optional data (depend on command).
   203  * dat1 and dat2: pointers to optional data (depend on command).
   197  * return sendLSS(d,command,dat1,dat2)
   204  * return sendLSS(d,command,dat1,dat2)
   198  */
   205  */
   199 //UNS8 configNetworkNode(CO_Data* d, UNS8 command, void *dat1, void* dat2);
   206 //UNS8 configNetworkNode(CO_Data* d, UNS8 command, void *dat1, void* dat2);
   200 
   207 
   201 /** Used by the Master application to send a LSS command, WITH response, to the slave. 
   208 /** 
   202  * The function Callback, which must be defined in the user code, is called at the
   209  * @ingroup lss
       
   210  * @brief Used by the Master application to send a LSS command, WITH response, to the slave. 
       
   211  * @param *d Pointer on a CAN object data structure
       
   212  * @param command
       
   213  * @param *dat1
       
   214  * @param *dat2
       
   215  * @param Callback The function Callback, which must be defined in the user code, is called at the
   203  * end of the exchange (on succes or abort) and can be NULL.
   216  * end of the exchange (on succes or abort) and can be NULL.
       
   217  * @return sendLSS(d,command,dat1,dat2)
   204  * The LSS_MSG_TIMER timer is started to control the timeout
   218  * The LSS_MSG_TIMER timer is started to control the timeout
   205  * return sendLSS(d,command,dat1,dat2)
       
   206  */
   219  */
   207 UNS8 configNetworkNode (CO_Data* d, UNS8 command, void *dat1, void* dat2, LSSCallback_t Callback);
   220 UNS8 configNetworkNode (CO_Data* d, UNS8 command, void *dat1, void* dat2, LSSCallback_t Callback);
   208 
   221 
   209 /** Use this function after a configNetworkNode or configNetworkNodeCallBack to get the result.
   222 /**
   210   Returns : LSS_RESET				// Transmission not started. Init state.
   223  * @ingroup lss 
   211 			LSS_FINISHED			// data are available                           
   224  * @brief Use this function after a configNetworkNode or configNetworkNodeCallBack to get the result.
   212 			LSS_ABORTED_INTERNAL	// Aborted but not because of an abort message. 
   225  * @param *d Pointer on a CAN object data structure
   213 			LSS_TRANS_IN_PROGRESS	// Data not yet available
   226  * @param command The LSS command (unused).
   214 
   227  * @param *dat1
   215   * command: the LSS command (unused).
   228  * @param *dat2
   216   * example:
   229  * @return : 
   217   * UNS32 dat1;
   230  *          - LSS_RESET				// Transmission not started. Init state.
   218   * UNS8 dat2;
   231  *          - LSS_FINISHED			// data are available                           
   219   res=configNetworkNodeCallBack(&_Data,LSS_INQ_NODE_ID,0,0,NULL); // inquire the nodeID
   232  *          - LSS_ABORTED_INTERNAL	// Aborted but not because of an abort message. 
   220   while (getConfigResultNetworkNode (&_Data, LSS_INQ_NODE_ID, &dat1, &dat2) != LSS_TRANS_IN_PROGRESS);
   233  *          - LSS_TRANS_IN_PROGRESS	// Data not yet available
       
   234  * @code
       
   235  * example:
       
   236  * UNS32 dat1;
       
   237  * UNS8 dat2;
       
   238  * res=configNetworkNodeCallBack(&_Data,LSS_INQ_NODE_ID,0,0,NULL); // inquire the nodeID
       
   239  * while (getConfigResultNetworkNode (&_Data, LSS_INQ_NODE_ID, &dat1, &dat2) != LSS_TRANS_IN_PROGRESS);
       
   240  * @endcode
   221 */
   241 */
   222 UNS8 getConfigResultNetworkNode (CO_Data* d, UNS8 command, UNS32* dat1, UNS8* dat2);
   242 UNS8 getConfigResultNetworkNode (CO_Data* d, UNS8 command, UNS32* dat1, UNS8* dat2);
   223 
   243 
   224 #endif
   244 #endif