WSLowLevelDeviceName (C Function)

int WSLowLevelDeviceName( WSLINK l , const char ** name )

gets the low-level protocol form of the link name of the WSTP connection specified by l, storing the result in name.

Details

  • WSLowLevelDeviceName() allocates memory for the name that must be released by calling WSReleaseLowLevelDeviceName(). If WSLowLevelDeviceName() returns an error, do not call WSReleaseLowLevelDeviceName() on the contents of name.
  • WSLowLevelDeviceName() returns 1 on success and 0 on failure.
  • WSLowLevelDeviceName() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

int main(int argc, char **argv)
{
    WSENV env;
    WSLINK link;
    int error;
    const char *name;
    int apiResult;

    env = WSInitialize((WSEnvironmentParameter)0);
    if(env == (WSENV)0)
    { /* Unable to create environment object */ }

    link = WSOpenArgcArgv(env, argc, argv, &error);
    if(link == (WSLINK)0 || error != WSEOK)
    { /* Unable to create the link object */ }

    WSActivate(link);

    apiResult = WSLowLevelDeviceName(link, &name);
    if(apiResult == 0)
    { /* Failed to retrieve low level name */ }

    /* ... */

    WSReleaseLowLevelDeviceName(link, name);        

    /* .... */

    WSClose(link);
    WSDeinitialize(env);
    return 0;
}