User Tools

Site Tools


classes_vscpremotetcpipif_metods

Table of Contents

Methods in the VscpRemoteTcpIf class

This is a description of the public methods of the VscpRemoteTcpIf class.



General methods

setResponseTimeout

    void setResponseTimeout(uint32_t to);

Set response timeout value in milliseconds. Default is 1000 milliseconds.

to

Timeout value in milliseconds.

setAfterCommandSleep

    void setAfterCommandSleep(uint16_t to);

Set after command sleep time (milliseconds). Default is 0 milliseconds as it is normally not needed but can be on a system that is very slow to respond to commands.

to

Sleep value in milliseconds.

setRegisterOperationTiming

    void setRegisterOperationTiming(uint8_t retries, uint32_t resendto, uint32_t errorto);

Set register read/write timings

retries

Number of allowed resend retries before giving up a register read.

resendto

Resend timeout in milliseconds.

erroto

Error timeout in milliseconds before giving up a read register operation.

isConnected

    bool isConnected(void);

Check if connected to remote VSCP server.

Return value

Returns true if we are connected, false otherwise.

checkReturnValue

    bool checkReturnValue(bool bClear = false);

Check the response from the remote VSCP server and look for an error or a correctly carried out command.

bClear

If set to true the input queue array will be cleared before the call.

Return value

True is returned if a positive response (+OK) s received from the remote VSCP server, false otherwise which can be the result of a negative reply or a timeout.

doClrInputQueue

    void doClrInputQueue(void);

Clear the input queue

doCommand

    int doCommand(wxString& cmd);

Send a command to the remote VSCP server. Allows to send any command.

cmd

A VSCP remote server command that is terminated with <CR><LF> (“\r\n”).

Return Value

Returns VSCP_ERROR_SUCCESS if the command could be sent successfully and a positive response (+OK) is received. If not an error code will be returned.

doCmdOpen

    int doCmdOpen(const wxString& strInterface = (_("")), uint32_t flags = 0L);

Open communication interface.

strInterface

Should be set to “username;password;ip-addr;port” if used. All values including port is optional and defaults to no username/password, server as “localhost” and port as “9598”

flags

Currently not used.

Return Value

VSCP_ERROR_SUCCESS is returned if the connection to the remote VSCP server could be established. If not an error code will be returned.

doCmdOpen

    int doCmdOpen(const wxString& strHostname,
                    const wxString& strUsername,
                    const wxString& strPassword);

Open communication interface.

strHostname

Host to connect to.

strUsername

Username for VSCP remote server account.

strPassword

Password for VSCP remote server account.

Return Value

VSCP_ERROR_SUCCESS is returned if the connection to the remote VSCP server could be established. If not an error code will be returned.

doCmdClose

    int doCmdClose(void);

Close connection to remote VSCP server.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdNOOP

    int doCmdNOOP(void);

Send the NOOP (no operation) command to the VSCP remote server. This command only returns a positive response and can be used to test if a connection works.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdClear

    int doCmdClear(void);

Clear input queue on the remote VSCP server.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdGetLevel

    unsigned long doCmdGetLevel(void);

Get the CANAL protocol level. Mainly used by the CANAL/VSCP combined subsystem.

Return Value

Return the constant VSCP_LEVEL2.

doCmdSend

    int doCmdSend(const vscpEvent *pEvent);

Send a VSCP Level II event to the VSCP remote server.

pEvent

Pointer to VSCP Level II event to send. If the event have a GUID all set to zero the GUID of the VSCP remote server interface (“-”) will be used.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdSendEx

    int doCmdSendEx(const vscpEventEx *pEventEx);

Send a VSCP Level II event ex to the VSCP remote server.

A vscpEvent structure contains a pointer to the data part of the event, while the vscpEventEx have the max data storage allocated in every event and therefore waste a lot of memory that can be used in a better way.

pEventEx

Pointer to VSCP Level II event ex to send. If the event have a GUID all set to zero the GUID of the VSCP remote server interface (“-”) will be used.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdSendLevel1

    int doCmdSendLevel1(const canalMsg *pMsg);

Send a Level I event to the VSCP remote server. The GUID of the interface will be used for the resulting VSCP event.

pMsg

A pointer to a CANAL message.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdReceive

    int doCmdReceive(vscpEvent *pEvent);
pEvent

Pointer to VSCP event that will receive the event from the remote VSCP server queue if the call is successful.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdReceiveEx

    int doCmdReceiveEx(vscpEventEx *pEventEx);
pEventEx

Pointer to VSCP event ex that will receive the event ex from the remote VSCP server queue if the call is successful.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdReceiveLevel1

    int doCmdReceiveLevel1(canalMsg *pCanalMsg);

Receive an VSCP Level I event from the VSCP remote server queue. The low eight bits of the CAN id is fetched from GUID[15], that is from the LSB of the GUID.

pCanalMsg

Pointer to a CANAL message that will receive the vent from the remote VSCP server queue if the call is successful.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdEnterReceiveLoop

    int doCmdEnterReceiveLoop(void);

This command sets an open interface in the receive loop (RCVLOOP) state. It does nothing other then putting the interface in the loop mode and checking that it went there.

Note! The only way to terminate this receive loop is to close the session with doCmdClose (or just close the socket) or send the doQuitLoop command below.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdEnterReceiveLoop

    int doCmdQuitReceiveLoop(void);

Quit the receive loop.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdBlockingReceive

    int doCmdBlockingReceive(vscpEvent *pEvent, uint32_t timeout = 500);

Receive an event from the remote VSCP server. The receiveloop command must have been issued for this method to work as.

pEvent

Pointer to a VSCP event that will receive the received event on success.

timeout

Timeout in milliseconds to wait for data. Default is 500 milliseconds.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure. CANAL_ERROR_FIFO_EMPTY is returned if no event was available. CANAL_ERROR_TIMEOUT on timeout. CANAL_ERROR_COMMUNICATION is returned if a socket error is detected.

doCmdBlockingReceive

    int doCmdBlockingReceive(vscpEventEx *pEventEx, uint32_t timeout = 500);

Receive an event ex from the remote VSCP server. The receiveloop command must have been issued for this method to work as.

pEventEx

Pointer to a VSCP event ex that will receive the received event on success.

timeout

Timeout in milliseconds to wait for data. Default is 500 milliseconds.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure. CANAL_ERROR_FIFO_EMPTY is returned if no event was available. CANAL_ERROR_TIMEOUT on timeout. CANAL_ERROR_COMMUNICATION is returned if a socket error is detected.

doCmdDataAvailable

    int doCmdDataAvailable(void);

Get the number of events in the input queue of this interface

Return value

Return the number of events available in the queue at the remote VSCP server or if a failure occur a negative error code is returned.

doCmdStatus

    int doCmdStatus(canalStatus *pStatus);

Receive the CANAL status structure from the remote VSCP server.

pStatus

Pointer to canalStatus structure that will get the VSCP remote server status.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdStatus

    int doCmdStatus(VSCPStatus *pStatus);

Receive the VSCP status structure from the remote VSCP server.

pStatus

Pointer to VSCPStatus structure that will get the VSCP remote server status.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdStatistics

    int doCmdStatistics(canalStatistics *pStatistics);

Get the CANAL statistics structure from the VSCP remote server.

pStatistics

Pointer to canalStatistics structure that will get the VSCP remote server statistics.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdStatistics

    int doCmdStatistics(VSCPStatistics *pStatistics);

Get the VSCP statistics structure from the VSCP remote server.

pStatistics

Pointer to VSCPStatistics structure that will get the VSCP remote server statistics.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdFilter

    int doCmdFilter(const vscpEventFilter *pFilter);

Set the receive filter on the remote VSCP server. By setting the filter on can select which events one want to receive. It is possible to open several channels ans have a filter on each for complex setups.

pFilter

Pointer to VSCP filter structure to set.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdFilter

    int doCmdFilter(const wxString& filter, const wxString& mask);

Set the receive filter on the remote VSCP server. By setting the filter on can select which events one want to receive. It is possible to open several channels ans have a filter on each for complex setups.

filter

Filter to set on string form (“priority,class,type,guid”).

mask

Mask to set on string form (“priority,class,type,guid”).

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdFilter

    int doCmdVersion(uint8_t *pMajorVer,
                     uint8_t *pMinorVer,
                     uint8_t *pSubMinorVer);

Get the interface version from the remote VSCP server.

pMajorVer

Major version of VSCP remote server interface.

pMinorVer

Minor version of VSCP remote server interface.

pSubMinorVer

Sub version of VSCP remote server interface.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdDLLVersion

    unsigned long doCmdDLLVersion(void);

Get DL/DLL version. This is intended for CANAL.

Return Value

DL/DLL version. A negative error code is returned on failure.

doCmdVendorString

    const char *doCmdVendorString(void);

Get the vendor (maker of DL/DLL) string. This is intended for CANAL.

Return Value

A pointer to a null terminated string containing vendor information is returned. On failure a NULL pointer is returned.

doCmdGetDriverInfo

    const char *doCmdGetDriverInfo(void);

Get the driver information string from the remote VSCP server. This is intended for CANAL.

Return Value

A pointer to a null terminated string containing driver information on XML format is returned. On failure a NULL pointer is returned.

doCmdGetGUID

    int doCmdGetGUID(char *pGUID);

Get GUID for the remote VSCP server interface.

pGUID

Pointer to a 16-byte array that will get the GUID. MSB is in the first byte.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdGetGUID

    int doCmdGetGUID(cguid& ifguid);

Get GUID for the remote VSCP server interface.

ifguid

Reference to the GUID that will get the information.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdSetGUID

    int doCmdSetGUID(const char *pGUID);

Set GUID for the remote VSCP server interface.

pGUID

Pointer to a 16-byte array that contain the new GUID. MSB is in the first byte.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdSetGUID

    int doCmdSetGUID(cguid &ifGUID);

Set GUID for the remote VSCP server interface.

ifGUID

Reference to GUID that contain the new GUID.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdGetChannelInfo

    int doCmdGetChannelInfo(VSCPChannelInfo *pChannelInfo);

Get information about the remote VSCP server interface channel.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdGetChannelInfo

    int doCmdGetChannelID(uint32_t *pChannelID);

Get Channel ID for the remote VSCP server interface channel.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdInterfaceList

    int doCmdInterfaceList(wxArrayString& arrayIf );

Get available interfaces on the VSCP remote server.

arrayIf

An array that will be filled with interface descriptions of interfaces available on the remote VSCP server.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

doCmdSetBaudrate

    int doCmdSetBaudrate(uint32_t baudrate);

Dummy for required CANAL method.

baudrate

CANAL baudrate.

Return Value

Always return CANAL_ERROR_SUCCESS.

doCmdFilter

    int doCmdFilter(uint32_t filter);

Dummy for required CANAL method.

filter

CANAL 32-bit filter.

Return Value

Always return CANAL_ERROR_SUCCESS.

doCmdMask

    int doCmdMask(uint32_t mask);

Dummy for required CANAL method.

mask

CANAL 32-bit mask.

Return Value

Always return CANAL_ERROR_SUCCESS.

doCmdShutDown

    int doCmdShutDown(void);

Shutdown the remote VSCP server. Needless to say you need high privileges on the server to perform this command.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

Remote variable handling methods

getRemoteVariableList

    int getRemoteVariableList( wxArrayString& arrayVars, 
                                    const wxString regexp = _(""),
                                    const int type = 0 );

Get a list of defined variables on remote VSCP server.

arrayVars

A reference to a string array that Will be filed with names of VSCP remote variables.

regexp

Regular expression used to select variables. Leave blank to return all variables.

type

Variable type that should be listed or 0 for all variable types.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

saveRemoteVariablesToDisk

    int saveRemoteVariablesToDisk( const wxString& path, 
                                        const int select=0, 
                                        const wxString& regExp=_("") );

Save (selected) variables to external disk space in XML format.

path

Path, including file name, to save variables to.

select

Select if persistent, non-persistent or both types of variables should be written out to the file.

* 1 for only writing persistent variables. * 2 only write non-persistent variables. * 3 or 0 for writing both types.

regExp

Optional regular expression that selects which variables to write. Default is all.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

loadRemoteVariablesFromDisk

    int loadRemoteVariablesFromDisk( const wxString& path );
path

Path to load the remote variable XML file from.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

createRemoteVariable

    int createRemoteVariable( const wxString& name, 
                                const wxString& strType,
                                const bool bPersistent,
                                const wxString& strUser,
                                const uint32_t rights,
                                const wxString& strValue,
                                const wxString& strNote = _("") );

Create a new remote variable

name

Name of remote variable to create. A user variable can not have a name that start with “vscp.”.

strType

Type of variable either in string or numeric form.

bPersistet

True if the variable should be persistent (default=false)

strUser

Owner of variable. Can be left empty in which case the logged in user will be set as owner.

rights

Access rights for variable.

strValue

Value for the remote variable.

strNote

Optional note for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

deleteRemoteVariable

    int deleteRemoteVariable( const wxString& name );
name

Name of remote variable to delete.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariable

    int getRemoteVariable( const wxString& name, wxString& strVariable );

Get remote variable (full info).

Format is:

"variable name";"type";"persistence";"user";"rights";"value";"note"
name

Name of remote variable to get information for.

strVariable

String that will get variable information.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableLastChange

    int getRemoteVariableLastChange( const wxString& name, wxDateTime& lastChange );

Get last change date/time for a remote variable.

name

Name of remote variable to get information for.

lastChange

Date/time when variable last was changed.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableType

    int getRemoteVariableType( const wxString& name, wxString& strType );

Get type on string form for a remote variable.

name

Name of remote variable to get information for.

strType

Will get the variable type for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableType

    int getRemoteVariableType( const wxString& name, uint8_t *pType );

Get type on numeric form for a remote variable.

name

Name of remote variable to get information for.

pType

Pointer to uint8_t that will get the variable type for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariablePersistence

    int getRemoteVariablePersistence( const wxString& name, bool *pPersistent );

Get persistence for a remote variable.

name

Name of remote variable to get information for.

pPersistent

Pointer to bool that will get the persistence for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableOwner

    int getRemoteVariableOwner( const wxString& name, uint32_t *pOwner );

Get owner for a remote variable.

name

Name of remote variable to get information for.

strOwner

Reference to string that will get the owner for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableAccessRights

    int getRemoteVariableAccessRights( const wxString& name, uint16_t *pRights );

Get access rights for a remote variable.

name

Name of remote variable to get information for.

pRights

Pointer to an uint16_t that will get the rights for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableValue

    int getRemoteVariableValue( const wxString& name, wxString& strValue );

Get value on string form for a remote variable.

name

Name of remote variable to get information for.

strValue

Reference to string that will get the value on string form for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableValue

    int setRemoteVariableValue( const wxString& name, wxString& strValue );

Set the value for a remote variable from a string.

name

Name of remote variable to get information for.

strValue

Reference to string that hold the value on string form that the remote variable will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableNote

    int getRemoteVariableNote( const wxString& name, wxString& strNote );

Get note for remote variable.

name

Name of remote variable to get information for.

strNote

Reference to string that will get the note for the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableAsString

    int getRemoteVariableAsString( const wxString& name, wxString& strVariable );

Get a remote variables value on string form.

name

Name of remote variable to get information for.

strVariable

Reference to string that will get the value for the remote variable on string form.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableFromString

    int setRemoteVariableFromString( const wxString& name, 
                                        const wxString& strValue,
                                        const bool bPersistent = false,
                                        const uint32_t rights = 0x744 );

Set a remote variable value from its string form.

name

Name of remote variable to get information for.

strValue

Reference to string with value to set the remote variable to on string form.

bPersistent

True if the variable should be persistent.

rights

Access rights for the variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableBool

    int getRemoteVariableBool( const wxString& name, bool *bValue);

Get remote variable value for boolean variable.

name

Name of remote variable to get value for.

bValue

Pointer to boolean value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableBool

    int setRemoteVariableBool( const wxString& name, const bool bValue);

Set variable value for boolean remote variable.

name

Name of remote variable to set value for.

bValue

Boolean value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableInt

    int getRemoteVariableInt( const wxString& name, int *value);

Get remote variable value for integer variable.

name

Name of remote variable to get value for.

value

Pointer to integer value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableInt

    int setRemoteVariableInt( const wxString& name, int value);

Set variable value for integer remote variable.

name

Name of remote variable to set value for.

value

Integer value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableLong

    int getRemoteVariableLong( const wxString& name, long *value);

Get remote variable value for long variable.

name

Name of remote variable to get value for.

value

Pointer to long value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableLong

    int setRemoteVariableLong( const wxString& name, long value);

Set variable value for long remote variable.

name

Name of remote variable to set value for.

value

Long value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableDouble

    int getRemoteVariableDouble( const wxString& name, double *value);

Get remote variable value for double variable.

name

Name of remote variable to get value for.

value

Pointer to double value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableDouble

    int setRemoteVariableDouble( const wxString& name, double value);

Set variable value for double remote variable.

name

Name of remote variable to set value for.

value

Double value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableMeasurement

    int getRemoteVariableMeasurement( const wxString& name, 
                                        double *pvalue,
                                        uint8_t *punit,
                                        uint8_t *psensoridx,
                                        uint8_t *pzone,
                                        uint8_t *psubzone );

Get remote variable value for measurement variable.

name

Name of remote variable to set value for.

pvalue

Pointer to a double that will get the value of the measurement.

punit

Pointer to uint8_t that will get the unit of the measurement.

psensoridx

Pointer to uint8_t that will get the sensor index of the measurement.

pzone

Pointer to a uint8_t that will get the zone of the measurement.

psubzone

Pointer to a unit8_t that will get the sub zone of the measurement.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableMeasurement

    int setRemoteVariableMeasurement( const wxString& name, 
                                        double value,
                                        uint8_t unit = 0,
                                        uint8_t sensoridx = 0,
                                        uint8_t zone = 255,
                                        uint8_t subzone = 255 );

Set remote measurement variable value.

name

Name of remote variable to set value for.

value

Double containing the value for the measurement.

unit

The unit for the measurement.

sensoridx

The sensor index for the measurement.

zone

The zone for the measurement.

subzone

The sub zone for the measurement.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableEvent

    int getRemoteVariableEvent( const wxString& name, vscpEvent *pEvent);

Set variable value for VSCP event remote variable.

name

Name of remote variable to set value for.

value

Pointer to VSCP event value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableEvent

    int setRemoteVariableEvent( const wxString& name, vscpEvent *pEvent);

Set remote variable value for VSCP event variable.

name

Name of remote variable to set value for.

value

Pointer to VSCP event value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableEventEx

    int getRemoteVariableEventEx( const wxString& name, vscpEventEx *pEventEx);

Set variable value for VSCP event ex remote variable.

name

Name of remote variable to set value for.

pEventEx

Pointer to VSCP event ex value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableEventEx

    int setRemoteVariableEventEx( const wxString& name, vscpEventEx *pEventEx);

Set remote variable value for VSCP event ex variable.

name

Name of remote variable to set value for.

pEventEx

Pointer to VSCP event ex value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableEventEx

    int getRemoteVariableGUID( const wxString& name, cguid& guid );

Get remote variable value for GUID variable.

name

Name of remote variable to set value for.

guid

Reference to GUID value that the remote variables will be set to.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableGUID

    int setRemoteVariableGUID( const wxString& name, cguid& guid);

Set remote variable value for VSCP guid variable.

name

Name of remote variable to set value for.

guid

Reference to guid value that will be set to the remote variables value.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableVSCPdata

    int getRemoteVariableVSCPdata( const wxString& name, 
                                        uint8_t *psizeData, 
                                        uint16_t *pData);

Get remote variable value from VSCP data variable.

name

Name of remote variable to set value for.

psizeData

Pointer to unsigned char that will get the size of the data array.

pData

Pointer to VSCP data array variable (unsigned char [487] ) that get the value of the remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableVSCPdata

    int setRemoteVariableVSCPdata( const wxString& name, uint8_t *pData, uint16_t size);

set remote variable value for VSCP data.

name

Name of remote variable to set value for.

sizeData

Size of VSCP data.

pData

Pointer to VSCP data array to set data from.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableVSCPclass

    int getRemoteVariableVSCPclass( const wxString& name, uint16_t *vscp_class);

Get remote variable value from VSCP class variable.

name

Name of remote variable to set value for.

vscp_class

Pointer to uint16_t that get the value of the VSCP class variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableVSCPclass

    int setRemoteVariableVSCPclass( const wxString& name, uint16_t vscp_class);

Set remote variable value from VSCP class.

name

Name of remote variable to set value for.

vscp_class

VSCP class to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableVSCPtype

    int getRemoteVariableVSCPtype( const wxString& name, uint16_t *vscp_type);

Get remote variable value from VSCP type variable.

name

Name of remote variable to set value for.

vscp_type

Pointer to uint16_t that get the value of the VSCP type variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableVSCPtype

    int setRemoteVariableVSCPtype( const wxString& name, uint16_t vscp_type);

Set remote variable value from VSCP type.

name

Name of remote variable to set value for.

vscp_type

VSCP type to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableVSCPTimestamp

    int getRemoteVariableVSCPTimestamp( const wxString& name, uint32_t *vscp_timestamp);

Get remote variable value from VSCP timestamp variable.

name

Name of remote variable to set value for.

vscp_timestamp

Pointer to uint32_t that get the value of the VSCP timestamp variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableVSCPTimestamp

    int setRemoteVariableVSCPTimestamp( const wxString& name, uint32_t vscp_timestamp);

Set remote variable value from VSCP timestamp.

name

Name of remote variable to set value for.

vscp_timestamp

VSCP timestamp to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableDateTime

    int getRemoteVariableDateTime( const wxString& name, wxDateTime& datetime );

Get remote variable value from VSCP datetime variable.

name

Name of remote variable to set value for.

datetime

Pointer to date wxDateTime class that get the value of the VSCP datetime variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableDateTime

    int setRemoteVariableDateTime( const wxString& name, wxDateTime& datetime );

Set remote variable value from VSCP datetime.

name

Name of remote variable to set value for.

datetime

VSCP datetime to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableDate

    int getRemoteVariableDate( const wxString& name, wxDateTime& date );

Get remote variable value from VSCP date variable.

name

Name of remote variable to set value for.

date

Pointer to date wxDateTime class that get the value of the VSCP date variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableDate

    int setRemoteVariableDate( const wxString& name, wxDateTime& date );

Set remote variable value from VSCP date.

name

Name of remote variable to set value for.

date

VSCP date to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableTime

    int getRemoteVariableTime( const wxString& name, wxDateTime& time );

Get remote variable value from VSCP time variable.

name

Name of remote variable to set value for.

time

Pointer to date wxDateTime class that get the value of the VSCP time variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableTime

    int setRemoteVariableTime( const wxString& name, wxDateTime& time );

Set remote variable value from VSCP time.

name

Name of remote variable to set value for.

time

VSCP time to write to remote variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableBlob

    int getRemoteVariableBlob( const wxString& name, wxString& blob );

Get remote variable value from a base64 ENCODED blob variable.

name

Name of remote variable to set value for.

blob

Reference to blob that get the value of the BASE64 encoded blob variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableBlob

    int setRemoteVariableBlob( const wxString& name, wxString& blob );

Set remote variable from BASE64 encoded blob.

name

Name of remote variable to set value for.

blob

Reference to BASE64 encoded blob to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableMIME

    int getRemoteVariableMIME( const wxString& name, wxString& mime );

Get remote variable value from a base64 ENCODED MIME variable.

name

Name of remote variable to set value for.

mime

Reference MIME data that get the value of the BASE64 encoded MIME variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableMIME

    int setRemoteVariableMIME( const wxString& name, wxString& mime );

Set remote variable value from BASE64 encoded MIME data.

name

Name of remote variable to set value for.

mime

Reference to BASE64 encoded MIME data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableHTML

    int getRemoteVariableHTML( const wxString& name, wxString& html );

Get remote variable value from a base64 ENCODED HTML variable.

name

Name of remote variable to set value for.

html

Reference to HTML data that get the value of the BASE64 encoded HTML variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableHTML

    int setRemoteVariableHTML( const wxString& name, wxString& html );

Set remote variable value from BASE64 encoded HTML data.

name

Name of remote variable to set value for.

html

Reference to BASE64 encoded HTML data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableJavaScript

    int getRemoteVariableJavaScript( const wxString& name, wxString& js );

Get remote variable value from a base64 ENCODED JavaScript variable.

name

Name of remote variable to set value for.

js

Reference to JavaScript data that get the value of the BASE64 encoded JavaScript variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableJavaScript

    int setRemoteVariableJavaScript( const wxString& name, wxString& js ); 

Set remote variable value from BASE64 encoded JavaScript data.

name

Name of remote variable to set value for.

js

Reference to BASE64 encoded JavaScript data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableLUA

    int getRemoteVariableLUA( const wxString& name, wxString& lua );

Get remote variable value from a base64 ENCODED LUA variable.

name

Name of remote variable to set value for.

lua

Reference to LUA data that get the value of the BASE64 encoded LUA variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableLUA

    int setRemoteVariableLUA( const wxString& name, wxString& lua ); 

Set remote variable value from BASE64 encoded LUA data.

name

Name of remote variable to set value for.

lua

Reference to BASE64 encoded LUA data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableLUARES

    int getRemoteVariableLUARES( const wxString& name, wxString& luares );

Get remote variable value from a base64 ENCODED LUARES variable.

name

Name of remote variable to set value for.

luares

Reference to LUARES data that get the value of the BASE64 encoded LUARES variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableLUARES

    int setRemoteVariableLUARES( const wxString& name, wxString& luares ); 

Set remote variable value from BASE64 encoded LUARES data.

name

Name of remote variable to set value for.

luares

Reference to BASE64 encoded LUARES data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableUX1

    int getRemoteVariableUX1( const wxString& name, wxString& ux1 );

Get remote variable value from a base64 ENCODED UX1 variable.

name

Name of remote variable to set value for.

ux1

Reference to UX1 data that get the value of the BASE64 encoded UX1 variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableUX1

    int setRemoteVariableUX1( const wxString& name, wxString& ux1 ); 

Set remote variable value from BASE64 encoded UX1 data.

name

Name of remote variable to set value for.

ux1

Reference to BASE64 encoded UX1 data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableDMROW

    int getRemoteVariableDMROQ( const wxString& name, wxString& dmrow );

Get remote variable value from a base64 ENCODED DM row variable.

name

Name of remote variable to set value for.

dmrow

Reference to DM row data that get the value of the BASE64 encoded DM row variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableDMROW

    int setRemoteVariableDMROW( const wxString& name, wxString& dmrow ); 

Set remote variable value from BASE64 encoded DM row data.

name

Name of remote variable to set value for.

dmrow

Reference to BASE64 encoded DM row data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableDriver

    int getRemoteVariableDriver( const wxString& name, wxString& drv );

Get remote variable value from a base64 ENCODED driver variable.

name

Name of remote variable to set value for.

drv

Reference to driver data that get the value of the BASE64 encoded driver variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableDriver

    int setRemoteVariableDriver( const wxString& name, wxString& drv ); 

Set remote variable value from BASE64 encoded driver data.

name

Name of remote variable to set value for.

drv

Reference to BASE64 encoded driver data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableUser

    int getRemoteVariableUser( const wxString& name, wxString& user );

Get remote variable value from a base64 ENCODED user variable.

name

Name of remote variable to set value for.

user

Reference to user data that get the value of the BASE64 encoded user variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableUser

    int setRemoteVariableUser( const wxString& name, wxString& user ); 

Set remote variable value from BASE64 encoded user data.

name

Name of remote variable to set value for.

user

Reference to BASE64 encoded user data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getRemoteVariableFilter

    int getRemoteVariableFilter( const wxString& name, wxString& filter );

Get remote variable value from a base64 ENCODED filter variable.

name

Name of remote variable to set value for.

filter

Reference to filter data that get the value of the BASE64 encoded filter variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

setRemoteVariableFilter

    int setRemoteVariableFilter( const wxString& name, wxString& filter ); 

Set remote variable value from BASE64 encoded filter data.

name

Name of remote variable to set value for.

filter

Reference to BASE64 encoded filter data to write to variable.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

Table handling methods

tableCreate

    int tableCreate( const wxString& defTable ); 

Create table from XML data.

defTable

XML definition of table.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableDelete

    int tableDelete( const wxString &tblName, bool bDeleteFile=false ); 

Delete named table.

tblName

Name of an existing table.

bDeleteFile

If true the database file also should be deleted. If not it will be reused if a table with the same name is created later.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableList

    int tableList( wxArrayString &tablesArray );

Get a list of all defined tables.

tablesArray

List that will get filled with table names.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableListInfo

    int tableListInfo( const wxString &tblName, wxString &tableInfo, bool bXML = true ); 

Delete named table.

tblName

Name of an existing table.

tableInfo

Parameter that will get the information about the table.

bXML

If true info will be returnd as BASE64 encoded XML data.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGet

    int tableGet( const wxString& tblName, 
                                const wxDateTime& from, 
                                const wxDateTime& to,
                                wxArrayString& resultArray,
                                bool bFull = false  ); 

Get data from a named table in a range to-from. One can fetch all columns of the table (bFull) or just datetime and value (default).

tblName

Name of an existing table.

from

Datetime from which data should be fetched. Should be given on ISO 8601 format YY-MM-DDTHH:MM:SS.

to

Datetime up to which data is fetched. Should be given on ISO 8601 format YY-MM-DDTHH:MM:SS.

resultArray

String array that is filled with resulting rows (if any) from the table. The format is

'count' rows<CR><LF>
YY-MM-DDTHH:MM:SSsss, value1[,other fields]<CR><LF>
YY-MM-DDTHH:MM:SSsss, value2[,other fields]<CR><LF>
YY-MM-DDTHH:MM:SSsss, value3[,other fields]<CR><LF>
...
YY-MM-DDTHH:MM:SS, valuen[,other fields]<CR><LF>
+OK - Success.<CR><LF>
bFull

If true all fields of a table row is returned (other fields above) in a comma separated list. Note that datetime is always listed first followed by value regardless of how the columns of the table is arranged.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetRaw

    int tableGetRaw( const wxString& tblName, 
                                const wxDateTime& from, 
                                const wxDateTime& to,
                                wxArrayString& resultArray ); 

Get data from a named table in a range to-from. All columns of the table is always returned.

tblName

Name of an existing table.

from

Datetime from which data should be fetched. Should be given on ISO 8601 format YY-MM-DDTHH:MM:SS.

to

Datetime up to which data is fetched. Should be given on ISO 8601 format YY-MM-DDTHH:MM:SS.

resultArray

String array that is filled with resulting rows (if any) from the table. The format is

'count' rows<CR><LF>
comma separated row of database columns<CR><LF>
comma separated row of database columns<CR><LF>
comma separated row of database columns<CR><LF>
...
comma separated row of database columns<CR><LF>
+OK - Success.<CR><LF>
Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableLog

    int tableLog( const wxString& tblName, 
                        double value, 
                        wxDateTime *pdt = NULL ); 

Log a value, date/time pair to a table.

tblName

Name of an existing table.

value

Value to log.

pdt

Pointer to date/time value. Can be NULL and in which case the current date/time is used.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableLogSQL

    int tableLogSQL( const wxString& tblName, 
                        const wxString& sql ); 

Log data to with a SQL expression.

tblName

Name of an existing table.

sql

SQL expression used to log data.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetNumRecords

    int tableGetNumRecords( const wxString& tblName, 
                                const wxDateTime& from, 
                                const wxDateTime& to,
                                size_t *pRecords ); 

Get number of records for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pRecords

size_t that will get number of records in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetFirstDate

    int tableGetFirstDate( const wxString& tblName, 
                                const wxDateTime& from, 
                                const wxDateTime& to,
                                wxDateTime& first ); 

Get the first data/time for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

first

Will get the first date/time in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetLastDate

    int tableGetLastDate( const wxString& tblName, 
                                const wxDateTime& from, 
                                const wxDateTime& to,
                                wxDateTime& last ); 

Get the last data/time for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

last

Will get the last date/time in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetSum

    int tableGetSum( const wxString& tblName, 
                        const wxDateTime& from, 
                        const wxDateTime& to,
                        double *pSum ); 

Get the sum of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pSum

Pointer to a double that will get the sum of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetMin

    int tableGetMin( const wxString& tblName, 
                        const wxDateTime& from, 
                        const wxDateTime& to,
                        double *pMin ); 

Get the minimum of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pMin

Pointer to a double that will get the minimum of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetMax

    int tableGetMax( const wxString& tblName, 
                        const wxDateTime& from, 
                        const wxDateTime& to,
                        double *pMax ); 

Get the maximum of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pMax

Pointer to a double that will get the maximum of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetAverage

    int tableGetAverage( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pAverage ); 

Get the average of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pAverage

Pointer to a double that will get the average of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetMedian

    int tableGetMedian( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pMedian ); 

Get the median (middle/second quartile) of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pMedian

Pointer to a double that will get the median of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetStdDev

    int tableGetStdDev( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pStdDev ); 

Get the standard deviation of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pStdDev

Pointer to a double that will get the standard deviation of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetVariance

    int tableGetVariance( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pVariance ); 

Get the variance of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pVariance

Pointer to a double that will get the variance of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetMode

    int tableGetMode( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pMode ); 

Get the mode of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pMode

Pointer to a double that will get the mode of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetLowerQ

    int tableGetLowerQ( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pLowerQ ); 

Get the lower/first quartile of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pLowerQ

Pointer to a double that will get the lower quartile of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableGetUpperQ

    int tableGetUpperQ( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to,
                            double *pUpperQ ); 

Get the upper/third quartile of all values for an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

pUpperQ

Pointer to a double that will get the upper quartile of all values in the interval on success.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

tableClear

    int tableClear( const wxString& tblName, 
                            const wxDateTime& from, 
                            const wxDateTime& to ); 

Remove all records in an interval in a named table.

tblName

Name of an existing table.

from

Date/time from which resulting data should be fetched. Set to “0000-01-01T00:00:00” for beginning of time.

to

Date/time to which resulting data should be fetched. Set to “9999-12-31T23:59:59” for end of time.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

Register handling methods

readLevel2Register

    int readLevel2Register( uint32_t reg,
                                uint16_t page,
                                uint8_t *pval,
                                cguid& ifGUID,
                                cguid *pdestGUID = NULL,
                                bool bLevel2 = false); 

Read a level II register.

reg

Register to read (32-bit value for true Level II).

page

Page to read the register from.

pval

Pointer to eight bit value that will get read value from register.

ifGUID

GUID for interface this events should be sent on. This is used to read registers of Level I devices.

pdestGUID

GUID for remote node.

bLevel2

If true this is a true Level II read operation.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

readLevel2Registers

    int readLevel2Registers( uint32_t reg,
                                uint16_t page,
                                uint8_t count,
                                uint8_t *pval,
                                cguid& ifGUID,
                                cguid *pdestGUID = NULL,
                                bool bLevel2 = false ); 

Read one or more level II registers.

reg

First register to read (32-bit value for true Level II).

page

Page to read the register(s) from.

count

Number of registers to read.

pval

Pointer to array that will get read value(s) from register(s).

ifGUID

GUID for interface this events should be sent on. This is used to read registers of Level I devices.

pdestGUID

GUID for remote node.

bLevel2

If true this is a true Level II read operation.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

writeLevel2Register

    int writeLevel2Register(uint32_t reg,
                                uint16_t page,
                                uint8_t *pval,
                                cguid& ifGUID,
                                cguid *pdestGUID = NULL,
                                bool bLevel2 = false ); 

Write a level 2 register.

reg

Register to write to (32-bit value for true Level II).

page

Page at which the register is located.

pval

Pointer to byte that should be written into the register. At exit this byte contains the written value returned from the node where it got written.

ifGUID

GUID for interface this events should be sent on. This is used to read registers of Level I devices.

pdestGUID

GUID for remote node.

bLevel2

If true this is a true Level II read operation.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

getMDFUrlFromLevel2Device

    bool getMDFUrlFromLevel2Device( cguid& ifGUID,
                                        cguid& destGUID,
                                        wxString &strurl,
                                        bool bLevel2 = false );

Get MDf file from device registers.

ifGUID

GUID for interface this events should be sent on. This is used to read registers of Level I devices.

pdestGUID

GUID for remote node.

strURL

Reference to string that will get the MDF url of the device if call is successful..

bLevel2

If true this is a true Level II read operation.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

fetchIterfaceGUID

    int fetchIterfaceGUID( const wxString& ifName, cguid& guid );

Fetch guid for a tcp/ip interface from it's name.

ifName

Real text name of the VSCP server interface.

guid

GUID for the interface if the named interface exist.

Return Value

CANAL_ERROR_SUCCESS on success or an error code on failure.

classes_vscpremotetcpipif_metods.txt · Last modified: 2017/05/24 17:36 by admin