Raritan PX2/PX3 JSON-RPC API
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
peripheral::G2Production_2_0_0 Interface Reference

Classes

struct  FirmwareInfo
 

Public Types

enum  ConfigurationSpace { HARDWARE, FUNCTION, FIRMWARE, RESERVED }
 
enum  ResetMethod { BROWNOUT, WATCHDOG }
 

Public Member Functions

int updateFirmware (in string romcode)
 Update G2 peripheral firmware with binary pereviously uploaded using fwupload_g2pdev.cgi script. More...
 
int updateFirmwarePos (in vector< PosElement > position)
 
int getFirmwareInfo (in string romcode, out FirmwareInfo info)
 Read G2 peripheral device firmware information. More...
 
int getFirmwareInfoPos (in vector< PosElement > position, out FirmwareInfo info)
 
int readConfigurationSpace (in string romcode, in ConfigurationSpace cs, out vector< byte > cfg)
 Read the configuration space of a G2 peripheral device. More...
 
int readConfigurationSpacePos (in vector< PosElement > position, in ConfigurationSpace cs, out vector< byte > cfg)
 
int eraseConfigurationSpace (in string romcode, in ConfigurationSpace cs)
 Erase the configuration space of a G2 peripheral device. More...
 
int eraseConfigurationSpacePos (in vector< PosElement > position, in ConfigurationSpace cs)
 
int writeConfigurationSpace (in string romcode, in ConfigurationSpace cs, in vector< byte > cfg)
 Write a complete configuration space of a G2 peripheral device. More...
 
int writeConfigurationSpacePos (in vector< PosElement > position, in ConfigurationSpace cs, in vector< byte > cfg)
 
int readRegisters (in string romcode, in int address, in int count, out vector< byte > data)
 Read the registers of a G2 peripheral device. More...
 
int readRegistersPos (in vector< PosElement > position, in int address, in int count, out vector< byte > data)
 
int writeRegisters (in string romcode, in int address, in vector< byte > data)
 Write the registers of a G2 peripheral device. More...
 
int writeRegistersPos (in vector< PosElement > position, in int address, in vector< byte > data)
 
int writeRegisterBits (in string romcode, in int address, in byte mask, in byte bits)
 Set single (masked) bits of a G2 peripheral device register. More...
 
int writeRegisterBitsPos (in vector< PosElement > position, in int address, in byte mask, in byte bits)
 
int reset (in string romcode, in ResetMethod method)
 Reset a G2 peripheral device. More...
 
int resetPos (in vector< PosElement > position, in ResetMethod method)
 

Public Attributes

constant int ERR_INVALID_PARAMS = 1
 
constant int ERR_NO_CONFIG_MODE = 2
 
constant int ERR_NO_DEVICE = 3
 
constant int ERR_NO_FIRMWARE_FILE = 4
 
constant int ERR_FIRMWARE_INVALID = 5
 
constant int ERR_PROTECTED = 6
 
constant int ERR_UPDATE_IN_PROGRESS = 7
 

Member Enumeration Documentation

Enumerator
HARDWARE 

HW-specific configuration data.

FUNCTION 

Function-specific configuration data.

FIRMWARE 

Firmware-specific configuration data.

RESERVED 

Reserved, Development only.

Enumerator
BROWNOUT 

reset triggered instantly by firmware

WATCHDOG 

sensor is halted until watchdog triggers reset

Member Function Documentation

int peripheral::G2Production_2_0_0::eraseConfigurationSpace ( in string  romcode,
in ConfigurationSpace  cs 
)

Erase the configuration space of a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
csthe configuration space identifier
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
int peripheral::G2Production_2_0_0::getFirmwareInfo ( in string  romcode,
out FirmwareInfo  info 
)

Read G2 peripheral device firmware information.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
infothe firmware information
Returns
0 if OK
ERR_NO_DEVICE no device present or wrong romcode
ERR_FIRMWARE_INVALID if firmware information invalid
ERR_UPDATE_IN_PROGRESS if firmware update is in progress
int peripheral::G2Production_2_0_0::readConfigurationSpace ( in string  romcode,
in ConfigurationSpace  cs,
out vector< byte >  cfg 
)

Read the configuration space of a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
csthe configuration space identifier
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
int peripheral::G2Production_2_0_0::readRegisters ( in string  romcode,
in int  address,
in int  count,
out vector< byte >  data 
)

Read the registers of a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
addressthe address of (first) register to read from
countthe number of registers to read
datathe register data being read out
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
ERR_INVALID_PARAMS if address or count ouf of bounds
int peripheral::G2Production_2_0_0::reset ( in string  romcode,
in ResetMethod  method 
)

Reset a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
methodthe reset method to be executed
Returns
0 if OK
ERR_NO_DEVICE no device present or wrong romcode
int peripheral::G2Production_2_0_0::updateFirmware ( in string  romcode)

Update G2 peripheral firmware with binary pereviously uploaded using fwupload_g2pdev.cgi script.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
ERR_NO_FIRMWARE_FILE if no previously uploaded firmware file is present
ERR_FIRMWARE_INVALID if previously uploaded firmware file is invalid
ERR_UPDATE_IN_PROGRESS if firmware update is already in progress
int peripheral::G2Production_2_0_0::writeConfigurationSpace ( in string  romcode,
in ConfigurationSpace  cs,
in vector< byte >  cfg 
)

Write a complete configuration space of a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
csthe configuration space identifier
cfgthe configuration bytes
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
ERR_PROTECTED if configuration space is not writeable
int peripheral::G2Production_2_0_0::writeRegisterBits ( in string  romcode,
in int  address,
in byte  mask,
in byte  bits 
)

Set single (masked) bits of a G2 peripheral device register.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
addressthe address of register to set bits of
maskthe bitmask to apply (set bit: 1, don't set bit 0)
bitsthe bit vailues to set
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
ERR_INVALID_PARAMS if address or count ouf of bounds
ERR_PROTECTED if registers are not writeable
int peripheral::G2Production_2_0_0::writeRegisters ( in string  romcode,
in int  address,
in vector< byte >  data 
)

Write the registers of a G2 peripheral device.

Parameters
romcode1-wire rom code for device identification, can be left empty if only one device connected
addressthe address of (first) register to write to
datathe register data to be writen
Returns
0 if OK
ERR_NO_CONFIG_MODE if the device is not in factory configuration mode
ERR_NO_DEVICE no device present or wrong romcode
ERR_INVALID_PARAMS if address or count ouf of bounds
ERR_PROTECTED if registers are not writeable

The documentation for this interface was generated from the following file: