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

class CanSDOObject ensures the SDO operation on the bus More...

#include <CanSDOObject.h>

Inherits CanOpen::CanOpenObject.

Public Member Functions

 CanSDOObject (pUserDeviceStruct *par, SDO *conf, UaNode *blink, int code)
 
virtual ~CanSDOObject (void)
 
virtual UaStatus getDeviceMessage (OpcUa_UInt32 code)
 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)
 send data or command on device Abstract function to send data based on type id (buldingAutomationTypeIds.h) More...
 
virtual void pass (const CanMsgStruct *)
 SDO callback function to put sdo message to buffer. 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)
 
virtual bool isMsgForObject (const CanMsgStruct *)
 Check id this message for this object. More...
 
virtual UaStatus readSdo (UaDataValue &)
 
virtual UaStatus writeSdo (UaDataValue &udv)
 
OpcUa_BuiltInType getItemType ()
 
UaDateTime & getLastTimeStamp ()
 
OpcUa_Byte getSubIndex ()
 
OpcUa_UInt16 getIndex ()
 
void setIndex (OpcUa_UInt16 ind)
 
CanSDOItemgetSDOItem ()
 
void setSDOItem (CanSDOItem *csdo)
 
void freeSDOItem ()
 
void setTimeout (OpcUa_UInt32 t)
 
- Public Member Functions inherited from CanOpen::CanOpenObject
 CanOpenObject (pUserDeviceStruct *parent,::xml_schema::type *conf, UaNode *blink, int code)
 This class defines operations for canopen protocol. More...
 
virtual ~CanOpenObject (void)
 Destructor. More...
 
CCanAccessgetCanBus ()
 
const char * getBusName ()
 
OpcUa_UInt16 getCobId ()
 
DirectionType getDirectionType ()
 
UaStatus waitOperation (OpcUa_UInt timeout)
 
UaStatus waitOperation ()
 
virtual void messageCame ()
 
virtual UaStatus releaseOperation ()
 
virtual UaStatus signalOperation ()
 
- 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...
 
- 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 ()
 

Public Attributes

OpcUa_UInt32 m_iLength
 
UaByteArray m_segSdoBuffer
 
- Public Attributes inherited from CanOpen::CanOpenObject
UaByteArray m_buffer
 
UaDateTime m_udt
 

Private Attributes

CanSDOItemm_pSDOItem
 
OpcUa_UInt16 m_ind
 

Additional Inherited Members

- Protected Attributes inherited from CanOpen::CanOpenObject
OpcUa_UInt32 m_iTimeout
 
UaSemaphore m_waitMessage
 
OpcUa_UInt16 m_cobId
 
DirectionType m_direction
 
OpcUa_UInt32 m_iMaxCount
 
OpcUa_UInt32 m_iCount
 
- Protected Attributes inherited from UserDevice::UserDeviceStruct
UaMutexRefCounted * m_pSharedMutex
 

Detailed Description

class CanSDOObject ensures the SDO operation on the bus

Definition at line 17 of file CanSDOObject.h.

Constructor & Destructor Documentation

◆ CanSDOObject()

CanOpen::CanSDOObject::CanSDOObject ( pUserDeviceStruct par,
SDO conf,
UaNode *  blink,
int  code 
)

Definition at line 24 of file CanSDOObject.cpp.

◆ ~CanSDOObject()

CanOpen::CanSDOObject::~CanSDOObject ( void  )
virtual

Definition at line 90 of file CanSDOObject.cpp.

Member Function Documentation

◆ connectCode()

UaStatus CanOpen::CanSDOObject::connectCode ( OpcUa_UInt32  code,
::xsd::cxx::tree::type *  conf,
UaNode *  blink 
)
virtual

connect function code to ua node to pass data

Parameters
codefunction code defines the operation
confXML object containing the configuration information for this object
blinkua node to pass data

Implements UserDevice::InterfaceUserDataBase.

Definition at line 132 of file CanSDOObject.cpp.

◆ freeSDOItem()

void CanOpen::CanSDOObject::freeSDOItem ( )

Definition at line 449 of file CanSDOObject.cpp.

◆ getDeviceMessage()

UaStatus CanOpen::CanSDOObject::getDeviceMessage ( OpcUa_UInt32  code)
virtual

read data defined of function code from device Abstract function to take can messages based on type id (buldingAutomationTypeIds.h)

Parameters
codefunction code defining of operation (send command ,data or read data)

Implements UserDevice::InterfaceUserDataBase.

Definition at line 104 of file CanSDOObject.cpp.

◆ getIndex()

OpcUa_UInt16 CanOpen::CanSDOObject::getIndex ( )
inline

Definition at line 48 of file CanSDOObject.h.

◆ getItemType()

OpcUa_BuiltInType CanOpen::CanSDOObject::getItemType ( )

Definition at line 38 of file CanSDOObject.cpp.

◆ getLastTimeStamp()

UaDateTime& CanOpen::CanSDOObject::getLastTimeStamp ( )
inline

Definition at line 46 of file CanSDOObject.h.

◆ getPropertyValue()

UaVariant CanOpen::CanSDOObject::getPropertyValue ( OpcUa_UInt32  code,
::xsd::cxx::tree::type *  conf 
)
virtual

Implements UserDevice::InterfaceUserDataBase.

Definition at line 158 of file CanSDOObject.cpp.

◆ getSDOItem()

CanSDOItem* CanOpen::CanSDOObject::getSDOItem ( )
inline

Definition at line 50 of file CanSDOObject.h.

◆ getSubIndex()

OpcUa_Byte CanOpen::CanSDOObject::getSubIndex ( )

Definition at line 43 of file CanSDOObject.cpp.

◆ isMsgForObject()

bool CanOpen::CanSDOObject::isMsgForObject ( const CanMsgStruct cms)
virtual

Check id this message for this object.

Reimplemented from CanOpen::CanOpenObject.

Definition at line 97 of file CanSDOObject.cpp.

◆ pass()

void CanOpen::CanSDOObject::pass ( const CanMsgStruct cms)
virtual

SDO callback function to put sdo message to buffer.

Implements CanOpen::CanOpenObject.

Definition at line 78 of file CanSDOObject.cpp.

◆ readSdo()

UaStatus CanOpen::CanSDOObject::readSdo ( UaDataValue &  udv)
virtual

create CAN message for initial request

Definition at line 174 of file CanSDOObject.cpp.

◆ sendDeviceMessage()

UaStatus CanOpen::CanSDOObject::sendDeviceMessage ( OpcUa_UInt32  code,
UaDataValue *  value = 0 
)
virtual

send data or command on device Abstract function to send data based on type id (buldingAutomationTypeIds.h)

Parameters
codefunction code
valuedata to send

Implements UserDevice::InterfaceUserDataBase.

Definition at line 118 of file CanSDOObject.cpp.

◆ setIndex()

void CanOpen::CanSDOObject::setIndex ( OpcUa_UInt16  ind)
inline

Definition at line 49 of file CanSDOObject.h.

◆ setSDOItem()

void CanOpen::CanSDOObject::setSDOItem ( CanSDOItem csdo)

Definition at line 444 of file CanSDOObject.cpp.

◆ setTimeout()

void CanOpen::CanSDOObject::setTimeout ( OpcUa_UInt32  t)
inline

Definition at line 55 of file CanSDOObject.h.

◆ writeSdo()

UaStatus CanOpen::CanSDOObject::writeSdo ( UaDataValue &  udv)
virtual

Definition at line 313 of file CanSDOObject.cpp.

Member Data Documentation

◆ m_iLength

OpcUa_UInt32 CanOpen::CanSDOObject::m_iLength

Definition at line 51 of file CanSDOObject.h.

◆ m_ind

OpcUa_UInt16 CanOpen::CanSDOObject::m_ind
private

Definition at line 59 of file CanSDOObject.h.

◆ m_pSDOItem

CanSDOItem* CanOpen::CanSDOObject::m_pSDOItem
private

Definition at line 58 of file CanSDOObject.h.

◆ m_segSdoBuffer

UaByteArray CanOpen::CanSDOObject::m_segSdoBuffer

Definition at line 52 of file CanSDOObject.h.


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