# Creating and sending MSPP commands

You can create an MSPP command by using the mspBuildCommand macro along with an MSPP endpoint command. You can send an MSPP command to the specified endpoint by using mspSendCommand.

The mspBuildCommand macro and mspSendCommand are described below. The MSPP endpoint commands are described Video endpoint MSPP commands and queries.

## The mspBuildCommand macro

The mspBuildCommand macro builds a command by concatenating the endpoint filter ID with an endpoint command. It is defined as follows:

#define mspBuildCommand(filter,command) ((filter << 8) | command)

For more information about the mspBuildCommand macro, see the MSPP Service Developer's Reference Manual.

## The mspSendCommand function

mspSendCommand sends a concatenated command to an MSPP endpoint. It is defined as follows:

DWORD mspSendCommand(MSPHD msphd, DWORD command, void *buffe r, DWORD size)

Where:

- msphd is a unique MSPP endpoint handle (obtained when creating the endpoint with mspCreateEndpoint).

- command is a valid command produced by using the mspBuildCommand macro.

- *buffer is a pointer to a structure that contains the value to assign to the command. The value of this argument is NULL, if there is no associated structure.

- size is the size of the structure. This value of this argument is 0, if there is no associated structure.

For more information about mspSendCommand, see the MSPP Service Developer's Reference Manual.