library for C++ CANOpen implementation. mbed independant, but is easy to attach into with mbed.
Dependents: ppCANOpen_Example DISCO-F746NG_rtos_test
Node Class Reference
Node Class to implement feature of a CANOpen NMT node. More...
#include <Node.h>
Data Structures | |
struct | State |
Node network management state. More... | |
Public Member Functions | |
Node (int id, ServiceProvider *provider, int bLoop=0) | |
Maintain the multitude of states for a node. | |
void | FixedUpdate (uint32_t time) |
Call from ServiceProvider on an interrupt. | |
void | Update (void) |
Call from ServiceProvider every loop of Run() | |
int | DispatchMessage (CanOpenMessage *canOpenMsg) |
Handle message given by the ServiceProvider. | |
Data Fields | |
int | nodeId |
Network id for the node. | |
int | bLoopbackOn |
Loopback Mode. | |
Protected Member Functions | |
virtual void | OnFixedUpdate (void)=0 |
Perform actions every cycle (when in operational mode) | |
virtual void | OnSync (uint8_t counter)=0 |
Perform actions when state changed to stop. | |
virtual void | OnInitialize (void)=0 |
Perform actions when node reset. | |
virtual void | OnPreoperational (void)=0 |
Perform actions when state changed to pre-operational. | |
virtual void | OnOperational (void)=0 |
Perform actions when state changed to operational. | |
virtual void | OnStopped (void)=0 |
Perform actions when state changed to stop. | |
virtual ObjectData * | ScanIndex (IndexSize index)=0 |
Abstract method to give access to the object entries of derived classes. | |
Protected Attributes | |
ObjectData * | dictionary |
Array of ObjectData to contain all of the object dictionary data. | |
uint32_t | timeCurrentTick |
Millisecond time stamp at this OnTick() | |
uint32_t | timeSinceLastTick |
Millisecond difference between current OnTick() and the previous. | |
ServiceProvider * | pMyProvider |
Reference to Service Provider that this node is attached to. |
Detailed Description
Node Class to implement feature of a CANOpen NMT node.
Definition at line 56 of file Node.h.
Constructor & Destructor Documentation
Node | ( | int | id, |
ServiceProvider * | provider, | ||
int | bLoop = 0 |
||
) |
Member Function Documentation
int DispatchMessage | ( | CanOpenMessage * | canOpenMsg ) |
Handle message given by the ServiceProvider.
void FixedUpdate | ( | uint32_t | time ) |
Call from ServiceProvider on an interrupt.
virtual void OnFixedUpdate | ( | void | ) | [protected, pure virtual] |
Perform actions every cycle (when in operational mode)
- Note:
- Override to implement user application
- The OnTick function should avoid modifying data in the object dictionary unless necessary, because there will almost certainly be a race condition.
virtual void OnInitialize | ( | void | ) | [protected, pure virtual] |
Perform actions when node reset.
- Note:
- Override to implement user application
virtual void OnOperational | ( | void | ) | [protected, pure virtual] |
Perform actions when state changed to operational.
- Note:
- Override to implement user application
virtual void OnPreoperational | ( | void | ) | [protected, pure virtual] |
Perform actions when state changed to pre-operational.
- Note:
- Override to implement user application
virtual void OnStopped | ( | void | ) | [protected, pure virtual] |
Perform actions when state changed to stop.
- Note:
- Override to implement user application
virtual void OnSync | ( | uint8_t | counter ) | [protected, pure virtual] |
Perform actions when state changed to stop.
- Note:
- Override to implement user application
virtual ObjectData* ScanIndex | ( | IndexSize | index ) | [protected, pure virtual] |
Abstract method to give access to the object entries of derived classes.
void Update | ( | void | ) |
Call from ServiceProvider every loop of Run()
Field Documentation
int bLoopbackOn |
ObjectData* dictionary [protected] |
Array of ObjectData to contain all of the object dictionary data.
int nodeId |
ServiceProvider* pMyProvider [protected] |
uint32_t timeCurrentTick [protected] |
uint32_t timeSinceLastTick [protected] |
Generated on Sun Jul 17 2022 07:51:19 by 1.7.2