Commit 208e8111 authored by claes's avatar claes

New opc module

parent cd3e9542
/*
* Proview $Id: opc_provider.cpp,v 1.1 2007-03-01 09:12:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include <vector.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "wb_vext.h"
#include "rt_procom.h"
#include "opc_provider.h"
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "opc_soap_H.h"
#include "Service.nsmap"
#define START_OIX 1000
static pwr_tVid opc_vid;
static char opc_vname[32];
static char opc_endpoint[256];
// Wb only
void opc_provider::object( co_procom *pcom)
{
if ( m_list.size() <= 1 || m_list[0].fchoix == 0) {
pcom->provideObject( LDH__NOSUCHOBJ,0,0,0,0,0,0,0,"","");
return;
}
objectOid( pcom, m_list[0].fchoix);
}
void opc_provider::objectOid( co_procom *pcom, pwr_tOix oix)
{
if ( m_list.size() == 0) {
// Load Rootlist
_ns1__Browse browse;
_ns1__BrowseResponse browse_response;
std::string s("dataType");
browse.PropertyNames.push_back( s);
if ( soap_call___ns1__Browse( &soap, opc_endpoint, NULL, &browse, &browse_response) ==
SOAP_OK) {
for ( int i = 0; i < (int)browse_response.Elements.size(); i++) {
procom_obj o;
strcpy( o.name, browse_response.Elements[i]->Name->c_str());
strcpy( o.lname, o.name);
o.oix = next_oix++;
if ( i != 0)
o.bwsoix = o.oix - 1;
if ( i != (int)browse_response.Elements.size() - 1)
o.fwsoix = o.oix + 1;
if ( browse_response.Elements[i]->HasChildren)
o.flags |= procom_obj_mFlags_Loaded;
else
o.flags |= procom_obj_mFlags_Loaded;
m_list.push_back( o);
}
}
else
soap_print_fault( &soap, stderr);
}
if ( oix >= m_list.size() || oix < 0) {
pcom->provideStatus( GDH__NOSUCHOBJ);
return;
}
pcom->provideObjects( GDH__SUCCESS, m_list);
}
void opc_provider::objectName( co_procom *pcom, char *name)
{
for ( int i = 0; i < (int) m_list.size(); i++) {
if ( !m_list[i].flags & procom_obj_mFlags_Deleted) {
if ( cdh_NoCaseStrcmp( name, longname(m_list[i].oix)) == 0) {
objectOid( pcom, i);
return;
}
}
}
if ( m_env == pvd_eEnv_Wb)
pcom->provideObject( 0,0,0,0,0,0,0,0,"","");
else
pcom->provideStatus( GDH__NOSUCHOBJ);
}
// Wb only
void opc_provider::objectBody( co_procom *pcom, pwr_tOix oix)
{
}
// Wb only
void opc_provider::createObject( co_procom *pcom, pwr_tOix destoix, int desttype,
pwr_tCid cid, char *name)
{
}
// Wb only
void opc_provider::moveObject( co_procom *pcom, pwr_tOix oix, pwr_tOix destoix,
int desttype)
{
}
// Wb only
void opc_provider::deleteObject( co_procom *pcom, pwr_tOix oix)
{
}
// Wb only
void opc_provider::copyObject( co_procom *pcom, pwr_tOix oix, pwr_tOix destoix, int desttype,
char *name)
{
}
// Wb only
void opc_provider::deleteFamily( co_procom *pcom, pwr_tOix oix)
{
}
// Wb only
void opc_provider::renameObject( co_procom *pcom, pwr_tOix oix, char *name)
{
}
void opc_provider::writeAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size, char *buffer)
{
if ( oix >= m_list.size() || oix <= 0) {
pcom->provideStatus( LDH__NOSUCHOBJ);
return;
}
if ( offset + size > m_list[oix].body_size) {
pcom->provideStatus( LDH__NOSUCHATTR);
return;
}
memcpy( (void *)((unsigned long)m_list[oix].body + (unsigned long)offset), buffer, size);
pcom->provideStatus( 1);
}
// Rt only
void opc_provider::readAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size)
{
if ( oix >= m_list.size() || oix <= 0) {
pcom->provideStatus( GDH__NOSUCHOBJ);
return;
}
if ( offset + size > m_list[oix].body_size) {
pcom->provideStatus( GDH__NOSUCHOBJ);
return;
}
void *p = (void *)((unsigned long)m_list[oix].body + (unsigned long)offset);
pcom->provideAttr( GDH__SUCCESS, oix, size, p);
}
// Rt only
void opc_provider::subAssociateBuffer( co_procom *pcom, void **buff, int oix, int offset,
int size, pwr_tSubid sid)
{
if ( oix < (int)m_list.size())
*buff = (char *)m_list[oix].body + offset;
else
*buff = 0;
}
// Wb only
void opc_provider::commit( co_procom *pcom)
{
pwr_tStatus sts;
save( &sts);
pcom->provideStatus( sts);
}
// Wb only
void opc_provider::abort( co_procom *pcom)
{
pwr_tStatus sts;
m_list.clear();
next_oix = 1;
load( &sts);
pcom->provideStatus( sts);
}
void opc_provider::delete_tree( pwr_tOix oix)
{
m_list[oix].flags = procom_obj_mFlags_Deleted;
for ( pwr_tOix ix = m_list[oix].fchoix;
ix;
ix = m_list[ix].fwsoix)
delete_tree( ix);
}
char *opc_provider::longname( pwr_tOix oix)
{
if ( m_list[oix].fthoix == 0)
strcpy( m_list[oix].lname, m_list[oix].name);
else {
strcpy( m_list[oix].lname, longname( m_list[oix].fthoix));
strcat( m_list[oix].lname, "-");
strcat( m_list[oix].lname, m_list[oix].name);
}
return m_list[oix].lname;
}
bool opc_provider::find( pwr_tOix fthoix, char *name, pwr_tOix *oix)
{
for ( int i = 0; i < (int) m_list.size(); i++) {
if ( !m_list[i].flags & procom_obj_mFlags_Deleted) {
if ( m_list[i].fthoix == fthoix &&
cdh_NoCaseStrcmp( name, m_list[i].name) == 0) {
*oix = m_list[i].oix;
return true;
}
}
}
return false;
}
void usage()
{
cout << "remote_pvd_pwrcli Proview provider client" << endl << endl <<
"Arguments: " << endl <<
" 1 Opc server URL" << endl <<
" 2 Extern volume id" << endl <<
" 3 Extern volume name" << endl <<
" 4 Server identity (optional, default 200)" << endl;
}
int main(int argc, char *argv[])
{
pwr_tStatus sts;
char server_url[256];
char extern_vid[40];
char extern_volume_name[40];
int server_id;
/* Read arguments */
if ( argc < 4) {
usage();
strcpy( server_url, "http://localhost:18083");
strcpy( extern_vid, "0.1.99.55");
strcpy( extern_volume_name, "MyOpcVolume");
// exit(0);
}
else {
strcpy( server_url, argv[1]);
strcpy( extern_vid, argv[2]);
strcpy( extern_volume_name, argv[3]);
}
if ( argc >= 5) {
sts = sscanf( argv[4], "%d", &server_id);
if ( sts != 1) {
usage();
exit(0);
}
}
else
server_id = 200;
strcpy( opc_endpoint, server_url);
cdh_StringToVolumeId( extern_vid, &opc_vid);
strcpy( opc_vname, extern_volume_name);
opc_provider provider( pvd_eEnv_Rt);
rt_procom procom( &provider,
errh_eAnix_appl20, // Application index
"opc_provider", // Process name
server_id, // Sid
opc_vid, // Vid
opc_vname, // Volume name
0); // Global
procom.init();
// provider.nodeUp();
soap_init( &provider.soap);
procom.mainLoop();
}
/*
* Proview $Id: opc_provider.h,v 1.1 2007-03-01 09:12:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef opc_provider_h
#define opc_provider_h
#include "co_provider.h"
#include "co_procom.h"
#include "opc_soap_H.h"
class opc_provider : public co_provider {
public:
opc_provider( pvd_eEnv env = pvd_eEnv_Wb) : co_provider(env), root(0), next_oix(1) {}
virtual void object( co_procom *pcom);
virtual void objectOid( co_procom *pcom, pwr_tOix oix);
virtual void objectName( co_procom *pcom, char *name);
virtual void objectBody( co_procom *pcom, pwr_tOix oix);
virtual void createObject( co_procom *pcom, pwr_tOix destoix, int desttype,
pwr_tCid cid, char *name);
virtual void moveObject( co_procom *pcom, pwr_tOix oix, pwr_tOix destoix, int desttype);
virtual void copyObject( co_procom *pcom, pwr_tOix oix, pwr_tOix destoix, int desttype,
char *name);
virtual void deleteObject( co_procom *pcom, pwr_tOix oix);
virtual void deleteFamily( co_procom *pcom, pwr_tOix oix);
virtual void renameObject( co_procom *pcom, pwr_tOix oix, char *name);
virtual void writeAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size, char *buffer);
virtual void readAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size);
virtual void subAssociateBuffer( co_procom *pcom, void **buff, int oix, int offset,
int size, pwr_tSubid sid);
virtual void commit( co_procom *pcom);
virtual void abort( co_procom *pcom);
virtual char *longname( pwr_tOix oix);
virtual void delete_tree( pwr_tOix oix);
virtual void save( pwr_tStatus *sts) {}
virtual void load( pwr_tStatus *rsts) {}
virtual bool find( pwr_tOix fthoix, char *name, pwr_tOix *oix);
vector<procom_obj> m_list;
pwr_tOix root;
pwr_tOix next_oix;
struct soap soap;
};
#endif
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) -lpwr_opc -lpwr_rt -lpwr_co -lpwr_msg_dummy
endif
/*
* Proview $Id: opc_server.cpp,v 1.1 2007-03-01 09:12:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pwr.h"
#include "pwr_version.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "opc_utl.h"
#include "opc_soap_H.h"
#include "Service.nsmap"
int main()
{
struct soap soap;
int m,s; // Master and slave sockets
pwr_tStatus sts;
sts = gdh_Init("opc_server");
if ( EVEN(sts)) {
exit(sts);
}
soap_init( &soap);
m = soap_bind( &soap, NULL, 18083, 100);
if ( m < 0)
soap_print_fault( &soap, stderr);
else {
fprintf( stderr, "Socket connection successfull: master socket = %d\n", m);
for ( int i = 1;; i++) {
s = soap_accept( &soap);
if ( s < 0) {
soap_print_fault( &soap, stderr);
break;
}
fprintf( stderr, "%d: accepted connection from IP=%lu.%lu.%lu.%lu socket=%d", i,
(soap.ip>>24)&0xFF,(soap.ip>>16)&0xFF,(soap.ip>>8)&0xFF,soap.ip&0xFF, s);
if ( soap_serve( &soap) != SOAP_OK) // Process RPC request
soap_print_fault( &soap, stderr);
fprintf( stderr, "Request served\n");
soap_destroy( &soap); // Clean up class instances
soap_end( &soap); // Clean up everything and close socket
}
}
soap_done( &soap); // Close master socket and detach environment
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__GetStatus(struct soap*,
_ns1__GetStatus *ns1__GetStatus,
_ns1__GetStatusResponse *ns1__GetStatusResponse)
{
pwr_tTime current_time;
clock_gettime( CLOCK_REALTIME, &current_time);
ns1__GetStatusResponse->GetStatusResult = new ns1__ReplyBase();
ns1__GetStatusResponse->GetStatusResult->RcvTime = current_time.tv_sec;
ns1__GetStatusResponse->GetStatusResult->ReplyTime = current_time.tv_sec;
ns1__GetStatusResponse->GetStatusResult->RevisedLocaleID = new std::string( "en");
ns1__GetStatusResponse->GetStatusResult->ServerState = ns1__serverState__running;
ns1__GetStatusResponse->GetStatusResult->ClientRequestHandle = ns1__GetStatus->ClientRequestHandle;
ns1__GetStatusResponse->Status = new ns1__ServerStatus();
ns1__GetStatusResponse->Status->VendorInfo = new std::string("Proview " pwrv_cPwrVersionStr);
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Read(struct soap*,
_ns1__Read *ns1__Read,
_ns1__ReadResponse *ns1__ReadResponse)
{
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Write(struct soap*,
_ns1__Write *ns1__Write,
_ns1__WriteResponse *ns1__WriteResponse)
{
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Subscribe(struct soap*,
_ns1__Subscribe *ns1__Subscribe,
_ns1__SubscribeResponse *ns1__SubscribeResponse)
{
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__SubscriptionPolledRefresh(struct soap*,
_ns1__SubscriptionPolledRefresh *ns1__SubscriptionPolledRefresh,
_ns1__SubscriptionPolledRefreshResponse *ns1__SubscriptionPolledRefreshResponse)
{
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__SubscriptionCancel(struct soap*,
_ns1__SubscriptionCancel *ns1__SubscriptionCancel,
_ns1__SubscriptionCancelResponse *ns1__SubscriptionCancelResponse)
{
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Browse(struct soap*, _ns1__Browse *ns1__Browse,
_ns1__BrowseResponse *ns1__BrowseResponse)
{
pwr_tStatus sts;
pwr_tOid oid, child, ch;
pwr_tOName name;
pwr_tCid cid;
if ( (!ns1__Browse->ItemName || ns1__Browse->ItemName->empty()) &&
(!ns1__Browse->ItemPath || ns1__Browse->ItemPath->empty())) {
// Return rootlist
for ( sts = gdh_GetRootList( &oid); ODD(sts); sts = gdh_GetNextSibling( oid, &oid)) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_object);
if ( EVEN(sts)) continue;
sts = gdh_GetObjectClass( oid, &cid);
if ( EVEN(sts)) continue;
ns1__BrowseElement *element = new ns1__BrowseElement();
element->Name = new std::string( name);
element->ItemName = element->Name;
element->IsItem = ( cid == pwr_eClass_PlantHier || cid == pwr_eClass_NodeHier) ? true : false;
element->HasChildren = ODD( gdh_GetChild( oid, &ch)) ? true : false;
ns1__BrowseResponse->Elements.push_back( element);
for ( int i = 0; i < (int)ns1__Browse->PropertyNames.size(); i++) {
ns1__ItemProperty *property = new ns1__ItemProperty();
property->Name = ns1__Browse->PropertyNames[i];
if ( property->Name == "\"\":dataType") {
property->Value = (char *) malloc( 6);
strcpy( property->Value, "float");
}
element->Properties.push_back( property);
}
}
}
else {
// Return attributes and children
pwr_tOName itemname;
if ( ns1__Browse->ItemPath && !ns1__Browse->ItemPath->empty()) {
strncpy( itemname, ns1__Browse->ItemPath->c_str(), sizeof( itemname));
if ( ns1__Browse->ItemName && !ns1__Browse->ItemName->empty()) {
strcat( itemname, "-");
strcat( itemname, ns1__Browse->ItemName->c_str());
}
}
else
strncpy( itemname, ns1__Browse->ItemName->c_str(), sizeof(itemname));
sts = gdh_NameToObjid( itemname, &oid);
if ( EVEN(sts)) {
return 0;
}
for ( sts = gdh_GetChild( oid, &child); ODD(sts); sts = gdh_GetNextSibling( child, &child)) {
sts = gdh_ObjidToName( child, name, sizeof(name), cdh_mName_object);
if ( EVEN(sts)) continue;
sts = gdh_GetObjectClass( child, &cid);
if ( EVEN(sts)) continue;
ns1__BrowseElement *element = new ns1__BrowseElement();
element->Name = new std::string( name);
element->ItemName = element->Name;
element->ItemPath = new std::string( itemname);
element->IsItem = ( cid == pwr_eClass_PlantHier || cid == pwr_eClass_NodeHier) ? true : false;
element->HasChildren = ODD( gdh_GetChild( child, &ch)) ? true : false;
ns1__BrowseResponse->Elements.push_back( element);
}
}
return 0;
}
SOAP_FMAC5 int SOAP_FMAC6 __ns1__GetProperties(struct soap*,
_ns1__GetProperties *ns1__GetProperties,
_ns1__GetPropertiesResponse *ns1__GetPropertiesResponse)
{
return 0;
}
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) -lpwr_opc -lpwr_rt -lpwr_co -lpwr_msg_dummy
endif
#include "opc_soap_H.h"
SOAP_NMAC struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"ns1", "http://opcfoundation.org/webservices/XMLDA/1.0/", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* opc_soap_ServiceObject.h
Generated by gSOAP 2.7.9d from opc_msg.h
Copyright(C) 2000-2006, Robert van Engelen, Genivia Inc. All Rights Reserved.
This part of the software is released under one of the following licenses:
GPL, the gSOAP public license, or Genivia's license for commercial use.
*/
#ifndef opc_soap_Service_H
#define opc_soap_Service_H
#include "opc_soap_H.h"
/******************************************************************************\
* *
* Service Object *
* *
\******************************************************************************/
class Service : public soap
{ public:
Service()
{ static const struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"ns1", "http://opcfoundation.org/webservices/XMLDA/1.0/", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
soap_init(this); if (!this->namespaces) this->namespaces = namespaces; };
virtual ~Service() { soap_destroy(this); soap_end(this); soap_done(this); };
virtual int bind(const char *host, int port, int backlog) { return soap_bind(this, host, port, backlog); };
virtual int accept() { return soap_accept(this); };
virtual int serve() { return soap_serve(this); };
};
/******************************************************************************\
* *
* Service Operations (you should define these) *
* *
\******************************************************************************/
SOAP_FMAC5 int SOAP_FMAC6 __ns1__GetStatus(struct soap*, _ns1__GetStatus *ns1__GetStatus, _ns1__GetStatusResponse *ns1__GetStatusResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Read(struct soap*, _ns1__Read *ns1__Read, _ns1__ReadResponse *ns1__ReadResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Write(struct soap*, _ns1__Write *ns1__Write, _ns1__WriteResponse *ns1__WriteResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Subscribe(struct soap*, _ns1__Subscribe *ns1__Subscribe, _ns1__SubscribeResponse *ns1__SubscribeResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__SubscriptionPolledRefresh(struct soap*, _ns1__SubscriptionPolledRefresh *ns1__SubscriptionPolledRefresh, _ns1__SubscriptionPolledRefreshResponse *ns1__SubscriptionPolledRefreshResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__SubscriptionCancel(struct soap*, _ns1__SubscriptionCancel *ns1__SubscriptionCancel, _ns1__SubscriptionCancelResponse *ns1__SubscriptionCancelResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__Browse(struct soap*, _ns1__Browse *ns1__Browse, _ns1__BrowseResponse *ns1__BrowseResponse);
SOAP_FMAC5 int SOAP_FMAC6 __ns1__GetProperties(struct soap*, _ns1__GetProperties *ns1__GetProperties, _ns1__GetPropertiesResponse *ns1__GetPropertiesResponse);
#endif
/* opc_soap_ServiceProxy.h
Generated by gSOAP 2.7.9d from opc_msg.h
Copyright(C) 2000-2006, Robert van Engelen, Genivia Inc. All Rights Reserved.
This part of the software is released under one of the following licenses:
GPL, the gSOAP public license, or Genivia's license for commercial use.
*/
#ifndef opc_soap_Service_H
#define opc_soap_Service_H
#include "opc_soap_H.h"
class Service
{ public:
struct soap *soap;
const char *endpoint;
Service()
{ soap = soap_new(); endpoint = "http://localhost:80"; if (soap && !soap->namespaces) { static const struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"ns1", "http://opcfoundation.org/webservices/XMLDA/1.0/", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
soap->namespaces = namespaces; } };
virtual ~Service() { if (soap) { soap_destroy(soap); soap_end(soap); soap_free(soap); } };
virtual int __ns1__GetStatus(_ns1__GetStatus *ns1__GetStatus, _ns1__GetStatusResponse *ns1__GetStatusResponse) { return soap ? soap_call___ns1__GetStatus(soap, endpoint, NULL, ns1__GetStatus, ns1__GetStatusResponse) : SOAP_EOM; };
virtual int __ns1__Read(_ns1__Read *ns1__Read, _ns1__ReadResponse *ns1__ReadResponse) { return soap ? soap_call___ns1__Read(soap, endpoint, NULL, ns1__Read, ns1__ReadResponse) : SOAP_EOM; };
virtual int __ns1__Write(_ns1__Write *ns1__Write, _ns1__WriteResponse *ns1__WriteResponse) { return soap ? soap_call___ns1__Write(soap, endpoint, NULL, ns1__Write, ns1__WriteResponse) : SOAP_EOM; };
virtual int __ns1__Subscribe(_ns1__Subscribe *ns1__Subscribe, _ns1__SubscribeResponse *ns1__SubscribeResponse) { return soap ? soap_call___ns1__Subscribe(soap, endpoint, NULL, ns1__Subscribe, ns1__SubscribeResponse) : SOAP_EOM; };
virtual int __ns1__SubscriptionPolledRefresh(_ns1__SubscriptionPolledRefresh *ns1__SubscriptionPolledRefresh, _ns1__SubscriptionPolledRefreshResponse *ns1__SubscriptionPolledRefreshResponse) { return soap ? soap_call___ns1__SubscriptionPolledRefresh(soap, endpoint, NULL, ns1__SubscriptionPolledRefresh, ns1__SubscriptionPolledRefreshResponse) : SOAP_EOM; };
virtual int __ns1__SubscriptionCancel(_ns1__SubscriptionCancel *ns1__SubscriptionCancel, _ns1__SubscriptionCancelResponse *ns1__SubscriptionCancelResponse) { return soap ? soap_call___ns1__SubscriptionCancel(soap, endpoint, NULL, ns1__SubscriptionCancel, ns1__SubscriptionCancelResponse) : SOAP_EOM; };
virtual int __ns1__Browse(_ns1__Browse *ns1__Browse, _ns1__BrowseResponse *ns1__BrowseResponse) { return soap ? soap_call___ns1__Browse(soap, endpoint, NULL, ns1__Browse, ns1__BrowseResponse) : SOAP_EOM; };
virtual int __ns1__GetProperties(_ns1__GetProperties *ns1__GetProperties, _ns1__GetPropertiesResponse *ns1__GetPropertiesResponse) { return soap ? soap_call___ns1__GetProperties(soap, endpoint, NULL, ns1__GetProperties, ns1__GetPropertiesResponse) : SOAP_EOM; };
};
#endif
This diff is collapsed.
/*
* Proview $Id: opc_utl.cpp,v 1.1 2007-03-01 09:12:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pwr.h"
#include "opc_utl.h"
/*
* Proview $Id: opc_utl.h,v 1.1 2007-03-01 09:12:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pwr.h"
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
export_cpp = $(bld_dir)/stdsoap2.o
export_h = $(inc_dir)/stdsoap2.h $(inc_dir)/Service.nsmap
lib : $(export_lib) export_lib_local
export_lib_local : $(export_cpp) $(export_h)
@ $(ar) -r $(export_lib) $(export_cpp)
$(bld_dir)/stdsoap2.o : ../../stdsoap2.cpp
$(inc_dir)/stdsoap2.h : ../../stdsoap2.h
$(inc_dir)/Service.nsmap : ../../Service.nsmap
@ echo "Export $(source)"
@ $(cp) $(cpflags) $(source) $(target)
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment