int vscphlp_createRemoteVariable( long handle, 
                                    const char *pName,
                                    const char* pType,
                                    const char* pValue,
                                    int bPersistent )



Handle for the communication channel obtained from a call to vscphlp_newsession.


Pointer to a string containing the name of the variable. This name should have a character a-z as its first character and is not case sensitive.


Pointer to the type of the variable either as its symbolic name “string”, “long” etc or to it's numerical code “1”, “6”. Note that the numerical types are also in string form. The different variable types is described here.


Pointer to string that contains the value of the string variable.


If non zero the variable will be set to be persistent. This means that is will be saved to disk and will be available also in the future as long as it is not deleted.

Return Value

Return VSCP_ERROR_SUCCESS on success, VSCP_ERROR_ERROR on failure. If the connection is closed VSCP_ERROR_CONNECTION is returned. VSCP_ERROR_PARAMETER is returned if called while in a receive loop.


Create a variable of a specific type. All the write methods below also create a variable if it does not exist but this method also allows to set the persistence.


// Create a variable
char strBuf[32];
       (rv = vscphlp_createRemoteVariable( handle1, 
                                      "Carpe Diem",
                                      1 ) ) )  {
    printf( "Command success: vscphlp_createRemoteVariable on channel 1\n" );
else {
    printf("\aCommand error: vscphlp_createRemoteVariable on channel 1  Error code=%d\n", rv);

        ( rv = vscphlp_getRemoteVariableString( handle1, 
                                             sizeof( strBuf )-1 ) ) ) {
    printf( "Command success: vscphlp_getRemoteVariableString on channel 1\n" );
    printf(" Value = %s\n", strBuf );
else {
    printf("\aCommand error: vscphlp_getRemoteVariableString on channel 1  Error code=%d\n", rv);

Very Simple Control Protocol
Fri Jan 11 2019 17:30:44 GMT+0000 (UTC)
This document is licensed under Creative Commons BY 4.0 and can be freely copied, redistributed, remixed, transformed, built upon as long as you give credits to the author((s).

results matching ""

    No results matching ""