- Applications can use lineDevSpecific to set specific NMS board environment parameters. When using lineDevSpecific, applications must specify the command CMD_SET_PARAM_BY_NAME in the NMSDEVSPECPARAM structure. Applications use CMD_SET_PARAM_BY_NAME to specify parameter values by name.
- In addition, applications must fill in the PARAM_VALUE structure:
- typedef struct _PARAM_VALUE
- {
- DWORD dwSize; /* Size of this structure */
- CHAR szName[MAX_PARAM_NAME_LEN]; /* parameter name */
- BYTE buffer[MAX_PARAM_BUFFER_LEN]; /* memory area for value */
- UINT cValSize; /* size of buffer in bytes */
- } PARAM_VALUE, FAR *PPARAM_VALUE;
- The following code sample illustrates using lineDevSpecific to set the adi.placecall.connectmask numeric (DWORD) parameter.
NMSDEVSPECPARAM devSpecParms;
devSpecParms.dwCommand = CMD_SET_PARAM_BY_NAME;
devSpecParms.paramValue.dwSize = sizeof( PARAM_VALUE );
sprintf( devSpecParms.paramValue.szName, "adi.placecall.connectmask" );
*((DWORD*)(devSpecParms.paramValue.buffer)) = (DWORD)0x8000; /*Connect immediately*/
devSpecParms.paramValue.cValSize = sizeof( DWORD );
lineDevSpecific(
mhLine, /* line handle */
(DWORD)0, /* Address ID */
(HCALL)0, /* Call handle */
&devSpecParms,
sizeof( NMSDEVSPECPARAM )
);
- The following example shows using lineDevSpecific to set a String adi.lps.xferstring parameter:
NMSDEVSPECPARAM devSpecParms;
devSpecParms.dwCommand = CMD_SET_PARAM_BY_NAME;
devSpecParms.paramValue.dwSize = sizeof( PARAM_VALUE );
sprintf( devSpecParms.paramValue.szName, "adi.lps.xferstring" );
strncpy( (char *)devSpecParms.paramValue.buffer, "!!;!",
MAX_PARAM_BUFFER_LEN - 1 );
devSpecParms.paramValue.cValSize =
strlen( (char *)devSpecParms.paramValue.buffer ) + 1;
lineDevSpecific(
mhLine, /* line handle */
(DWORD)0, /* Address ID */
(HCALL)0, /* Call handle */
&devSpecParms,
sizeof( NMSDEVSPECPARAM )
);