Remote Procedure Calls (RPC)

19.3RPC Sample Code

Sample code for interfacing with the CMM through RPC is available in the file cli_client.c. The sample code compiles into a command-line executable for use with Linux or a .o file for use with VxWorks. To select the appropriate target, remove the comment from the appropriate #define in the source code.

The sample code first authenticates to the CMM through GetAuthCapability(). When the authentication is successful, the user’s command-line arguments (for Linux) or calling parameters (for VxWorks) are passed to the CMM through ChassisManagementApi(). The return code is then checked and the result is printed to the console.

19.4RPC Usage Examples

Table 85 presents examples of using RPC calls to get and set fields on the CMM. Data returned by RPC calls are returned in the ppvbuffer and uReturnType parameters to ChassisManagementApi().

Table 85. RPC Usage Examples (Sheet 1 of 3)

Example

ChassisManagementApi()

ChassisManagementApi() [out] Parameters

[in] Parameters

 

 

 

 

 

 

pszCMMHost: localhost

 

Get the

uCmdCode: CMD_GET

uReturnType: DATA_TYPE_STRING

chassis

pszLocation: Chassis

ppvbuffer: A null-terminated string of the format:

temperature.

pszTarget: TempSensorName

Value [Units]

 

pszDataItem: current

 

 

 

 

 

pszCMMHost: localhost

uReturnType: DATA_TYPE_INT

 

uCmdCode: CMD_GET

Get the fan

ppvbuffer: Integer value indicating presence

pszLocation: fantray1..3

tray presence.

1 = Present

 

pszTarget: NA

0 = Not Present

 

pszDataItem: presence

 

 

 

 

 

 

pszCMMHost: localhost

 

Get the CPU

uCmdCode: CMD_GET

uReturnType: DATA_TYPE_STRING

temperature

pszLocation: blade5

ppvbuffer: A null-terminated string of the format:

of blade 5.

pszTarget: CPUTempSensorName

Value [Units]

 

pszDataItem: current

 

 

 

 

 

pszCMMHost: localhost

uReturnType: DATA_TYPE_INT

Determine if a

ppvbuffer:

uCmdCode: CMD_GET

Present

certain blade

pszLocation: blade[1-n]

 

is present.

The call to ChassisManagementApi() returns

 

pszDataItem: presence

E_BLADE_NOT_PRESENT if the selected blade

 

 

is not present.

 

 

 

Get all

pszCMMHost: localhost

 

uCmdCode: CMD_GET

uReturnType: DATA_TYPE_ALL_THRESHOLDS

thresholds for

the +3.3 V

pszLocation: blade2

ppvbuffer: A THRESHOLDS_ALL structure as

sensor on

pszTarget: 3.3vSensorName

defined in cli_client.h

blade 2.

pszDataItem: ThresholdsAll

 

 

 

 

 

 

MPCMM0001 Chassis Management Module Software Technical Product Specification

187

Page 187
Image 187
Intel MPCMM0001 manual RPC Sample Code, RPC Usage Examples Sheet 1