GRL-USB-PD-C2/C2-EPR API 1.1.9
GRL-USB-PD-C2/C2-EPR API Documentation
Loading...
Searching...
No Matches
GrlPdLib.RequestMessage Class Reference

RequestMessage class is used to send the request message from the GRL-USB-PD-C2/F1 controller. More...

Public Member Functions

List< uint > GetByteData ()
 Gets Byte Data.
 
byte[] GetRawData_InBytes ()
 
 RequestMessage (bool isEprReq=false)
 Request Message Constructor.
 
bool ClearDataObjects ()
 Clears the object.
 
bool AddFixedVariableRequestDataObj (uint maxOperatingCurrent_10mA_Unit, uint operatingCurrent_10mA_Unit, uint ObjPosition=1, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool GiveBack_Flag=false, bool EprModeCapable=false)
 Allows to set Fixed Variable Request Data object.
 
bool AddFixedVariableRequestDataObjwithGivebackSup (uint MinOperatingCurrent_10mA_Unit, uint OperatingCurrent_10mA_Unit, uint ObjPosition, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool GiveBack_Flag=false)
 Allows to set Fixed Variable Request Data object with Giveback Support.
 
bool AddBatteryRequestDataObj (uint MaxOperatingPower_250mW_Unit, uint OperatingPower_250mW_Unit, uint ObjPosition, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool GiveBack_Flag=false)
 Allows to set Battery Request Data object.
 
bool AddBatteryRequestDataObjwithGivebackSup (uint MinOperatingPower_250mW_Unit, uint OperatingPower_250mW_Unit, uint ObjPosition, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool GiveBack_Flag=false)
 Allows to set the Battery Request Data object with Give =back Support.
 
bool AddProgramRequestDataObj (uint OperatingCurrent_50mA_Unit, uint OutputVoltage_20mV_Unit, uint ObjPosition=1, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool GiveBack_Flag=false)
 Allows to set Program Request Data Object.
 
bool AddAVSRequestDataObj (uint OperatingCurrent_50mA_Unit, uint OutputVoltage_25mV_Unit, uint ObjPosition=1, bool UnchkExtendedMsgSupport=false, bool NoUsbSuspended=false, bool UsbCommCapable=false, bool CapMismatch=false, bool EprModeCapable=false)
 Allows to set Adjustable Voltage Supply Request Data object.
 
void PDMessageHeaderNameValuePair (PDMessage pdoMessage)
 
void PDMessagePDONameValuePair (PDMessage pdoMessage)
 
void UpdateExtendedHeader (byte dataSize, byte requestChunk, byte chunkNumber, byte chunked)
 
void UpdateHeader (uint specificationRevision, uint extended)
 

Public Attributes

List< uint > m_ReqMsgPowerDataObject
 
List< KeyValuePair< string, string > > Header = new List<KeyValuePair<string, string>>()
 
List< Dictionary< string, string > > PDO = new List<Dictionary<string, string>>()
 
uint extendedHeader
 
uint msgHeader
 

Detailed Description

RequestMessage class is used to send the request message from the GRL-USB-PD-C2/F1 controller.

Constructor & Destructor Documentation

◆ RequestMessage()

GrlPdLib.RequestMessage.RequestMessage ( bool isEprReq = false)

Request Message Constructor.

Member Function Documentation

◆ AddAVSRequestDataObj()

bool GrlPdLib.RequestMessage.AddAVSRequestDataObj ( uint OperatingCurrent_50mA_Unit,
uint OutputVoltage_25mV_Unit,
uint ObjPosition = 1,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool EprModeCapable = false )

Allows to set Adjustable Voltage Supply Request Data object.

Parameters
OutputVoltage_25mV_UnitMaximum Operating Current 25mA units.
OperatingCurrent_50mA_UnitOperating Current 50mA units.
ObjPositionObject Position.
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
Returns
on success returns true else false.

◆ AddBatteryRequestDataObj()

bool GrlPdLib.RequestMessage.AddBatteryRequestDataObj ( uint MaxOperatingPower_250mW_Unit,
uint OperatingPower_250mW_Unit,
uint ObjPosition,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool GiveBack_Flag = false )

Allows to set Battery Request Data object.

Parameters
MaxOperatingPower_250mW_UnitMaximum Operating Power 250mW units.
OperatingPower_250mW_UnitOperating Power 250mW units.
ObjPositionObject Position
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
GiveBack_FlagGiveback Flag.
Returns
On success returns true else false.

◆ AddBatteryRequestDataObjwithGivebackSup()

bool GrlPdLib.RequestMessage.AddBatteryRequestDataObjwithGivebackSup ( uint MinOperatingPower_250mW_Unit,
uint OperatingPower_250mW_Unit,
uint ObjPosition,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool GiveBack_Flag = false )

Allows to set the Battery Request Data object with Give =back Support.

Parameters
MinOperatingPower_250mW_UnitMinimum Operating Power 250mW units.
OperatingPower_250mW_UnitOperating Power 250mW units.
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
GiveBack_FlagGiveback Flag.
Returns
Returns true on success else false.

◆ AddFixedVariableRequestDataObj()

bool GrlPdLib.RequestMessage.AddFixedVariableRequestDataObj ( uint maxOperatingCurrent_10mA_Unit,
uint operatingCurrent_10mA_Unit,
uint ObjPosition = 1,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool GiveBack_Flag = false,
bool EprModeCapable = false )

Allows to set Fixed Variable Request Data object.

Parameters
MaxOperatingCurrent_10mA_UnitMaximum Operating Current 10mA units.
OperatingCurrent_10mA_UnitOperating Current 10mA units.
ObjPositionObject Position.
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
GiveBack_FlagGiveBack Flag.
Returns
on success returns true else false.

◆ AddFixedVariableRequestDataObjwithGivebackSup()

bool GrlPdLib.RequestMessage.AddFixedVariableRequestDataObjwithGivebackSup ( uint MinOperatingCurrent_10mA_Unit,
uint OperatingCurrent_10mA_Unit,
uint ObjPosition,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool GiveBack_Flag = false )

Allows to set Fixed Variable Request Data object with Giveback Support.

Parameters
MinOperatingCurrent_10mA_UnitMinimum Operating Current 10mA units.
OperatingCurrent_10mA_UnitOperating Current 10mA Unit.
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
GiveBack_FlagGiveBack Flag.
Returns
On success Returns True else False

◆ AddProgramRequestDataObj()

bool GrlPdLib.RequestMessage.AddProgramRequestDataObj ( uint OperatingCurrent_50mA_Unit,
uint OutputVoltage_20mV_Unit,
uint ObjPosition = 1,
bool UnchkExtendedMsgSupport = false,
bool NoUsbSuspended = false,
bool UsbCommCapable = false,
bool CapMismatch = false,
bool GiveBack_Flag = false )

Allows to set Program Request Data Object.

Parameters
OperatingCurrent_50mA_UnitOperating Current 50mA units.
OutputVoltage_20mV_UnitOutput Voltage 20mV units.
UnchkExtendedMsgSupportUnchunked Extended Messages Supported.
NoUsbSuspendedNo USB Suspended.
UsbCommCapableUSB Communication Capable.
CapMismatchCapability Mismatch.
GiveBack_FlagGiveBack Flag.
Returns
returns true on success else false.

◆ ClearDataObjects()

bool GrlPdLib.RequestMessage.ClearDataObjects ( )

Clears the object.

Returns
Returns true.

◆ GetByteData()

List< uint > GrlPdLib.RequestMessage.GetByteData ( )

Gets Byte Data.

Returns
returns the PDO Payload along with buffer.