High Performance OPC UA Server SDK  1.2.0.193
sampleclient.h
/*****************************************************************************
* *
* Copyright (c) 2006-2016 Unified Automation GmbH. All rights reserved. *
* *
* Software License Agreement ("SLA") Version 2.6 *
* *
* Unless explicitly acquired and licensed from Licensor under another *
* license, the contents of this file are subject to the Software License *
* Agreement ("SLA") Version 2.6, or subsequent versions as allowed by the *
* SLA, and You may not copy or use this file in either source code or *
* executable form, except in compliance with the terms and conditions of *
* the SLA. *
* *
* All software distributed under the SLA is provided strictly on an "AS *
* IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, *
* AND LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT *
* LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR *
* PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the SLA for specific *
* language governing rights and limitations under the SLA. *
* *
* The complete license agreement can be found here: *
* http://unifiedautomation.com/License/SLA/2.6/ *
* *
*****************************************************************************/
#ifndef CLIENT_GETTINGSTARTED_LESSON01
#define CLIENT_GETTINGSTARTED_LESSON01
#include <uaclient/uaclient.h>
enum sample_client_states {
SAMPLE_CLIENT_STATE_INITIAL, /* Start state, nothing has been done yet */
SAMPLE_CLIENT_STATE_CONNECTING, /* Client is currently trying to connect */
SAMPLE_CLIENT_STATE_CONNECTED, /* Connecting is finished */
SAMPLE_CLIENT_STATE_READING, /* Client is currently reading */
SAMPLE_CLIENT_STATE_READ_DONE, /* Reading is finished */
SAMPLE_CLIENT_STATE_BROWSING, /* Client is currently browsing */
SAMPLE_CLIENT_STATE_BROWSE_DONE, /* Browsing is finished */
SAMPLE_CLIENT_STATE_DISCONNECT, /* Client should disconnect */
SAMPLE_CLIENT_STATE_DISCONNECTING, /* Client is currently disconnecting */
SAMPLE_CLIENT_STATE_FINISHED /* All operations are finished */
};
struct sample_client {
struct ua_client client; /* Client context from the SDK */
enum sample_client_states cur_state; /* Current state of the Sample Client */
const char *url; /* Endpoint url to connect to */
int result; /* Result of the Sample Client */
};
int sample_client_init(struct sample_client *ctx, const char *url);
void sample_client_cleanup(struct sample_client *ctx);
bool sample_client_check_state(struct sample_client *ctx);
int sample_client_get_result(struct sample_client *ctx);
#endif /* include guard */