OpcUaCanOpen
CANopen OPC-UA server
UserDeviceItem.h
Go to the documentation of this file.
1 #ifndef __USERDEVICEITEM_H__
2 #define __USERDEVICEITEM_H__
3 
4 #include <opcua_basedatavariabletype.h>
5 #include "CanBusAccess.h"
6 
7 #include "uaobjecttypes.h"
8 #include "UserDeviceStruct.h"
9 #include "CANOpenServerConfig.h"
10 #include "InterfaceUserDataBase.h"
11 
12 namespace UserDevice
13 {
19  {
20  public:
21 
22  UserDeviceItem(pUserDeviceStruct *parrent,::xml_schema::type *conf,UaNode *pAS,OpcUa_UInt code):
23  InterfaceUserDataBase(parrent,conf,pAS,code)
24  {
25  };
26 
27  OpcUa_BuiltInType getItemType() { return itemType; }
28 
29  virtual UaVariant UnPack() = 0; // Unpack data from device message
30  virtual UaStatus pack(const OpcUa_Variant *) = 0; // pack data to device message
31 
32  virtual UaStatus write(UaDataValue &udv) = 0; // pass data to device
33 
34  virtual UaStatus read() = 0; // read data from device
35 
36  OpcUa::BaseDataVariableType *getUaEntry()
37  {
38  return static_cast<OpcUa::BaseDataVariableType *>(getAddressSpaceEntry());
39  }
40 
41  virtual ~UserDeviceItem(void) {} ;
42 
43  protected:
44 
45  OpcUa_BuiltInType itemType; // Data type
46  };
47 }
48 #endif
49