OpcUaCanOpen
CANopen OPC-UA server
CanOpen::CanObject Class Reference

This class collects the basic properties and function of the can bus and can node. More...

#include <CanObject.h>

Inherits UserDevice::InterfaceUserDataBase.

Inherited by CanOpen::CanBusObject, CanOpen::CanNodeObject, CanOpen::Emergency, and CanOpen::PROGRAMitem.

Public Member Functions

 CanObject (pUserDeviceStruct *parent,::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt32 code)
 Constructor. More...
 
virtual ~CanObject (void)
 Destructor. More...
 
OpcUa_Byte getCanNodeId ()
 get Node Id More...
 
void sendNMT (enum ::NMTcommand nmt)
 Send nmt message. More...
 
virtual void setInitNmt (enum NMTcommand iNMT)
 Save initial nmt message which will send to initialize devices. More...
 
virtual void setInitNmt (std::string sNmt)
 Save initial nmt message which will send to initialize devices. More...
 
virtual void sendInitNmt ()
 send initial nmt message More...
 
CCanAccessgetCanBusInterface ()
 get pointer to can bus interface More...
 
void setCanBusInterface (CCanAccess *ccac)
 save pointer to can bus interface More...
 
IOManager * getIOManager ()
 
- Public Member Functions inherited from UserDevice::InterfaceUserDataBase
 InterfaceUserDataBase (pUserDeviceStruct *parent,::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt code)
 Constructor Also create the shared mutex which can be used to synchronize operation on device using lock/unlock function. More...
 
virtual ~InterfaceUserDataBase (void)
 Destructor. More...
 
virtual UaStatus getDeviceMessage (OpcUa_UInt32 code)=0
 read data defined of function code from device Abstract function to take can messages based on type id (buldingAutomationTypeIds.h) More...
 
virtual UaStatus sendDeviceMessage (OpcUa_UInt32 code, UaDataValue *value=0)=0
 send data or command on device Abstract function to send data based on type id (buldingAutomationTypeIds.h) More...
 
virtual UaStatus connectCode (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf, UaNode *node)=0
 Connect UaVariable with function code. More...
 
virtual UaVariant getPropertyValue (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf)=0
 
- Public Member Functions inherited from UserDevice::UserDeviceStruct
 UserDeviceStruct (pUserDeviceStruct *parent, ::xsd::cxx::tree::type *conf, UaNode *pAS, OpcUa_UInt code)
 constructor More...
 
void lock ()
 lock shared mutex to protect More...
 
void unlock ()
 unlock shared mutex More...
 
::UaMutexRefCounted * getShareMutex ()
 get mutex More...
 
void releaseMutex ()
 
OpcUa_Int32 countMutex ()
 
virtual ~UserDeviceStruct (void)
 
OpcUa_UInt getCodeFunction ()
 
UserDeviceStructgetParentDevice ()
 
pUserDeviceStructgetTopInterface ()
 
pUserDeviceStructgetParent ()
 
virtual void setInvalid ()
 
UaNode * getAddressSpaceEntry ()
 

Protected Attributes

CCanAccessm_pCommIf
 Address of can interface. More...
 
OpcUa_Byte m_CanNodeId
 Node Id for bus = 0. More...
 
enum NMTcommand m_initNMTcommand
 initial NMT commands More...
 
IOManager * m_pIOManager
 
- Protected Attributes inherited from UserDevice::UserDeviceStruct
UaMutexRefCounted * m_pSharedMutex
 

Private Member Functions

 UA_DISABLE_COPY (CanObject)
 

Detailed Description

This class collects the basic properties and function of the can bus and can node.

The class defines several function to send nmt messages to can node. Each node has unique identifier node id. To send nmt message to all nodes on the bus node id = 0 is used.

Definition at line 23 of file CanObject.h.

Constructor & Destructor Documentation

◆ CanObject()

CanOpen::CanObject::CanObject ( pUserDeviceStruct parent,
::xsd::cxx::tree::type *  conf,
UaNode *  pAS,
OpcUa_UInt32  code 
)
inline

Constructor.

Parameters
parentpointer to parent object usually null for CanBusObject
confXML configuration entry
pASpointer to Ua Node
codefunction code of can object

Definition at line 34 of file CanObject.h.

◆ ~CanObject()

virtual CanOpen::CanObject::~CanObject ( void  )
inlinevirtual

Destructor.

Definition at line 43 of file CanObject.h.

Member Function Documentation

◆ getCanBusInterface()

CCanAccess* CanOpen::CanObject::getCanBusInterface ( )
inline

get pointer to can bus interface

Returns
pointer to can bus interface

Definition at line 98 of file CanObject.h.

◆ getCanNodeId()

OpcUa_Byte CanOpen::CanObject::getCanNodeId ( )
inline

get Node Id

Returns
node id

Definition at line 54 of file CanObject.h.

◆ getIOManager()

IOManager* CanOpen::CanObject::getIOManager ( )
inline

Definition at line 105 of file CanObject.h.

◆ sendInitNmt()

virtual void CanOpen::CanObject::sendInitNmt ( )
inlinevirtual

send initial nmt message

Definition at line 91 of file CanObject.h.

◆ sendNMT()

void CanOpen::CanObject::sendNMT ( enum ::NMTcommand  nmt)
inline

Send nmt message.

Parameters
nmtcan be (ignore, start, stop,preOperational, reset)

Definition at line 61 of file CanObject.h.

◆ setCanBusInterface()

void CanOpen::CanObject::setCanBusInterface ( CCanAccess ccac)
inline

save pointer to can bus interface

Parameters
ccacpointer to can bus interface

Definition at line 103 of file CanObject.h.

◆ setInitNmt() [1/2]

virtual void CanOpen::CanObject::setInitNmt ( enum NMTcommand  iNMT)
inlinevirtual

Save initial nmt message which will send to initialize devices.

Parameters
iNMTcan be (ignore, start, stop,preOperational, reset)

Definition at line 72 of file CanObject.h.

◆ setInitNmt() [2/2]

virtual void CanOpen::CanObject::setInitNmt ( std::string  sNmt)
inlinevirtual

Save initial nmt message which will send to initialize devices.

Parameters
sNmtmust be string ( "start", stop","preOperational", "reset" or empty)

Definition at line 80 of file CanObject.h.

◆ UA_DISABLE_COPY()

CanOpen::CanObject::UA_DISABLE_COPY ( CanObject  )
private

Member Data Documentation

◆ m_CanNodeId

OpcUa_Byte CanOpen::CanObject::m_CanNodeId
protected

Node Id for bus = 0.

Definition at line 111 of file CanObject.h.

◆ m_initNMTcommand

enum NMTcommand CanOpen::CanObject::m_initNMTcommand
protected

initial NMT commands

Definition at line 113 of file CanObject.h.

◆ m_pCommIf

CCanAccess* CanOpen::CanObject::m_pCommIf
protected

Address of can interface.

Definition at line 109 of file CanObject.h.

◆ m_pIOManager

IOManager* CanOpen::CanObject::m_pIOManager
protected

Definition at line 114 of file CanObject.h.


The documentation for this class was generated from the following file: