User Tools

Site Tools


VSCP Helper library API - Initialization

This part describes the main functionality and communication methods available in the library.


Opens a new communication session. This is the first method that should be called before TCP/IP communication can be established.

long vscphlp_newSession( void )

A session handle or zero if a session could not be created.

    handle1 = vscphlp_newSession();
    if (0 != handle1 ) {
        printf( "Handle for channel 1 OK %d\n", handle1 );
    else {
        printf("\aError: Failed to get handle for channel 1\n");


Close an open session. This is the last operation that should be done after you are done with a TCP/IP session.

void vscphlp_closeSession( long handle )



This is a simple windows console example that log on to a server that is on the host 192.618.1.9 and standard port 9598 and issue the NOOP command and then terminates. You link to the vscphelper.lib library and make sure the vscphelper.dll is in the path.

#include "vscphelperlib.h"
int main(int argc, char* argv[])
    long handle;
    handle = vscphlp_newSession();
    vscphlp_open( handle, 
                 "secret" ); 
    vscphlp_noop( handle );
    vscphlp_close( handle );
    vscphlp_closeSession( handle );
    return 0;

Grodans Paradis AB

helper_lib_api_initialization.txt · Last modified: 2018/02/08 17:57 (external edit)