OpcUaCanOpen
CANopen OPC-UA server
CanPDOItem.h
Go to the documentation of this file.
1 #ifndef __CANPDOITEM_H__
2 #define __CANPDOITEM_H__
3 
4 //#include "CCanCallback.h"
5 #include <opcua_basedatavariabletype.h>
6 #include "Ids.h"
7 
8 #include "CanBusAccess.h"
9 
10 #include "CanOpenItem.h"
11 
12 namespace CanOpen
13 {
14  class CanPDOObject;
19  class CanPDOItem : public CanOpenItem
20  {
21  public:
28  CanPDOItem(pUserDeviceStruct *parent,PDOITEM *conf,UaNode *pAS,OpcUa_UInt32 code);
29  CanPDOItem() = default;
31  virtual UaVariant UnPack();
33  virtual UaStatus pack(const OpcUa_Variant *);
35  virtual ~CanPDOItem(void) {} ;
36 
37 // virtual void setItemValue(const CanMsgStruct *);
39  virtual void setItemValue();
41  void setIndex(OpcUa_Byte i) { m_Index = i; }
43  OpcUa_Byte getIndex() { return m_Index; }
45  OpcUa_Byte getStartByte() { return m_startByte; }
47  OpcUa_Byte getBit() { return m_numBit; }
50 
51  virtual UaStatus connectCode(OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf, UaNode *blink);
52  virtual UaVariant getPropertyValue(OpcUa_UInt32 code, ::xsd::cxx::tree::type *conf);
57  virtual UaStatus write(UaDataValue &udv);
59  virtual UaStatus read() { return OpcUa_Bad; }
60 
61  protected:
62  OpcUa_Byte m_Index;
63  OpcUa_Byte m_startByte;
64  OpcUa_Byte m_numBit;
65  };
66 }
67 #endif
68