OpcUaCanOpen
CANopen OPC-UA server
|
This class comprises all properties and functions to control Can bus This class has the implementation of two main abstract function from CanObject getDeviceMasage and sendDeviceMessage. More...
#include <CanBusObject.h>
Inherits CanOpen::CanObject.
Public Member Functions | |
CanBusObject (pUserDeviceStruct *interf, CANBUS *ca, UaNode *link, int code) | |
Constructor. More... | |
virtual | ~CanBusObject (void) |
Destructor. More... | |
virtual void | setPortError (const int err, const char *errmsg, timeval &tv) |
Callback function to set bus error. More... | |
virtual UaStatus | getDeviceMessage (OpcUa_UInt32 code) |
this function is dummy for CanBusObject. There is no any readable data More... | |
void | openCanBus () |
open can bus More... | |
void | closeCanBus () |
close can bus More... | |
virtual UaStatus | sendDeviceMessage (OpcUa_UInt32 code, UaDataValue *value=0) |
send message to canbus More... | |
void | sendSync () |
send sync message More... | |
virtual UaStatus | connectCode (OpcUa_UInt32 code,::xsd::cxx::tree::type *conf, UaNode *blink) |
connect function code to ua node to pass data More... | |
virtual UaVariant | getPropertyValue (OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf) |
CCanUACallback * | getCanUACallback () |
get main can bus callback function More... | |
void | addPDO (CanPDOObject *pdoo) |
Add pdo object. More... | |
busNodes & | getListNodes () |
void | addNode (CanNodeObject *pnode) |
add Can node to the bus More... | |
void | sendInitNodeNmt () |
send nmt message after startup More... | |
void | initialize () |
initialize the bus. send RTR after startup More... | |
void | startSyncInterval () |
start sync interval thread to send sync message More... | |
void | startNodeGuardingInterval () |
start nodeGuarding interval thread to send NG messages More... | |
string & | getCanBusName () |
string & | getCanBusAddress () |
void | waitData () |
![]() | |
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... | |
CCanAccess * | getCanBusInterface () |
get pointer to can bus interface More... | |
void | setCanBusInterface (CCanAccess *ccac) |
save pointer to can bus interface More... | |
IOManager * | getIOManager () |
![]() | |
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... | |
![]() | |
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 () |
UserDeviceStruct * | getParentDevice () |
pUserDeviceStruct * | getTopInterface () |
pUserDeviceStruct * | getParent () |
virtual void | setInvalid () |
UaNode * | getAddressSpaceEntry () |
Private Member Functions | |
UA_DISABLE_COPY (CanBusObject) | |
Private Attributes | |
CCanUACallback * | m_pCallback |
wait initial data after startup More... | |
SyncInterval * | m_pSyncIn |
Call back class to take data from can bus. More... | |
NodeGuardingInterval * | m_pNgIn |
Sync interval thread object. More... | |
OpcUa::BaseVariableType * | m_iPortError |
Node Guarding thread object. More... | |
OpcUa::BaseVariableType * | m_sPortErrorDescription |
Can Bus error reading from driver. More... | |
string | m_sBusName |
Description of the port error. More... | |
string | m_sBusParameters |
bus name More... | |
string | m_sBusAddress |
buss parameters More... | |
Additional Inherited Members | |
![]() | |
CCanAccess * | m_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 |
![]() | |
UaMutexRefCounted * | m_pSharedMutex |
This class comprises all properties and functions to control Can bus This class has the implementation of two main abstract function from CanObject getDeviceMasage and sendDeviceMessage.
Definition at line 27 of file CanBusObject.h.
CanOpen::CanBusObject::CanBusObject | ( | pUserDeviceStruct * | interf, |
CANBUS * | ca, | ||
UaNode * | link, | ||
int | code | ||
) |
Constructor.
interf | pointer to parent object usually null for CanBusObject |
ca | XML configuration entry |
link | pointer to Ua Node |
code | code of function |
Definition at line 11 of file CanBusObject.cpp.
|
virtual |
Destructor.
Definition at line 71 of file CanBusObject.cpp.
|
inline |
|
inline |
Add pdo object.
pdoo | pointer to CanPDOObject |
Definition at line 92 of file CanBusObject.h.
void CanOpen::CanBusObject::closeCanBus | ( | void | ) |
close can bus
Definition at line 41 of file CanBusObject.cpp.
|
virtual |
connect function code to ua node to pass data
code | function code defines the operation |
conf | XML object containing the configuration information for this object |
blink | ua node to pass data |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 148 of file CanBusObject.cpp.
|
inline |
Definition at line 117 of file CanBusObject.h.
|
inline |
Definition at line 116 of file CanBusObject.h.
|
inline |
get main can bus callback function
Definition at line 87 of file CanBusObject.h.
|
inlinevirtual |
this function is dummy for CanBusObject. There is no any readable data
Implements UserDevice::InterfaceUserDataBase.
Definition at line 52 of file CanBusObject.h.
|
inline |
Definition at line 96 of file CanBusObject.h.
|
virtual |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 238 of file CanBusObject.cpp.
void CanOpen::CanBusObject::initialize | ( | ) |
initialize the bus. send RTR after startup
Definition at line 22 of file CanBusObject.cpp.
void CanOpen::CanBusObject::openCanBus | ( | void | ) |
open can bus
Definition at line 27 of file CanBusObject.cpp.
|
virtual |
send message to canbus
code | code of function |
value | data to send |
Implements UserDevice::InterfaceUserDataBase.
Definition at line 96 of file CanBusObject.cpp.
|
inline |
send nmt message after startup
Definition at line 106 of file CanBusObject.h.
|
inline |
send sync message
Definition at line 71 of file CanBusObject.h.
|
virtual |
Callback function to set bus error.
err | error code |
errmsg | error message |
tv | timestamps |
Definition at line 258 of file CanBusObject.cpp.
|
inline |
start nodeGuarding interval thread to send NG messages
Definition at line 114 of file CanBusObject.h.
|
inline |
start sync interval thread to send sync message
Definition at line 111 of file CanBusObject.h.
|
private |
void CanOpen::CanBusObject::waitData | ( | ) |
Definition at line 278 of file CanBusObject.cpp.
|
private |
Node Guarding thread object.
Definition at line 128 of file CanBusObject.h.
|
private |
wait initial data after startup
Definition at line 123 of file CanBusObject.h.
|
private |
Sync interval thread object.
Definition at line 126 of file CanBusObject.h.
|
private |
Call back class to take data from can bus.
Definition at line 125 of file CanBusObject.h.
|
private |
buss parameters
Definition at line 133 of file CanBusObject.h.
|
private |
Description of the port error.
Definition at line 131 of file CanBusObject.h.
|
private |
bus name
Definition at line 132 of file CanBusObject.h.
|
private |
Can Bus error reading from driver.
Definition at line 129 of file CanBusObject.h.