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

Public Member Functions

int Initialize (String ipAddress, int controllerIndex=0, bool isClearCommn=true)
 Method to Initialize IP address and controllerIndex.
 
int UseTypeCCable (ControllerPort port=ControllerPort.ONE)
 API to configure GRL-SPL cable.
 
int UseTesterCable (VendorDefinedMessage vdm=null, ControllerPort port=ControllerPort.ONE, EmulateCableOn ccline=EmulateCableOn.CC2)
 
Parameters
vdmIf the VDM is not set, default VDM with 20V 5A will be set
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
cclineUsing EmulateCableOn you can set Rp value on CC line ccline = EmulateCableOn.CC1 then Rp value in CC2 line ccline = EmulateCableOn.CC2 then Rp value in CC1 line
Returns
Return 0 if Success.

 
List< MeasurementChannel > CreatePlotDisplayList (MeasurementChannel channel=MeasurementChannel.END)
 Creates default plots for the display channels. Using the add or clear list functions will enable adding display channels to the plot. You will need to create the display channel list before calling the Show Plot function.
 
List< MeasurementChannel > AddPlotDisplayList (MeasurementChannel channel)
 Adds display channels to the existing plot. This function needs to be called before calling the Show Plot function.
 
int ShortVBUSLine (bool EnableShort, ControllerPort port=ControllerPort.ONE)
 Use this API to short VBUS line to ground.
 
void DebugLogger (string discription, Exception ex)
 Saves all the Exception in text file in Location C:\GRL\Appdata.
 
bool EnableQcLegacyMode (bool enable)
 Sets the Controller to QC Legacy Mode.
 
bool FloatDpDn (bool enable)
 Float DPlus and Dminus.
 
bool FloatBothDpDn ()
 Sets trhe Controller to QC Legacy Mode.
 
bool ShortVbustoGround (bool IsEnable, int shortingTime_milliSec, ControllerPort port=ControllerPort.ONE)
 TO short VBUS to ground.
 
bool ShortVconntoGround (bool IsEnable, int shortingTime_milliSec, VCONNLoading Vconnlodg=VCONNLoading.VCONN_TO_CC2, ControllerPort port=ControllerPort.ONE)
 TO short VCONN to ground.
 
void EmulateQCSource (bool enableQcSource)
 API to emulate Tester as QC source.
 
void WaitFor (int waitTimeMilli)
 Method to provide delay in milliseconds.
 
int ValidateRequest_By_index (int iPDOind, ControllerPort port=ControllerPort.ONE)
 API to validate request message by using request message PDO index.
 
void EnableLSADCDebugLog (bool enable)
 This API used for the enabling the LSADC Debug log write.
 
void EnableReadDebugLogger (bool enable)
 This API used for the enabling the LSADC Debug log Read.
 
int Short_Dplus_Dminus (bool isApplyShort)
 Using this API to SHORT D+ and D- line.
 
void CCLineStreamingTimerReset (int controllerIndex)
 Use this API to reset streamer time.
 
void AttachController (int controllerIndex, CommunicationPORT commPort)
 Use this API to Attach selective port.
 
void DetachController (int controllerIndex, CommunicationPORT commPort)
 Use this API to Detach selective port.
 
void QuickAttachPort (CommunicationPORT commPort, byte[] buffData)
 Use this API to Attach selective port in two controller.
 
void QuickDetachPort (CommunicationPORT commPort, byte[] buffData)
 Use this API to Detach selective port in two controller.
 
bool StartReadingStreamerData (int controllerIndex)
 Use this API to read streamer data from controller.
 
void Request_PortA_PortB (RequestMessage message)
 Use this API to send Request message for both ports (GrlPdLib.ControllerPort.ONE and GrlPdLib.ControllerPort.TWO)
 
void InitialConfig ()
 Use this API to configure Tester mode as Sink, Cable type as GRL_SPL_Cable in both ports (GrlPdLib.ControllerPort.ONE and GrlPdLib.ControllerPort.TWO)
 
bool Bit_Manipulation_Response_Check (MsgType msgType, SpecRevision specRev, SOP_TYPE sopType, int iErrorType, bool extHeader=false, int txTimerInMilliSec=500)
 This API used for the manipulating the BIT (conversion) to required BIT.
 
double UpdateVoltageToPDMessage (ControllerPort port=ControllerPort.ONE)
 Use this API to Update the voltage to PDMessage.
 
bool Interruption_by_PD_Message ()
 Use this API to send Interruption by PD Message.
 
PDMessage VerifyVDMGoodCRCresponse (List< PDMessage > msglst, VDM_CMD vdmCmd, VDM_CMD_Type vdm_cmdtype, SOP_TYPE soptype, int iOccurance, bool IsTestermsg=true)
 
 GrlC2Controller (bool isCreateNewInstance=true)
 
int Attach (ControllerPort port=ControllerPort.ONE)
 Enables the GRL-USB-PD-C2 controller to be programmatic controlled when plugged in with the DUT.
 
int Detach (ControllerPort port=ControllerPort.ONE)
 Enables the GRL-USB-PD-C2/F1 controller to be programmatically controlled when removing the attached DUT.
This function removes all the Rp/Rd values from the CC line and changes the state of the controller to Source Detach or Sink Detach. It is recommended to call this Detach function before configuring the controller mode, setting the source sink and source capabilities and calling the Attach function.
 
int ADCRead (List< MeasurementChannel > channelList=null, string name="")
 
void UpdateController (PD_Controller m_PDctrl, PD_Controller_C2Gen2 m_PDctrlGen2)
 To update the Controllers.
 
int StartCapture (List< MeasurementChannel > listOfMeasurementChannel=null, int subSamplingRatio=1000, bool enCableDrop=false, bool bEnableLSADC=true, bool bEnableCCLine=true, int socBufferSize=1, ControllerPort port=ControllerPort.ONE)
 This API starts the data capture from the C2 Controller, which includes PD messages and configured list of signal channels from USB-C port of C2 Controller.
 
int StopCapture (int Timeout=5000)
 Stops the data capture, including any PD messages and voltage values.
 
int ConfigureControlMessageResponse (MsgType receivedMessageType, ResponderMessageType responseMessageType, ControllerPort port=ControllerPort.ONE)
 Configures response messages for the GRL-USB-PD-C2/F1 controller.
 
bool ConfigPS_Ready_Delay (PS_RDY_Type psRdyType, uint delayInmSec=0, bool setDefaultTimer=true)
 This API is used to configure delay for PS_RDY message.
 
void ConfigurePacketDelay (MsgType delayMsgType, Type_of_Msg MessageType, double dDelay_mS, bool bEnableDelay)
 This API used for Set the packet delay in milli seonds.
 
bool Config_HSADC (ControllerPort port=ControllerPort.ONE)
 This API used to configure the HSADC data.
 
void Config_CC1_Channel (ControllerPort port=ControllerPort.ONE)
 This API used for configuring the CC1 channel data.
 
void Config_CC2_Channel (ControllerPort port=ControllerPort.ONE)
 This API used for configuring the CC2 channel data.
 
void ConfigureADC (LSADC_Channel channels, bool LSADC0En, bool LSADC1En, bool LSADC2En)
 This API used for configuring the ADC channel data.
 
void ConfigCC1_HSADC (ControllerPort controllerPort=ControllerPort.ONE)
 This API used for configuring the CC1 amd HSADC channel data.
 
void ConfigCC2_HSADC (ControllerPort controllerPort=ControllerPort.ONE)
 This API used for configuring the CC2 amd HSADC channel data.
 
bool ConfigureAutoTestMode_MaxPower (CableType cable, PortDataRole datRle_Tester, Port_Power_Role powRle_Tester, ControllerPort por=ControllerPort.ONE)
 This API is used to configure controller mode, set cable type and tester will draw max power supported by DUT.
 
bool ConfigureAutoTestMode_UserDefined (CableType cable, PortDataRole datRle, Port_Power_Role powRle, PowerSupplyType supty, int iPDOInd, double dVoltage_mV, double dCurrent_mA, int iEloadHandle, int iEloadMode, int iEloadPercent, ControllerPort por=ControllerPort.ONE)
 This API is used to configure controller mode, set cable type, and load current details when controller is operating in auto test mode.
 
bool ConfigReplaceMessage (bool setDefault, MsgType actualMsg, MsgType replaceMsg, Type_of_Msg msgTypeAct, Type_of_Msg msgTypeReplace)
 This API used to configure replace message.
 
bool ConfigReplaceMessageCount (int iCount)
 To configure replace message count.
 
bool ConfigureSoftResetResponse (int respMsgVal, int txTimerInMilliSec)
 Use this API to send SoftReset Response.
 
bool Configure_GlitchAfterAttach_Msg (int iGlitch_Duration, ControllerPort port=ControllerPort.ONE)
 This API is used to generate the Glitch in CC Line.
 
bool ConfigureReplacePDMessageInGroup (bool setDefault, MsgType actualPdMsgType, MsgType replaceWithPdMsgType, Type_of_Msg msgTypeOfActualPdMsgType, Type_of_Msg msgTypeOfReplacePdMsgType, int txTimerInMilliSec)
 Use this API to replace one PD message with another PD message. Once configured messages please use this API to execute configured messages."GroupMessageConfigure".
 
bool ConfigureSoftResetResponseForVDMMsg (int respMsgVal, SOP_TYPE sOP_TYPE, int txTimerInMilliSec)
 Use this API to send SoftReset Response for Vendor Defined Message.
 
bool Configure_Message_To_AMS_Interupt (bool setdefault, MsgType ExpectedMessage, MsgType ConfiguredMessage, Type_of_Msg ExpectedMessageType, Type_of_Msg ConfiguredMessageType, SOP_TYPE sopType=SOP_TYPE.SOP, bool interruptTxMsg=false, ControllerPort port=ControllerPort.ONE)
 This API is used to interrupt the AMS for Interptible and Uninterptible message.
 
int ConfigureEload (double maxCurrentInAmps, EloadChannel eloadChannel, SwitchState state, VCONNLoading vCONNLoading=VCONNLoading.Disable_VCONN, ControllerPort pORT=ControllerPort.ONE)
 API to use configure the Eload.
 
int ConfigureEloadinGroup (double maxCurrentInAmps, EloadChannel eloadChannel, SwitchState state, VCONNLoading vCONNLoading=VCONNLoading.Disable_VCONN, ControllerPort pORT=ControllerPort.ONE, SOP_TYPE sopType=SOP_TYPE.SOP)
 API to use configure the Eload in group.
 
int SetEloadCurrent (double voltageInVolts, double maxCurrentInAmps, SwitchState state, EloadChannel channel, ControllerPort port=ControllerPort.ONE)
 Sets the E-load Current to be drawn in the constant current mode. Ensure that the GRL-USB-PD-C2/F1 controller mode is set as a Sink before calling this method and also turn ON the E-load switch using the SetEloadState function.
 
int SetEloadCurrentRange (double LoadStart_Amps, double LoadStop_Amps, int LoadStep_MilliAmps, int StepIntervalMilliSec, EloadMode LoadMode, double LoadStopCondition_VoltageDropMin_Volts, EloadChannel channel, ControllerPort port=ControllerPort.ONE)
 API to sweep the load current with configurable load step in Constant Current or Constant Resistance mode In CC Mode, Lowest load step is 8mA In CR Mode, Lowest load step is 25mA.
 
int SetEloadState (EloadChannel channel, SwitchState state, ControllerPort port=ControllerPort.ONE)
 Sets the E-load state as ON or OFF. Ensure that the GRL-USB-PD-C2 controller mode is set as a Sink before turning on the E-load. You may also need to ensure the VBUS switch is turned OFF before turning ON the E-load switch. Use this function with caution - in case the over current protection of the DUT is not turned on, drawing more power may cause damage to the DUT.
 
string GetEloadVersion ()
 Get C2 Eload version.
 
bool SwitchToExternalEload (bool isEnable)
 External eload ON/OFF.
 
int SetEPRMode (bool enableEPRMode, ControllerPort port=ControllerPort.ONE)
 This API is used to enable or disable the EPR mode.
 
int Set_EPR_SourceCap_Configuration (SourceCapability sourceCapabilityObj, ControllerPort port=ControllerPort.ONE)
 This API is used to Send EPR Sourcecap.
 
int Set_EPR_Request_Configuration (RequestMessage requestMessageObj, byte PDONumber, ControllerPort port=ControllerPort.ONE)
 This API is used to Send EPR Request message.
 
int SetEPRActionConfiguration (EPRConfig eprConfig, ControllerPort port=ControllerPort.ONE)
 This API is used to Set EPR Configuration.
 
int Set_EPR_SinkCap_Configuration (SinkCapability sinkCapabilityObj, ControllerPort port=ControllerPort.ONE)
 This API is used to Send EPR Sinkcap.
 
bool Set_EPR_Unchunked_Request_Configuration (bool isUnchunked=true)
 This API is used to enable or disable EPR Unchunked request message.
 
bool Set_EPR_Mode_Exit_Configuration ()
 This API is used to enable or disable EPR mode exit.
 
bool Set_SOP_Prime_DiscovID_Configuration (bool isSendSOPPrimeDiscId)
 This API is to enable or disable Prime DiscoverID configuration.
 
bool Set_EPR_PPS_Eload_Configuration (byte ppsEloadCfg)
 This API is to enable or disable EPR PPS Eload configuration.
 
int SendEPRRequestMessage (RequestMessage msg, ControllerPort port=ControllerPort.ONE)
 This function used to send EPRRequest message.
 
int SendEPRModemsg (EPR_Mode_Message msg, ControllerPort port=ControllerPort.ONE)
 This function is to send EPR Mode message.
 
int SetTesterUnChkExdMsgSupport (int iSupported, bool bClearConfig, bool IsAppCtrl)
 This API used to enable or disable the Unchunked Extended message.
 
int GetCommandExecutionStatus ()
 Returns the execution status of last API.
 
double GetMeasurementValue (MeasurementChannel channel, double dTimeInSeconds)
 This API is used to Get the measurement value.
 
double GetPresentMeasurementValue (MeasurementChannel channel)
 This API is used to get the current measurement value.
 
List< LSADC_DataRead > GetPresentMeasurementValue (List< MeasurementChannel > channel)
 This API is used to get the voltage and current measurement value.
 
dynamic GetPresentMeasurementValue ()
 This API is used to get the voltage and current measurement value.
 
string GetFirmwareVersion ()
 This API is used to get C2 Firmware version.
 
SourceCapability GetSourceCapabilityFromPDMessageObject (PDMessage pdMsg, ControllerPort port=ControllerPort.ONE)
 Convert PD Message to SourceCapability message.
 
int GetCaptureStatus ()
 This API is used to determine whether the streamer has started or not.
 
int GetConnectionStatus ()
 This API is used to get the Connection Status of the PD controller. If the PD controller is connected this function returns connected.
 
int GetPdStatus (ControllerPort port=ControllerPort.ONE)
 This API is used to get the PD contract negotiation status.
 
ControllerMode GetControllerMode (ControllerPort port=ControllerPort.ONE)
 This API is used to get the GRL-USB-PD-C2/F1 controller mode during PD contract negotiations.
 
SourceCapability GetDutSourceCapability (ControllerPort port=ControllerPort.ONE)
 This API is used to get Source Capabilities from the connected Source DUT. If the connected DUT is not a Source device, it will return null.
 
SinkCapability GetDutSinkCapability (ControllerPort port=ControllerPort.ONE)
 This API is used to get Sink Capabilities from the Sink DUT. If the connected DUT is not Sink device, it will return null.
 
SourceCapability GetDutExtendedSourceCapability (ControllerPort port=ControllerPort.ONE)
 This API is used to get Extended Source Capabilities from the connected Source DUT. If the connected DUT is not a Source device, it will return null.
 
VendorDefinedMessage GetCableCapability (ControllerPort port=ControllerPort.ONE)
 Returns the capabilities of e marker cable connected to GRL-USB-PD-C2 controller.
 
int GetCCLineActive ()
 Used this API to get active communication line(CC)
 
int GetListOfPDOFromPDMessage (List< PDMessage > msgCollec)
 Use this API to get list of PDO's sent by DUT.
 
List< PDMessage > GetPDMessages (ControllerPort port=ControllerPort.ONE)
 Use this API to get CC line msg from the controller.
 
dynamic GetPDMessage (ControllerPort port=ControllerPort.ONE, MsgType msgType=MsgType.NONE, int iOccur=1)
 Use this API to get PD message from the controller.
 
int GetTotalPDMessageCount (ControllerPort port=ControllerPort.ONE)
 Use this API to get Total PDmsg count.
 
double GetTimeAtVoltageValue (int channel, double startTime=0.0, int timeIntervalInSec=0, double thresholdVal=0.0, bool isRisingEdge=false)
 Use this API to get time at voltage value.
 
PDMessage GetPDMessageFromIndex (int iMsgInd, ControllerPort port=ControllerPort.ONE)
 Use this API to get PD msg from index.
 
List< PDMessage > GetMessages (ControllerPort port=ControllerPort.ONE, bool includeAllBusEvents=true)
 Provides all the PD messages received or sent by the GRL-USB-PD-C2/F1 controller. To enable the PD message capture capability of the controller, the data streamer needs to be configured first. Refer to the StartDataStreamer function for more details on how to set up the streamer.
 
dynamic GetAssertionMessages (ControllerPort port=ControllerPort.ONE)
 This API is used to get All Assertions messages.
 
dynamic GetAssertionMsg (ControllerPort port=ControllerPort.ONE, MsgTypeSec msgTypeSec=MsgTypeSec.NONE, int iOccur=1)
 This API is used to get one Assertion message.
 
dynamic GetAssertionPDMsg (ControllerPort port=ControllerPort.ONE, MsgTypeSec msgTypeSec=MsgTypeSec.NONE, int iOccur=1)
 This API is used to get one Assertion message.
 
dynamic GetPDMsg (ControllerPort port=ControllerPort.ONE, MsgType msgType=MsgType.NONE, int iOccur=1)
 This API is used to get one PD Message.
 
string GetSerialNumber ()
 API to get the serial number of the C2 or C2-EPR tester.
 
double GetTimeDifferenceAtSignalChange (int channel, double stTime=0.0, int timeIntervalInSec=0, double thresholdVal=0.0, bool isRisingEdge=false, ControllerPort port=ControllerPort.ONE, MsgTypeSec msgTypeSec=MsgTypeSec.FR_Swap_Signal_Asserted)
 API to get time Difference at signal change.
 
double GetTimeForVoltageValue (int channel, double startTime=0.0, double timeIntervalInSec=0, double thresholdVal=0.0, bool isRisingEdge=false)
 API to Get time for voltage value.
 
string GetSourceCapPDO (ControllerPort port=ControllerPort.ONE)
 API to Get sourcecap PDO details.
 
double GetHSADCValue ()
 API to get the HSADC data.
 
double GetDplusCurrent ()
 This API used to get the current value based on the port.
 
int GroupCommand_Add (GroupCommandAPIEnum cmdType, object cmdInfo, int iTimeDelayInMilliSec, ControllerPort port=ControllerPort.ONE)
 This API is used to configure GRLSharedModule.GroupCommandAPIEnum.
 
int GroupCommand_Clear ()
 This API used to clear group command configuration.
 
int GroupCommand_Run ()
 This API is used to configure the GroupCommand message correctly.
 
bool GroupMessageConfigure (FwMsgCfgType cfgType)
 Use this API to configure the message execution type whether to initiate the messages at the runtime or pre-configure the messages with time delay.
 
bool GroupMessageClear ()
 Use this API to clear the messages in the buffer.
 
bool GroupMessageAdd (MsgType pdMsgType, SpecRevision specRev, SOP_TYPE sopType, bool extHeader=false, int txTimerInMilliSec=500, List< byte > extHeaderPayload=null)
 Use this API to add the messages into buffer.
 
bool AddTracesToController (ControllerPort port=ControllerPort.ONE)
 Use this API to add the traces to GRL_USB_PD_C2 tester.
 
void SaveHTMLForPDPackets (string fileNameHTML, string testName, string testId, bool isVoltageUpdate=false)
 Used this API to Save PD protocol capture into .html file.
 
void SaveHTMLForTestSummary (string fileNameHTML, string testName, string testId)
 Used this API to Save TestSummary into .html file.
 
void SaveHTMLForPDPacketsForFourPort (List< PDMessage > pdMsgCollec, string fileNameHTML, string testName, string testId, bool isVoltageUpdate=false)
 Used this API to Save four port PD protocol capture into .html file.
 
bool SaveTestResultAndPDPacketInCSV (string fileName, ControllerPort port=ControllerPort.ONE)
 Use this API to save all PD messages into CSV file.
 
bool SaveTestResultInCSV (PDTestResult baseTestResult)
 Use this API to save validated PD Test Result into CSV file.
 
bool SaveTestPDPacketInCSV (List< PDMessage > msgColle, string filename, bool isVoltageUpdate=false)
 Use this API to save all PD messages into CSV file.
 
bool CreateReportFolder ()
 Use this API to Create report folder.
 
string GetReportFolderPath ()
 Use this API to get the report folder path.
 
bool SaveTraceFile (string fileName)
 Saves signal and protocol data into specified file.
 
bool ResetController ()
 Use this API to reset the Controller.
 
bool Reset_TestResultObject ()
 This API is used to Clear the test result.
 
bool PowerCycleTheTester ()
 Used this API to Power cycle the GRL_USB_PD_C2 tester.
 
void ClearCaptureData ()
 Use this API to clear captured data.
 
int RebootController ()
 This API will reboot the GRL-USB-PD-C2 controller. Expected reboot time is 20-30 seconds. After calling this API, please re-initialize the ethernet connection by calling Initialize() API before calling any further API's.
 
List< MeasurementChannel > GetPlotDisplayList ()
 This API is used to display the plot .
 
bool Reset_PDPort (ControllerPort port=ControllerPort.ONE)
 Resets Port1 and Port2 of USB-PD-C2 controller.
 
int ClearPDMessages (ControllerPort port=ControllerPort.ONE, int iMsgCntToClear=0)
 Clears all captured messages from the PD message capture memory on the GRL-USB-PD-C2/F1 controller. It is recommended to clear the memory before starting a new test to avoid any buffer overflow.
 
void ClearDutInfo (ControllerPort port=ControllerPort.ONE)
 This API is used for Clear the attributes of dut type.
 
bool DisposeGRLControllerLink (int controllerIndex)
 Use this API to Disable the GRLController ethernet connection.
 
List< MeasurementChannel > ClearPlotDisplayList ()
 Clears existing plots of the display channels to make way for creating a new list of channels The new list of channels needs to be created before calling the Show Plot function which otherwise will display Port A VBus and Port A VBus Current channels by default.
 
int SendControlMessage (MsgType msg, ControllerPort port=ControllerPort.ONE)
 Sends the control messages from the GRL-USB-PD-C2/F1 controller. Some of the messages you can send are.
 
void SendDataMessage (MsgType msgType, bool isDefaultPayload=true, SOP_TYPE sopType=SOP_TYPE.SOP, SpecRevision revision=SpecRevision.PD_3_0, int noOfDataObjet=1, ControllerPort port=ControllerPort.ONE)
 This API is used to Send Data messages. Alert, Get_Country_Info.
 
void SendExtendedMessage (MsgType msgType, bool isDefaultPayload=true, SOP_TYPE sopType=SOP_TYPE.SOP, SpecRevision revision=SpecRevision.PD_3_0, int noOfDataObjet=1, ControllerPort port=ControllerPort.ONE)
 This API used to send Extended Message with Payload. Get_Manufacturer_Info, Get_Battery_Status, Get_Battery_Cap, Firmware_Update_Request, Security_Request.
 
int SendPdoRequestMessage (RequestMessage msg, ControllerPort port=ControllerPort.ONE)
 This API used to sends the PDO request messages during the PD contract negotiations.
 
int SendVendorDefinedMessage (VendorDefinedMessage initiateMessage, SOP_TYPE sopType=SOP_TYPE.SOP, ControllerPort port=ControllerPort.ONE)
 This API is used to send Vendor Defined message.
 
int SendSourceCapsMessage (SourceCapability msg, ControllerPort port=ControllerPort.ONE)
 This API is used to initiate sourcecap message.
 
int SendRequestmessage_By_Index (int iSourcePDOIndex, ControllerPort port=ControllerPort.ONE)
 This API is used to send request message by configuring source PDO index.
 
void SendFRSwapSignal ()
 Send FR_Swap signal from Tester.
 
bool SendBISTCarrierMode (SOP_TYPE sopType)
 This API used to send the BIST carrier mode.
 
bool SendBISTTestData (SOP_TYPE sopType)
 This API is used to send BISTCarrierMode message.
 
bool SendHardReset (bool isFlip=false, ControllerPort port=ControllerPort.ONE)
 Use this API to send HardReset.
 
int SendSinkCapMessage (SinkCapability msg, ControllerPort port=ControllerPort.ONE)
 This API is used to send SinkCap message.
 
bool SendAssertionMessage (ControllerPort port=ControllerPort.ONE)
 Use this API to send assertion message.
 
bool SendSoftReset (ControllerPort port=ControllerPort.ONE)
 Send SoftReset message with different SOP_TYPE.
 
void SetCommPort (ControllerPort port)
 This API is used to set the Communication port.
 
int SetPdSpecificationRevision (SpecRevision specRevision, ControllerPort port=ControllerPort.ONE)
 This API is used to set the PD spec revision value.
 
int SetSourceCapability (SourceCapability objSourceCapability, ControllerPort port=ControllerPort.ONE)
 This API is used to set the Source cap value.
 
void SetTesterVBUSCapacitance (Tester_VBus_Capacitance capacitance)
 This API is used to set the VBUS Capacitance on the GRL-USB-PD-C2/F1 controller. When this function is called, appropriate capacitance is added across VBUS and ground.

Parameters
capacitanceGRLSharedModule.Tester_VBus_Capacitance.

 
int SetSinkCapability (SinkCapability objSinkCapability, ControllerPort port=ControllerPort.ONE)
 This API is used to set the sink capability of the GRL-USB-PD-C2/F1 controller. This is applicable only when the controller mode is set as Sink or DRP.
 
int SetGroupSinkCapability (SinkCapability objSinkCapability, ControllerPort port=ControllerPort.ONE, SOP_TYPE sopType=SOP_TYPE.SOP)
 This API is used to set the group of sink cap's.
 
int SetSinkRequestMessage (RequestMessage objRequest, ControllerPort port=ControllerPort.ONE)
 This API is used to set the sink request message during the PD contract negotiations. Once the GRL-USB-PD-C2 controller receives the source capability.
 
int SetControllerMode (ControllerMode mode, ControllerPort port=ControllerPort.ONE)
 This API is used to set the GRL-USB-PD-C2 controller mode as Source, Sink or DRP along with all related functionalities such as SourceCapability, SinkCapability etc. to allow the controller to send the required capabilities when requested by another PD device.
 
int SetRpValue (RpValue rpVal, ControllerPort port=ControllerPort.ONE)
 This API is used to set Rp value of the C2 Controller when it is set to Source mode Note: Using cable set API (UseTesterCable(EmulateCableOn.CC1)) you can define Rp value on CC1 or CC2.
 
int SetVendorDefinedMessageResponse (VDM_CMD cmdType, VendorDefinedMessage responseMessage, SOP_TYPE sopType=SOP_TYPE.SOP, ControllerPort port=ControllerPort.ONE)
 This API is used to set Payload details of VDM message responded by USB-PD-C2 controller.
 
int SetTesterCableDropCompensation (bool compensateCableDrop)
 This API is used to Configure Tester to enable or disable the cable drop compensation in VBUS/VCONN voltage measurements This API is applicable only for GRL-SPL cable.
 
int SetBatteryStatusMessage (BatteryStatusMesaage batteryStatusMesaage, BatteryStatus batteryStatus, bool InvalidBatteryReference=false, bool BatteryisPresent=false, double BatteryPresentCapacity=0, ControllerPort port=ControllerPort.ONE)
 Sets the Battery Status Messages to be sent as Runtime messages.
 
int SetVbusVoltage (double voltageInVolt, double currentLimitInAmps, ControllerPort port=ControllerPort.ONE)
 This API is used to set the VBus voltage. Ensure that the GRL-USB-PD-C2/F1 controller mode is set as a Source before setting the voltage. After setting the voltage you may need to turn On the voltage switch using the SetVbusState function.
 
int SetNotToSendRequestMessageResponse (MsgType msgType, bool dontSendResponse, ControllerPort port=ControllerPort.ONE)
 This API is used to disables the GRL-USB-PD-C2/F1 controller from sending response messages to any particular message requests.
 
int SetControllerCurrentLimit_Type_C_Only_Mode (double cur_mA, ControllerPort port=ControllerPort.ONE)
 This API should be invoked after setting the controller mode to ControllerMode.Type_C_Only_SRC To set currnt limit.
 
bool SetBISTSharedTestEntryMode (BIST_TYPE bistType=BIST_TYPE.Reserved, SOP_TYPE sopType=SOP_TYPE.SOP)
 This API is used to send BIST Shared Test Entry Mode message.
 
bool SetBISTSharedTestExitMode (BIST_TYPE bistType=BIST_TYPE.Reserved, SOP_TYPE sopType=SOP_TYPE.SOP)
 This API is used to send BIST Shared Test Exit Mode.
 
bool SetMessagePayload (params byte[] payloadInByte)
 This API is used to set payload for Data/Extended messages.
 
int SetSnifferMode (bool enableSnifferMode, bool IsGRL_SPL_TestCable_UsedOnBothC2Ports=false)
 This API allows user to enable/disable the sniffer mode When sniffer was enabled, controller will capture VBUS/CC1/CC2 details exchanged between devices connected between Port1 and extension slot. When sniffer was enabled, controller will be set to default working mode This API allows user to enable/disable the sniffer mode When sniffer was enabled, controller will capture VBUS/CC1/CC2 details exchanged between devices connected between Port1 and extension slot. When sniffer was enabled, controller will be set to default working mode.
 
bool SetTriggerOutput (int TriggerPulseDurationInMicroSeconds=300)
 This API is used to set the output trigger with pulse signal.
 
int SetTesterAsQuickChargeSink (bool enableQCMode, bool enablePDSupportInQCMode)
 This API is used to set tester as quick charge sink device.
 
int SetQCVoltageChangeRequest (int Voltage)
 This API is used to request QC sink DUT to change the voltage level to 5V, 9V, 12V or 20V.
 
int SetQCVoltageIncrementRequest_200mV ()
 API to increase VBUS voltage level by 200mV by sending pulses over D+ line.
 
int SetQCVoltageDecrementRequest_200mV ()
 This API is used to decrease VBUS voltage level by 200mV by sending pulses over D- line.
 
int SetVconnLoadCurrent (double Vconn_Current, VCONNLoading vCONNLoading=VCONNLoading.VCONN_TO_CC2, ControllerPort port=ControllerPort.ONE)
 This API is used to set VCONN Current, Either CC1 or CC2.
 
bool SetDRswapConfiguration (DR_SWAP_ENUM dR_SWAP)
 This API is used to send the response message to DR_SWAP message Send = 1, Accept = 2, Send_Accept = 3, NONE.
 
bool SelectCableType (CableType cableType, ControllerPort port=ControllerPort.ONE)
 This API is used to configure the type of cable.
 
bool SetOverCurrentProtection (bool enableOCP, bool enableCurrentLimit, int setOCPValue)
 This API is used to set over current protection value of C2 controller.
 
bool SetControllerConfiguration (ControllerConfigEnum controllerConfigEnum, ControllerPort port=ControllerPort.ONE)
 This API is used for configuring the C2 controller mode.
 
bool SetVconnVoltage (double voltage, ControllerPort port=ControllerPort.ONE)
 This API is used for the configuring the VCONN voltage on CC1 or CC2 line.
 
bool Set_Dplus_Voltage (double voltage)
 This API is used to configure the minimum and maximum voltage in Programmable Power Supply (PPS).
 
bool Set_Dminus_Voltage (double voltage)
 This API is used to configure the minimum voltage in Programmable Power Supply (PPS).
 
bool SetAutoTestMode (bool bIsEnable, ControllerPort por=ControllerPort.ONE)
 This API is used to set auto test mode in GRl C2 controller.
 
void SetFRSwapDetection (bool isFRSwapEnable=true)
 This API used to Set FRSwap signal detect configuration.
 
void SetControllerIndex (int controllerIndex)
 This API isused to set controller index.
 
bool SetCableType (int cableType=0, ControllerPort port=ControllerPort.ONE)
 This API is used to set the cable type.
 
void SetPd_Controller (PD_Controller pdCtrler)
 This API is used for configuring the PD parameters to their default values.
 
void SetDataStreamService (DataStreamService dataStream)
 This API is used to configure the parameters of the Data Stream service .
 
void SetC2Sniffer (C2SnifferNew c2SniffObj)
 This API is used to configure the C2 browser app in SNIFFER mode.
 
bool SetVconnVoltage (double dVconnVolt, VCONNLoading vconnComm, ControllerPort port=ControllerPort.ONE)
 This API is used to set the tester Vconn voltage either CC2 or CC1.
 

Public Attributes

DataStreamService m_C2DataCenter
 
string m_C2SerialNumber = ""
 
APIValidationHelper ApiHelper
 
System.Timers.Timer startCaptureTimer
 
bool bIsResultUpdatedOnce = false
 
TestResult SecTestResult = TestResult.NA
 
string TestDesc = ""
 
string StrManufactureTxt = "X"
 
string StrModalNoTxt = "X"
 
string StrSerialNoTxt = "X"
 
string StrTestLabTxt = "X"
 
string StrRemarksTxt = "X"
 
string StrTestEngTxt = "X"
 
bool m_SelectEyeDiagram = false
 
bool m_SelectSaveedImages = false
 
bool m_SelectPacketList = false
 
bool m_SelectTestResults = false
 
bool m_IsPacketSelected = false
 
int m_iSelectedPktIndex = 0
 
bool m_SelectCSV = false
 
bool m_SelectPDF = true
 
bool m_SelectHTML = true
 
bool m_SelectXML = false
 
bool m_SelectCopyWfmFiles = false
 
bool m_OpenReportFile = false
 
string mFileName = ""
 
string mFileNameCSVSummary = ""
 
bool m_SelectProperty = false
 
string m_TableScreen = "ScreenShot"
 
string m_ReportLocation = ""
 
PDMessage DutCaps_Source = null
 
List< byte > MsgPayload = null
 

Properties

String IpAddress [get, set]
 

Member Function Documentation

◆ AddPlotDisplayList()

List< MeasurementChannel > GrlC2ApiLib.GrlC2Controller.AddPlotDisplayList ( MeasurementChannel channel)

Adds display channels to the existing plot. This function needs to be called before calling the Show Plot function.

Parameters
channelChannel to be added in plot
Returns
Updated measurement list

◆ AddTracesToController()

bool GrlC2ApiLib.GrlC2Controller.AddTracesToController ( ControllerPort port = ControllerPort::ONE)

Use this API to add the traces to GRL_USB_PD_C2 tester.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
True - Successfully added traces to controller, False - Failure in adding traces

◆ Attach()

int GrlC2ApiLib.GrlC2Controller.Attach ( ControllerPort port = ControllerPort::ONE)

Enables the GRL-USB-PD-C2 controller to be programmatic controlled when plugged in with the DUT.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ AttachController()

void GrlC2ApiLib.GrlC2Controller.AttachController ( int controllerIndex,
CommunicationPORT commPort )

Use this API to Attach selective port.

Parameters
controllerIndexSet controller index eg:"0"
commPortGrlUsbPdControllerLib.CommunicationPORT eg:CommunicationPORT.Port_B_Comm

◆ Bit_Manipulation_Response_Check()

bool GrlC2ApiLib.GrlC2Controller.Bit_Manipulation_Response_Check ( MsgType msgType,
SpecRevision specRev,
SOP_TYPE sopType,
int iErrorType,
bool extHeader = false,
int txTimerInMilliSec = 500 )

This API used for the manipulating the BIT (conversion) to required BIT.

Parameters
msgTypeSet the message type in this parameter of type "GrlPdLib.MsgType"
specRevSet the SpecRevision type in this parameter of type "SpecRevision"
sopTypeSet the SOP_TYPE type in this parameter of type "SOP_TYPE"
iErrorTypeSend the int value of error type
extHeaderSend the extended header is present or not True for extended header ; False for not extended header
txTimerInMilliSecsend the how much delay required after transmitting the previous command in ms
Returns

◆ CCLineStreamingTimerReset()

void GrlC2ApiLib.GrlC2Controller.CCLineStreamingTimerReset ( int controllerIndex)

Use this API to reset streamer time.

Parameters
controllerIndexSet controller index eg:"0"

◆ ClearCaptureData()

void GrlC2ApiLib.GrlC2Controller.ClearCaptureData ( )

Use this API to clear captured data.

◆ ClearDutInfo()

void GrlC2ApiLib.GrlC2Controller.ClearDutInfo ( ControllerPort port = ControllerPort::ONE)

This API is used for Clear the attributes of dut type.

Parameters
portGRL-USB-PD-C2/GRL-USB-PD-F1's Port 1 or Port 2. Default is Port 1

◆ ClearPDMessages()

int GrlC2ApiLib.GrlC2Controller.ClearPDMessages ( ControllerPort port = ControllerPort::ONE,
int iMsgCntToClear = 0 )

Clears all captured messages from the PD message capture memory on the GRL-USB-PD-C2/F1 controller. It is recommended to clear the memory before starting a new test to avoid any buffer overflow.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ ClearPlotDisplayList()

List< MeasurementChannel > GrlC2ApiLib.GrlC2Controller.ClearPlotDisplayList ( )

Clears existing plots of the display channels to make way for creating a new list of channels The new list of channels needs to be created before calling the Show Plot function which otherwise will display Port A VBus and Port A VBus Current channels by default.

Returns
Updated channel list

◆ Config_CC1_Channel()

void GrlC2ApiLib.GrlC2Controller.Config_CC1_Channel ( ControllerPort port = ControllerPort::ONE)

This API used for configuring the CC1 channel data.

Parameters
portConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1

◆ Config_CC2_Channel()

void GrlC2ApiLib.GrlC2Controller.Config_CC2_Channel ( ControllerPort port = ControllerPort::ONE)

This API used for configuring the CC2 channel data.

Parameters
portConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1

◆ Config_HSADC()

bool GrlC2ApiLib.GrlC2Controller.Config_HSADC ( ControllerPort port = ControllerPort::ONE)

This API used to configure the HSADC data.

Parameters
port
Returns
True - Configured successfully ;False - failed to Configured

◆ ConfigCC1_HSADC()

void GrlC2ApiLib.GrlC2Controller.ConfigCC1_HSADC ( ControllerPort controllerPort = ControllerPort::ONE)

This API used for configuring the CC1 amd HSADC channel data.

Parameters
controllerPortConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1

◆ ConfigCC2_HSADC()

void GrlC2ApiLib.GrlC2Controller.ConfigCC2_HSADC ( ControllerPort controllerPort = ControllerPort::ONE)

This API used for configuring the CC2 amd HSADC channel data.

Parameters
controllerPortConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1

◆ ConfigPS_Ready_Delay()

bool GrlC2ApiLib.GrlC2Controller.ConfigPS_Ready_Delay ( PS_RDY_Type psRdyType,
uint delayInmSec = 0,
bool setDefaultTimer = true )

This API is used to configure delay for PS_RDY message.

Parameters
psRdyType0-GrlUsbPdControllerLib.PS_RDY_Type.PSR_PD_Contract, 1-GrlUsbPdControllerLib.PS_RDY_Type.PSR_PRS1, 2-GrlUsbPdControllerLib.PS_RDY_Type.PSR_PRS2, 3-GrlUsbPdControllerLib.PS_RDY_Type.PSR_VCONN, 4-GrlUsbPdControllerLib.PS_RDY_Type.FRS_PSR_OffTimer, 5-GrlUsbPdControllerLib.PS_RDY_Type.FRS_PSR_ONtimer, 6-GrlUsbPdControllerLib.PS_RDY_Type.FRSwap_Message_Delay
delayInmSecDelay in milli seconds eg: 100 millisec
setDefaultTimerTrue - Used default timer value, False - Used configured (delayInmSec) value
Returns
True - Configured successfully,False - Failed in configuration

◆ ConfigReplaceMessage()

bool GrlC2ApiLib.GrlC2Controller.ConfigReplaceMessage ( bool setDefault,
MsgType actualMsg,
MsgType replaceMsg,
Type_of_Msg msgTypeAct,
Type_of_Msg msgTypeReplace )

This API used to configure replace message.

Parameters
setDefaultSet the dafault value of message
actualMsgpresent message
replaceMsgreplace massage type
msgTypeActSend the type present message type which means control or data message
msgTypeReplaceSend the type replace message type which means control or data message
Returns
True - Configured successfully;False - Failed in configuration

◆ ConfigReplaceMessageCount()

bool GrlC2ApiLib.GrlC2Controller.ConfigReplaceMessageCount ( int iCount)

To configure replace message count.

Parameters
iCountcount value
Returns
true: configured succesfully;False- failed in configuration

◆ Configure_GlitchAfterAttach_Msg()

bool GrlC2ApiLib.GrlC2Controller.Configure_GlitchAfterAttach_Msg ( int iGlitch_Duration,
ControllerPort port = ControllerPort::ONE )

This API is used to generate the Glitch in CC Line.

Parameters
iGlitch_DurationConfigure Duration of Glitch in milisecond
Returns
true - Configured succesfully;false - faliure in Configuration

◆ Configure_Message_To_AMS_Interupt()

bool GrlC2ApiLib.GrlC2Controller.Configure_Message_To_AMS_Interupt ( bool setdefault,
MsgType ExpectedMessage,
MsgType ConfiguredMessage,
Type_of_Msg ExpectedMessageType,
Type_of_Msg ConfiguredMessageType,
SOP_TYPE sopType = SOP_TYPE::SOP,
bool interruptTxMsg = false,
ControllerPort port = ControllerPort::ONE )

This API is used to interrupt the AMS for Interptible and Uninterptible message.

Parameters
setdefaulttrue- set default Value, false - set configured Value
ExpectedMessageThis is actual message send by Tester or DUT
ConfiguredMessageThis is Configured Message to interrupt the AMS
ExpectedMessageTypeThis is Type of actual message, for ex:Control,Data,Extended
ConfiguredMessageTypeThis is Type of Configured message, for ex:Control,Data,Extended
sopTypeSOP type - default is SOP_TYPE.SOP
interruptTxMsgtrue-Tester sending interrupt message after Tester message false-Tester sending interrupt message after DUT message
Returns
True-Configured succesfully ;False - faliure in Configuration

◆ ConfigureADC()

void GrlC2ApiLib.GrlC2Controller.ConfigureADC ( LSADC_Channel channels,
bool LSADC0En,
bool LSADC1En,
bool LSADC2En )

This API used for configuring the ADC channel data.

Parameters
channelsSet the channel to configure the ADC data
LSADC0EnSend the "LSADC0En" value as true to read the channel zero'th channel, True for enable , false for disable
LSADC1EnSend the "LSADC1En" value as true to read the channel first channel.True for enable , false for disable
LSADC2EnSend the "LSADC2En" value as true to read the channel second channel. True for enable , false for disable

◆ ConfigureAutoTestMode_MaxPower()

bool GrlC2ApiLib.GrlC2Controller.ConfigureAutoTestMode_MaxPower ( CableType cable,
PortDataRole datRle_Tester,
Port_Power_Role powRle_Tester,
ControllerPort por = ControllerPort::ONE )

This API is used to configure controller mode, set cable type and tester will draw max power supported by DUT.

Parameters
cableCable type
datRle_Testerdata role of the tester
powRle_Testerpower role of the tester
porController port
Returns
True - Configured successfully;False - Failed in configuration

◆ ConfigureAutoTestMode_UserDefined()

bool GrlC2ApiLib.GrlC2Controller.ConfigureAutoTestMode_UserDefined ( CableType cable,
PortDataRole datRle,
Port_Power_Role powRle,
PowerSupplyType supty,
int iPDOInd,
double dVoltage_mV,
double dCurrent_mA,
int iEloadHandle,
int iEloadMode,
int iEloadPercent,
ControllerPort por = ControllerPort::ONE )

This API is used to configure controller mode, set cable type, and load current details when controller is operating in auto test mode.

Parameters
cableCable type
datRleData role
powRlePower role
suptySupply type
iPDOIndPDO index
dVoltage_mVVoltage
dCurrent_mACurrent
iEloadHandleEload handle
iEloadModeEload mode
iEloadPercentEload percent
porController port
Returns
True - Configured successfully;False - Failed in configuration

◆ ConfigureControlMessageResponse()

int GrlC2ApiLib.GrlC2Controller.ConfigureControlMessageResponse ( MsgType receivedMessageType,
ResponderMessageType responseMessageType,
ControllerPort port = ControllerPort::ONE )

Configures response messages for the GRL-USB-PD-C2/F1 controller.

Parameters
receivedMessageTypeMessage type received by the controller for which response configuration is required Supported message types for this function
  1. VconnSwap.
  2. DRSwap.
  3. PRSwap.
  4. FRSwap.
responseMessageTypeConfigure message type to be responed for a message(msg) received by controller. Accept or Reject is set for the message type
portDecides the port one/two.
Returns
0 = Success 1 = Fail

◆ ConfigureEload()

int GrlC2ApiLib.GrlC2Controller.ConfigureEload ( double maxCurrentInAmps,
EloadChannel eloadChannel,
SwitchState state,
VCONNLoading vCONNLoading = VCONNLoading::Disable_VCONN,
ControllerPort pORT = ControllerPort::ONE )

API to use configure the Eload.

Parameters
maxCurrentInAmpsconfigure maximum current Amps
eloadChannelconfigure Eload channel
stateSwitch state ON/OFF ON-To turn ON the Eload OFF- To turn OFF the Eload
vCONNLoadingconfigure Vconn in which channel it need's to be
pORTconfigure the Port 1 or 2
Returns
-1 Failure in the configuration : 0 is pass

◆ ConfigureEloadinGroup()

int GrlC2ApiLib.GrlC2Controller.ConfigureEloadinGroup ( double maxCurrentInAmps,
EloadChannel eloadChannel,
SwitchState state,
VCONNLoading vCONNLoading = VCONNLoading::Disable_VCONN,
ControllerPort pORT = ControllerPort::ONE,
SOP_TYPE sopType = SOP_TYPE::SOP )

API to use configure the Eload in group.

Parameters
maxCurrentInAmpsconfigure maximum current Amps
eloadChannelconfigure Eload channel
stateSwitch state ON/OFF ON-To turn ON the Eload OFF- To turn OFF the Eload
vCONNLoadingconfigure Vconn in which channel it need's to be
pORTconfigure the Port 1 or 2
sopTypeConfigure SOP type
Returns
-1 Failure in the configuration ;0-is pass

◆ ConfigurePacketDelay()

void GrlC2ApiLib.GrlC2Controller.ConfigurePacketDelay ( MsgType delayMsgType,
Type_of_Msg MessageType,
double dDelay_mS,
bool bEnableDelay )

This API used for Set the packet delay in milli seonds.

Parameters
delayMsgTypeMessage Type at which the delay will be inserted
MessageTypeMessage category, Control or Data message
dDelay_mSDelay in milli seconds
bEnableDelayEnable or disable the delay, True or False

◆ ConfigureReplacePDMessageInGroup()

bool GrlC2ApiLib.GrlC2Controller.ConfigureReplacePDMessageInGroup ( bool setDefault,
MsgType actualPdMsgType,
MsgType replaceWithPdMsgType,
Type_of_Msg msgTypeOfActualPdMsgType,
Type_of_Msg msgTypeOfReplacePdMsgType,
int txTimerInMilliSec )

Use this API to replace one PD message with another PD message. Once configured messages please use this API to execute configured messages."GroupMessageConfigure".

Parameters
setDefaultTrue- Set default message, False - Replace configured message
actualPdMsgTypeGrlPdLib.MsgType
replaceWithPdMsgTypeGrlPdLib.MsgType
msgTypeOfActualPdMsgTypeGrlUsbPdControllerLib.Type_of_Msg
msgTypeOfReplacePdMsgTypeGrlUsbPdControllerLib.Type_of_Msg
txTimerInMilliSecDelay before initiate configured mesage Ex:10 (Configured message initiate after 10ms)
Returns
True - Configured successfully;False - Failed to configure

◆ ConfigureSoftResetResponse()

bool GrlC2ApiLib.GrlC2Controller.ConfigureSoftResetResponse ( int respMsgVal,
int txTimerInMilliSec )

Use this API to send SoftReset Response.

Parameters
respMsgVal0x00 - No response from Tester, 0x01 - Tester responds with Reject message, 0x02 - Tester responds with Not_Supported message
txTimerInMilliSecSet the message delay in this parameter in milli seconds
Returns
true- configured succesfully;False - Failed in configuration

◆ ConfigureSoftResetResponseForVDMMsg()

bool GrlC2ApiLib.GrlC2Controller.ConfigureSoftResetResponseForVDMMsg ( int respMsgVal,
SOP_TYPE sOP_TYPE,
int txTimerInMilliSec )

Use this API to send SoftReset Response for Vendor Defined Message.

Parameters
respMsgVal1-Send Soft Reset for Discover Identity 0- Do not send 2-Send Soft Reset for Discover SVID 0- Do not send 3-Send Soft Reset for Discover Mode 0- Do not send 4-Send Soft Reset for Enter Mode 0- Do not send 5-Send Soft Reset for Exit Mode 0- Do not send
sOP_TYPEConfigure type of SOP
txTimerInMilliSecSet the message delay in this parameter in milli seconds
Returns
True - Configured succesfully;False - faliure in Configuration.

◆ CreatePlotDisplayList()

List< MeasurementChannel > GrlC2ApiLib.GrlC2Controller.CreatePlotDisplayList ( MeasurementChannel channel = MeasurementChannel::END)

Creates default plots for the display channels. Using the add or clear list functions will enable adding display channels to the plot. You will need to create the display channel list before calling the Show Plot function.

Parameters
channelChannel to be added for plot
Returns
Updated channel list

◆ CreateReportFolder()

bool GrlC2ApiLib.GrlC2Controller.CreateReportFolder ( )

Use this API to Create report folder.

Returns
true- Created succesfully

◆ DebugLogger()

void GrlC2ApiLib.GrlC2Controller.DebugLogger ( string discription,
Exception ex )

Saves all the Exception in text file in Location C:\GRL\Appdata.

Parameters
discriptionDetails of method


Parameters
exException

◆ Detach()

int GrlC2ApiLib.GrlC2Controller.Detach ( ControllerPort port = ControllerPort::ONE)

Enables the GRL-USB-PD-C2/F1 controller to be programmatically controlled when removing the attached DUT.
This function removes all the Rp/Rd values from the CC line and changes the state of the controller to Source Detach or Sink Detach. It is recommended to call this Detach function before configuring the controller mode, setting the source sink and source capabilities and calling the Attach function.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Success

◆ DetachController()

void GrlC2ApiLib.GrlC2Controller.DetachController ( int controllerIndex,
CommunicationPORT commPort )

Use this API to Detach selective port.

Parameters
controllerIndexSet controller index eg:"0"
commPortGrlUsbPdControllerLib.CommunicationPORT eg:CommunicationPORT.Port_B_Comm

◆ DisposeGRLControllerLink()

bool GrlC2ApiLib.GrlC2Controller.DisposeGRLControllerLink ( int controllerIndex)

Use this API to Disable the GRLController ethernet connection.

Parameters
controllerIndex
Returns
True = Success

◆ EmulateQCSource()

void GrlC2ApiLib.GrlC2Controller.EmulateQCSource ( bool enableQcSource)

API to emulate Tester as QC source.

Parameters
enableQcSourceTrue Tester as QC Source false -Tester as QC source falls

◆ EnableLSADCDebugLog()

void GrlC2ApiLib.GrlC2Controller.EnableLSADCDebugLog ( bool enable)

This API used for the enabling the LSADC Debug log write.

Parameters
enableSet the read enable . True -enable ,False-disable

◆ EnableQcLegacyMode()

bool GrlC2ApiLib.GrlC2Controller.EnableQcLegacyMode ( bool enable)

Sets the Controller to QC Legacy Mode.

Parameters
enableTrue - Enable ,False - Disable
Returns
True = Success. False = Fail.

◆ EnableReadDebugLogger()

void GrlC2ApiLib.GrlC2Controller.EnableReadDebugLogger ( bool enable)

This API used for the enabling the LSADC Debug log Read.

Parameters
enableSet the read enable . True -enable ,False-disable

◆ FloatBothDpDn()

bool GrlC2ApiLib.GrlC2Controller.FloatBothDpDn ( )

Sets trhe Controller to QC Legacy Mode.

Returns
True = Success. False = Fail.

◆ FloatDpDn()

bool GrlC2ApiLib.GrlC2Controller.FloatDpDn ( bool enable)

Float DPlus and Dminus.

Parameters
enableFalse - Float Dplus, True - Float Dminus
Returns
True = Success. False = Fail.

◆ GetAssertionMessages()

dynamic GrlC2ApiLib.GrlC2Controller.GetAssertionMessages ( ControllerPort port = ControllerPort::ONE)

This API is used to get All Assertions messages.

Parameters
portGrlPdLib.ControllerPort
Returns
Collection of GrlPdLib.PDMessage

◆ GetAssertionMsg()

dynamic GrlC2ApiLib.GrlC2Controller.GetAssertionMsg ( ControllerPort port = ControllerPort::ONE,
MsgTypeSec msgTypeSec = MsgTypeSec::NONE,
int iOccur = 1 )

This API is used to get one Assertion message.

Parameters
portGrlPdLib.ControllerPort
msgTypeSecGrlPdLib.MsgTypeSec
iOccurAssertion message occurnace
Returns
Object of GrlPdLib.PDMessage

◆ GetAssertionPDMsg()

dynamic GrlC2ApiLib.GrlC2Controller.GetAssertionPDMsg ( ControllerPort port = ControllerPort::ONE,
MsgTypeSec msgTypeSec = MsgTypeSec::NONE,
int iOccur = 1 )

This API is used to get one Assertion message.

Parameters
portGrlPdLib.ControllerPort
msgTypeSecGrlPdLib.MsgTypeSec
iOccurAssertion message occurnace
Returns
Object of GrlPdLib.PDMessage

◆ GetCableCapability()

VendorDefinedMessage GrlC2ApiLib.GrlC2Controller.GetCableCapability ( ControllerPort port = ControllerPort::ONE)

Returns the capabilities of e marker cable connected to GRL-USB-PD-C2 controller.

Parameters
portC2 Controller's port, Default parameter is PORT1
Returns
VendorDefinedMessage of the device

◆ GetCaptureStatus()

int GrlC2ApiLib.GrlC2Controller.GetCaptureStatus ( )

This API is used to determine whether the streamer has started or not.

Returns
0 - Data Capture is Started. 1 - Data Capture is Stopped.

◆ GetCCLineActive()

int GrlC2ApiLib.GrlC2Controller.GetCCLineActive ( )

Used this API to get active communication line(CC)

Returns
If 0 - No CC line else return CC line found

◆ GetCommandExecutionStatus()

int GrlC2ApiLib.GrlC2Controller.GetCommandExecutionStatus ( )

Returns the execution status of last API.

Returns
0: Last API execution completed 1: Last API execution in progress -1: Connection error

◆ GetConnectionStatus()

int GrlC2ApiLib.GrlC2Controller.GetConnectionStatus ( )

This API is used to get the Connection Status of the PD controller. If the PD controller is connected this function returns connected.

Returns
0 if Connected 1 if Connection Error.

◆ GetControllerMode()

ControllerMode GrlC2ApiLib.GrlC2Controller.GetControllerMode ( ControllerPort port = ControllerPort::ONE)

This API is used to get the GRL-USB-PD-C2/F1 controller mode during PD contract negotiations.

Returns
Controller mode as Source, Sink or DRP

◆ GetDplusCurrent()

double GrlC2ApiLib.GrlC2Controller.GetDplusCurrent ( )

This API used to get the current value based on the port.

Returns
Return the current value in milliamperes (mA).

◆ GetDutExtendedSourceCapability()

SourceCapability GrlC2ApiLib.GrlC2Controller.GetDutExtendedSourceCapability ( ControllerPort port = ControllerPort::ONE)

This API is used to get Extended Source Capabilities from the connected Source DUT. If the connected DUT is not a Source device, it will return null.

Parameters
portC2 Controller's port, Default parameter is PORT1
Returns
SourceCapability of the device

◆ GetDutSinkCapability()

SinkCapability GrlC2ApiLib.GrlC2Controller.GetDutSinkCapability ( ControllerPort port = ControllerPort::ONE)

This API is used to get Sink Capabilities from the Sink DUT. If the connected DUT is not Sink device, it will return null.

Parameters
portC2 Controller's port, default parameter is PORT1
Returns
Sink Capabilities of the device

◆ GetDutSourceCapability()

SourceCapability GrlC2ApiLib.GrlC2Controller.GetDutSourceCapability ( ControllerPort port = ControllerPort::ONE)

This API is used to get Source Capabilities from the connected Source DUT. If the connected DUT is not a Source device, it will return null.

Parameters
portC2 Controller's port, Default parameter is PORT1
Returns
SourceCapability of the device

◆ GetEloadVersion()

string GrlC2ApiLib.GrlC2Controller.GetEloadVersion ( )

Get C2 Eload version.

Returns
C2 Elaod Version

◆ GetFirmwareVersion()

string GrlC2ApiLib.GrlC2Controller.GetFirmwareVersion ( )

This API is used to get C2 Firmware version.

Returns
C2 FW version

◆ GetHSADCValue()

double GrlC2ApiLib.GrlC2Controller.GetHSADCValue ( )

API to get the HSADC data.

Returns
Return the HSADC in double value

◆ GetListOfPDOFromPDMessage()

int GrlC2ApiLib.GrlC2Controller.GetListOfPDOFromPDMessage ( List< PDMessage > msgCollec)

Use this API to get list of PDO's sent by DUT.

Parameters
msgCollecCollection of GrlPDLib.PDMessage
Returns
If 0 = No PDO, else return PDO counts

◆ GetMeasurementValue()

double GrlC2ApiLib.GrlC2Controller.GetMeasurementValue ( MeasurementChannel channel,
double dTimeInSeconds )

This API is used to Get the measurement value.

Parameters
channelGRLSharedModule.MeasurementChannel
dTimeInSecondsTime of PDMessage.
Returns
Value of channel at that specified time.

◆ GetMessages()

List< PDMessage > GrlC2ApiLib.GrlC2Controller.GetMessages ( ControllerPort port = ControllerPort::ONE,
bool includeAllBusEvents = true )

Provides all the PD messages received or sent by the GRL-USB-PD-C2/F1 controller. To enable the PD message capture capability of the controller, the data streamer needs to be configured first. Refer to the StartDataStreamer function for more details on how to set up the streamer.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
includeAllBusEventsTrue- Get PDmessages from totalPDMessage, false- Get from CCline message list
Returns
returns list of PDMessages

◆ GetPDMessage()

dynamic GrlC2ApiLib.GrlC2Controller.GetPDMessage ( ControllerPort port = ControllerPort::ONE,
MsgType msgType = MsgType::NONE,
int iOccur = 1 )

Use this API to get PD message from the controller.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
msgTypePD msg from the controller
iOccurTo check the occurence of PD msg
Returns
Return PD Message

◆ GetPDMessageFromIndex()

PDMessage GrlC2ApiLib.GrlC2Controller.GetPDMessageFromIndex ( int iMsgInd,
ControllerPort port = ControllerPort::ONE )

Use this API to get PD msg from index.

Parameters
iMsgIndCheck the message index
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
returns list PDMessage from Index

◆ GetPDMessages()

List< PDMessage > GrlC2ApiLib.GrlC2Controller.GetPDMessages ( ControllerPort port = ControllerPort::ONE)

Use this API to get CC line msg from the controller.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
Return PD message

◆ GetPDMsg()

dynamic GrlC2ApiLib.GrlC2Controller.GetPDMsg ( ControllerPort port = ControllerPort::ONE,
MsgType msgType = MsgType::NONE,
int iOccur = 1 )

This API is used to get one PD Message.

Parameters
portGrlPdLib.ControllerPort
msgTypeGrlPdLib.MsgType
iOccurPDMessage occurance
Returns
Object of GrlPdLib.PDMessage

◆ GetPdStatus()

int GrlC2ApiLib.GrlC2Controller.GetPdStatus ( ControllerPort port = ControllerPort::ONE)

This API is used to get the PD contract negotiation status.

Returns
1 = Attached 0 = Detached -1 = Error

◆ GetPlotDisplayList()

List< MeasurementChannel > GrlC2ApiLib.GrlC2Controller.GetPlotDisplayList ( )

This API is used to display the plot .

Returns
Return Updated channel list

◆ GetPresentMeasurementValue() [1/3]

dynamic GrlC2ApiLib.GrlC2Controller.GetPresentMeasurementValue ( )

This API is used to get the voltage and current measurement value.

Returns
Values of voltage and current channel

◆ GetPresentMeasurementValue() [2/3]

List< LSADC_DataRead > GrlC2ApiLib.GrlC2Controller.GetPresentMeasurementValue ( List< MeasurementChannel > channel)

This API is used to get the voltage and current measurement value.

Parameters
channelGRLSharedModule.MeasurementChannel
Returns
List of GRLSharedModule.LSADC_DataRead value

◆ GetPresentMeasurementValue() [3/3]

double GrlC2ApiLib.GrlC2Controller.GetPresentMeasurementValue ( MeasurementChannel channel)

This API is used to get the current measurement value.

Parameters
channelGRLSharedModule.MeasurementChannel
Returns
Value of channel for current time. if Value is -1 then Error in measurement reading

◆ GetReportFolderPath()

string GrlC2ApiLib.GrlC2Controller.GetReportFolderPath ( )

Use this API to get the report folder path.

Returns

◆ GetSerialNumber()

string GrlC2ApiLib.GrlC2Controller.GetSerialNumber ( )

API to get the serial number of the C2 or C2-EPR tester.

Returns

◆ GetSourceCapabilityFromPDMessageObject()

SourceCapability GrlC2ApiLib.GrlC2Controller.GetSourceCapabilityFromPDMessageObject ( PDMessage pdMsg,
ControllerPort port = ControllerPort::ONE )

Convert PD Message to SourceCapability message.

Parameters
pdMsgGrlPdLib.PDMessage
portGrlPdLib.ControllerPort
Returns
Objcet of GrlPdLib.SourceCapability

◆ GetSourceCapPDO()

string GrlC2ApiLib.GrlC2Controller.GetSourceCapPDO ( ControllerPort port = ControllerPort::ONE)

API to Get sourcecap PDO details.

Parameters
portPort number as per the selection
Returns
Returns source cap message details

◆ GetTimeAtVoltageValue()

double GrlC2ApiLib.GrlC2Controller.GetTimeAtVoltageValue ( int channel,
double startTime = 0::0,
int timeIntervalInSec = 0,
double thresholdVal = 0::0,
bool isRisingEdge = false )

Use this API to get time at voltage value.

Parameters
channelSet the channel number to get the time value for respective channel like "(int)LSADC_Channel.PORTA_VBUS_CURRENT"
startTimeSet the start time of channel in between the stop and start time
timeIntervalInSecSet the time duration of the channel
thresholdValSet the threshold value which means actual voltage+manufacturer error voltage value
isRisingEdgeSet the true for rising edge ,false for not rising edge(falling edge)
Returns
Clock time for voltage value

◆ GetTimeDifferenceAtSignalChange()

double GrlC2ApiLib.GrlC2Controller.GetTimeDifferenceAtSignalChange ( int channel,
double stTime = 0::0,
int timeIntervalInSec = 0,
double thresholdVal = 0::0,
bool isRisingEdge = false,
ControllerPort port = ControllerPort::ONE,
MsgTypeSec msgTypeSec = MsgTypeSec::FR_Swap_Signal_Asserted )

API to get time Difference at signal change.

Parameters
channelConfigure channel number
stTimeconfigure start time
timeIntervalInSecconfigure time interval in seconds
thresholdValthreshold value
isRisingEdgeconfigure rising edge or falling edge
portCintroller port 1 or 2
msgTypeSecsecondary PDMessage type
Returns
returns the difference time at signal change

◆ GetTimeForVoltageValue()

double GrlC2ApiLib.GrlC2Controller.GetTimeForVoltageValue ( int channel,
double startTime = 0::0,
double timeIntervalInSec = 0,
double thresholdVal = 0::0,
bool isRisingEdge = false )

API to Get time for voltage value.

Parameters
channelchannel number
startTimestart time
timeIntervalInSectime interval in seconds
thresholdValThreshold value
isRisingEdgerising edge or falling edge
Returns
returns the time at voltage

◆ GetTotalPDMessageCount()

int GrlC2ApiLib.GrlC2Controller.GetTotalPDMessageCount ( ControllerPort port = ControllerPort::ONE)

Use this API to get Total PDmsg count.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
Return Total PDmessage count

◆ GroupCommand_Add()

int GrlC2ApiLib.GrlC2Controller.GroupCommand_Add ( GroupCommandAPIEnum cmdType,
object cmdInfo,
int iTimeDelayInMilliSec,
ControllerPort port = ControllerPort::ONE )

This API is used to configure GRLSharedModule.GroupCommandAPIEnum.

Parameters
cmdTypeConfigure GRLSharedModule.GroupCommandAPIEnum type ex:GroupCommandAPIEnum.Attach
cmdInfoMessage type
iTimeDelayInMilliSecdelay in milliseconds
portController port ControllerPort.ONE or ControllerPort.TWO
Returns
0 = Success. 1 = Fail.

◆ GroupCommand_Clear()

int GrlC2ApiLib.GrlC2Controller.GroupCommand_Clear ( )

This API used to clear group command configuration.

Returns
0 = Success;1 = Fail.

◆ GroupCommand_Run()

int GrlC2ApiLib.GrlC2Controller.GroupCommand_Run ( )

This API is used to configure the GroupCommand message correctly.

Returns
0 = Success;1 = Fail.

◆ GroupMessageAdd()

bool GrlC2ApiLib.GrlC2Controller.GroupMessageAdd ( MsgType pdMsgType,
SpecRevision specRev,
SOP_TYPE sopType,
bool extHeader = false,
int txTimerInMilliSec = 500,
List< byte > extHeaderPayload = null )

Use this API to add the messages into buffer.

Parameters
pdMsgTypeSet the message type in this parameter of type "GrlPdLib.MsgType"
specRevSet the message revision in this parameter of type "GrlPdLib.SpecRevision"
sopTypeSet the message SOP type in this parameter of type "GrlPdLib.SOP_TYPE"
txTimerInMilliSecSet the message delay in this parameter in milli seconds
Returns
True - Message configuration added successfully, False - Failed to add configuration

◆ GroupMessageClear()

bool GrlC2ApiLib.GrlC2Controller.GroupMessageClear ( )

Use this API to clear the messages in the buffer.

Returns
True - Cleared buffer; False - Failed to clear

◆ GroupMessageConfigure()

bool GrlC2ApiLib.GrlC2Controller.GroupMessageConfigure ( FwMsgCfgType cfgType)

Use this API to configure the message execution type whether to initiate the messages at the runtime or pre-configure the messages with time delay.

Parameters
cfgTypeThis parameter defines how the configured group of message gets executed IF set to "GrlUsbPdControllerLib.FwMsgCfgType.Runtime", then configured messages will get executed at the runtime, use this parameter to send messages after Attach() command IF set to "GrlUsbPdControllerLib.FwMsgCfgType.AfterPDC", then configured messages will get executed after the PD contract negotiation, use this parameter to pre-configure the group messages before Attach() command
Returns
Success: True - configured; False - failed to configure.

◆ InitialConfig()

void GrlC2ApiLib.GrlC2Controller.InitialConfig ( )

Use this API to configure Tester mode as Sink, Cable type as GRL_SPL_Cable in both ports (GrlPdLib.ControllerPort.ONE and GrlPdLib.ControllerPort.TWO)

Parameters
objControllerGrlPdApiLib.GrlC2Controller

◆ Initialize()

int GrlC2ApiLib.GrlC2Controller.Initialize ( String ipAddress,
int controllerIndex = 0,
bool isClearCommn = true )

Method to Initialize IP address and controllerIndex.

Parameters
ipAddressConfigure the Tester IP address
controllerIndexConfigure the Tester controller index
isClearCommnReset the communication
Returns
0 = Success 1 = fail to set

◆ Interruption_by_PD_Message()

bool GrlC2ApiLib.GrlC2Controller.Interruption_by_PD_Message ( )

Use this API to send Interruption by PD Message.

Returns
true - Configured succesfully false - faliure in Configuration

◆ PowerCycleTheTester()

bool GrlC2ApiLib.GrlC2Controller.PowerCycleTheTester ( )

Used this API to Power cycle the GRL_USB_PD_C2 tester.

Returns
Success: True - configured; False - failed to configure.

◆ QuickAttachPort()

void GrlC2ApiLib.GrlC2Controller.QuickAttachPort ( CommunicationPORT commPort,
byte[] buffData )

Use this API to Attach selective port in two controller.

Parameters
commPortGrlUsbPdControllerLib.CommunicationPORT eg:CommunicationPORT.Port_A_Comm
buffDataSet detach command bytes eg:0x18,0x01

◆ QuickDetachPort()

void GrlC2ApiLib.GrlC2Controller.QuickDetachPort ( CommunicationPORT commPort,
byte[] buffData )

Use this API to Detach selective port in two controller.

Parameters
commPortGrlUsbPdControllerLib.CommunicationPORT eg:CommunicationPORT.Port_A_Comm
buffDataSet detach command bytes eg:0x18,0x00

◆ RebootController()

int GrlC2ApiLib.GrlC2Controller.RebootController ( )

This API will reboot the GRL-USB-PD-C2 controller. Expected reboot time is 20-30 seconds. After calling this API, please re-initialize the ethernet connection by calling Initialize() API before calling any further API's.

Returns
0 = Success. 1 = Fail.

◆ Request_PortA_PortB()

void GrlC2ApiLib.GrlC2Controller.Request_PortA_PortB ( RequestMessage message)

Use this API to send Request message for both ports (GrlPdLib.ControllerPort.ONE and GrlPdLib.ControllerPort.TWO)

Parameters
messageGrlPdLib.RequestMessage

◆ Reset_PDPort()

bool GrlC2ApiLib.GrlC2Controller.Reset_PDPort ( ControllerPort port = ControllerPort::ONE)

Resets Port1 and Port2 of USB-PD-C2 controller.

Returns
True = Success;false = Fail.

◆ Reset_TestResultObject()

bool GrlC2ApiLib.GrlC2Controller.Reset_TestResultObject ( )

This API is used to Clear the test result.

Returns
Success: True - Clear; False - failed to clear.

◆ ResetController()

bool GrlC2ApiLib.GrlC2Controller.ResetController ( )

Use this API to reset the Controller.

Returns
true - Configured succesfully false - faliure in Configuration

◆ SaveHTMLForPDPackets()

void GrlC2ApiLib.GrlC2Controller.SaveHTMLForPDPackets ( string fileNameHTML,
string testName,
string testId,
bool isVoltageUpdate = false )

Used this API to Save PD protocol capture into .html file.

Parameters
fileNameHTMLPD protocol capture file Report path
testNamePD protocol capture file name
testIdPD protocol capture file test ID

◆ SaveHTMLForPDPacketsForFourPort()

void GrlC2ApiLib.GrlC2Controller.SaveHTMLForPDPacketsForFourPort ( List< PDMessage > pdMsgCollec,
string fileNameHTML,
string testName,
string testId,
bool isVoltageUpdate = false )

Used this API to Save four port PD protocol capture into .html file.

Parameters
pdMsgCollecMessage collection of GrlPdLib.PDMessage
fileNameHTMLPD protocol capture file Report path
testNamePD protocol capture file name
testIdPD protocol capture file test ID

◆ SaveHTMLForTestSummary()

void GrlC2ApiLib.GrlC2Controller.SaveHTMLForTestSummary ( string fileNameHTML,
string testName,
string testId )

Used this API to Save TestSummary into .html file.

Parameters
fileNameHTMLTestSummary file Report path
testNameTestSummary file name
testIdTestSummary file test ID

◆ SaveTestPDPacketInCSV()

bool GrlC2ApiLib.GrlC2Controller.SaveTestPDPacketInCSV ( List< PDMessage > msgColle,
string filename,
bool isVoltageUpdate = false )

Use this API to save all PD messages into CSV file.

Parameters
msgColleCollection of GrlPDLib.PDMessage
filename
isVoltageUpdate
Returns
True - File successfully saved False - Failure in file save

◆ SaveTestResultAndPDPacketInCSV()

bool GrlC2ApiLib.GrlC2Controller.SaveTestResultAndPDPacketInCSV ( string fileName,
ControllerPort port = ControllerPort::ONE )

Use this API to save all PD messages into CSV file.

Parameters
portGrlPdLib.ControllerPort
fileNamefileName as per the test name
Returns
True - File successfully saved False - Failure in file save

◆ SaveTestResultInCSV()

bool GrlC2ApiLib.GrlC2Controller.SaveTestResultInCSV ( PDTestResult baseTestResult)

Use this API to save validated PD Test Result into CSV file.

Parameters
baseTestResultUSB_PDModule.PDTestResult
Returns
True - File successfully saved False - Failure in file save

◆ SaveTraceFile()

bool GrlC2ApiLib.GrlC2Controller.SaveTraceFile ( string fileName)

Saves signal and protocol data into specified file.

Parameters
fileNameTrace file name
Returns
True = Success. false = Fail.

◆ SelectCableType()

bool GrlC2ApiLib.GrlC2Controller.SelectCableType ( CableType cableType,
ControllerPort port = ControllerPort::ONE )

This API is used to configure the type of cable.

Parameters
cableType
port
Returns
True - Configured successfully, False- Failure in configuration

◆ SendAssertionMessage()

bool GrlC2ApiLib.GrlC2Controller.SendAssertionMessage ( ControllerPort port = ControllerPort::ONE)

Use this API to send assertion message.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
true - Configured succesfully false - faliure in Configuration

◆ SendBISTCarrierMode()

bool GrlC2ApiLib.GrlC2Controller.SendBISTCarrierMode ( SOP_TYPE sopType)

This API used to send the BIST carrier mode.

Parameters
sopType
Returns
True-success ;False - faile

◆ SendBISTTestData()

bool GrlC2ApiLib.GrlC2Controller.SendBISTTestData ( SOP_TYPE sopType)

This API is used to send BISTCarrierMode message.

Parameters
sopTypeGrlPdLib.SOP_TYPE
Returns
True-success ;False - faile

◆ SendControlMessage()

int GrlC2ApiLib.GrlC2Controller.SendControlMessage ( MsgType msg,
ControllerPort port = ControllerPort::ONE )

Sends the control messages from the GRL-USB-PD-C2/F1 controller. Some of the messages you can send are.

This API used to send control PD messages

Parameters
msgGrlUsbPdControllerLib.MsgType
portGRL-USB-PD-C2/F1's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SendDataMessage()

void GrlC2ApiLib.GrlC2Controller.SendDataMessage ( MsgType msgType,
bool isDefaultPayload = true,
SOP_TYPE sopType = SOP_TYPE::SOP,
SpecRevision revision = SpecRevision::PD_3_0,
int noOfDataObjet = 1,
ControllerPort port = ControllerPort::ONE )

This API is used to Send Data messages. Alert, Get_Country_Info.

Parameters
msgTypeGrlPdLib.MsgType
isDefaultPayloadTrue - Default Payload, False - Configure payload using SetMessagePayload()
sopTypeGrlPdLib.SOP_TYPE SOP - Default SOP_TYPE
revisionGrlPdLib.SpecRevision PD3.0 - Default Revision
noOfDataObjet1 - Default PDO
portGrlPdLib.ControllerPort ONE - Default port

◆ SendEPRModemsg()

int GrlC2ApiLib.GrlC2Controller.SendEPRModemsg ( EPR_Mode_Message msg,
ControllerPort port = ControllerPort::ONE )

This function is to send EPR Mode message.

Parameters
msgConfigure EPRModemessage
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0 - Connection success 1 - Connection error

◆ SendEPRRequestMessage()

int GrlC2ApiLib.GrlC2Controller.SendEPRRequestMessage ( RequestMessage msg,
ControllerPort port = ControllerPort::ONE )

This function used to send EPRRequest message.

Parameters
msgConfigure request message
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0 - Connection success 1 - Connection error

◆ SendExtendedMessage()

void GrlC2ApiLib.GrlC2Controller.SendExtendedMessage ( MsgType msgType,
bool isDefaultPayload = true,
SOP_TYPE sopType = SOP_TYPE::SOP,
SpecRevision revision = SpecRevision::PD_3_0,
int noOfDataObjet = 1,
ControllerPort port = ControllerPort::ONE )

This API used to send Extended Message with Payload. Get_Manufacturer_Info, Get_Battery_Status, Get_Battery_Cap, Firmware_Update_Request, Security_Request.

Parameters
msgTypeGrlPdLib.MsgType
isDefaultPayloadTrue - Default Payload, False - Configure payload using SetMessagePayload()
sopTypeGrlPdLib.SOP_TYPE SOP - Default SOP_TYPE
revisionGrlPdLib.SpecRevision PD3.0 - Default Revision
noOfDataObjet1 - Default PDO
portGrlPdLib.ControllerPort ONE - Default port

◆ SendFRSwapSignal()

void GrlC2ApiLib.GrlC2Controller.SendFRSwapSignal ( )

Send FR_Swap signal from Tester.

◆ SendHardReset()

bool GrlC2ApiLib.GrlC2Controller.SendHardReset ( bool isFlip = false,
ControllerPort port = ControllerPort::ONE )

Use this API to send HardReset.

Parameters
isFliptrue -Hardreset with bit flip false- HardReset no bit flip
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
True- configured succesfully;False - Failed in configuration

◆ SendPdoRequestMessage()

int GrlC2ApiLib.GrlC2Controller.SendPdoRequestMessage ( RequestMessage msg,
ControllerPort port = ControllerPort::ONE )

This API used to sends the PDO request messages during the PD contract negotiations.

Parameters
msgConfigure the request PDO. Eg: AVS , FIXED,VARIABLE PDO'S
portConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SendRequestmessage_By_Index()

int GrlC2ApiLib.GrlC2Controller.SendRequestmessage_By_Index ( int iSourcePDOIndex,
ControllerPort port = ControllerPort::ONE )

This API is used to send request message by configuring source PDO index.

Parameters
iSourcePDOIndexsourcecap PDO index
portTester Port 1 or Port2
Returns
0 = Success else Fail

◆ SendSinkCapMessage()

int GrlC2ApiLib.GrlC2Controller.SendSinkCapMessage ( SinkCapability msg,
ControllerPort port = ControllerPort::ONE )

This API is used to send SinkCap message.

Parameters
msgConfigure SinkCapability message
portController Port
Returns
0-Tester connected succesfully, 1-Error in API or Connection setup

◆ SendSoftReset()

bool GrlC2ApiLib.GrlC2Controller.SendSoftReset ( ControllerPort port = ControllerPort::ONE)

Send SoftReset message with different SOP_TYPE.

Parameters
portControllerPort 1 - ONE, 2 - TWO
Returns
TRUE - Succeed;FALSE - Failed

◆ SendSourceCapsMessage()

int GrlC2ApiLib.GrlC2Controller.SendSourceCapsMessage ( SourceCapability msg,
ControllerPort port = ControllerPort::ONE )

This API is used to initiate sourcecap message.

Parameters
msgcreate object for GrlPdLib.SourceCapability and configure source cap message with PDO types
portConfigure(ControllerPort) the enum value that represents the port number.one for port-1, two for port-2. GRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success. 1 = Fail.

◆ SendVendorDefinedMessage()

int GrlC2ApiLib.GrlC2Controller.SendVendorDefinedMessage ( VendorDefinedMessage initiateMessage,
SOP_TYPE sopType = SOP_TYPE::SOP,
ControllerPort port = ControllerPort::ONE )

This API is used to send Vendor Defined message.

Parameters
initiateMessageGrlPdLib.VendorDefinedMessage
sopTypeSelect SOP type SOP | SOP1 | SOP2 | SOP_DEBUG1 | SOP_DEBUG2
portGRL-USB-PD-C2/F1's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ Set_Dminus_Voltage()

bool GrlC2ApiLib.GrlC2Controller.Set_Dminus_Voltage ( double voltage)

This API is used to configure the minimum voltage in Programmable Power Supply (PPS).

Parameters
voltageConfigured the voltage in Volts (V)
Returns
If Configured successfully, return true; otherwise, return false.Based on the retry count>1 got the error

◆ Set_Dplus_Voltage()

bool GrlC2ApiLib.GrlC2Controller.Set_Dplus_Voltage ( double voltage)

This API is used to configure the minimum and maximum voltage in Programmable Power Supply (PPS).

Parameters
voltageConfigured the voltage in Volts (V)
Returns
If Configured successfully, return true; otherwise, return false.Based on the retry count>1 got the error

◆ Set_EPR_Mode_Exit_Configuration()

bool GrlC2ApiLib.GrlC2Controller.Set_EPR_Mode_Exit_Configuration ( )

This API is used to enable or disable EPR mode exit.

Returns
True = EPR mode exit is configured. false = EPR mode exit is not configured.

◆ Set_EPR_PPS_Eload_Configuration()

bool GrlC2ApiLib.GrlC2Controller.Set_EPR_PPS_Eload_Configuration ( byte ppsEloadCfg)

This API is to enable or disable EPR PPS Eload configuration.

Parameters
ppsEloadCfgPPS Eload configuration in bytes
Returns
True = EPR PPS Eload is configured False = EPR PPS Eload is not configured

◆ Set_EPR_Request_Configuration()

int GrlC2ApiLib.GrlC2Controller.Set_EPR_Request_Configuration ( RequestMessage requestMessageObj,
byte PDONumber,
ControllerPort port = ControllerPort::ONE )

This API is used to Send EPR Request message.

Parameters
requestMessageObjConfigure RequestMessage.cs to send the request message from the GRL-USB-PD-C2/F1 controller
PDONumber
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0- Configured successfully 1- Failure in configuration

◆ Set_EPR_SinkCap_Configuration()

int GrlC2ApiLib.GrlC2Controller.Set_EPR_SinkCap_Configuration ( SinkCapability sinkCapabilityObj,
ControllerPort port = ControllerPort::ONE )

This API is used to Send EPR Sinkcap.

Parameters
sinkCapabilityObjsinkCapabilityObj set as a parameter for the SinkCapability.cs
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0- Configured successfully 1- Failure in configuration

◆ Set_EPR_SourceCap_Configuration()

int GrlC2ApiLib.GrlC2Controller.Set_EPR_SourceCap_Configuration ( SourceCapability sourceCapabilityObj,
ControllerPort port = ControllerPort::ONE )

This API is used to Send EPR Sourcecap.

Parameters
sourceCapabilityObjConfigure PDSource Capability function object
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0- Configured successfully 1- Failure in configuration

◆ Set_EPR_Unchunked_Request_Configuration()

bool GrlC2ApiLib.GrlC2Controller.Set_EPR_Unchunked_Request_Configuration ( bool isUnchunked = true)

This API is used to enable or disable EPR Unchunked request message.

Parameters
isUnchunkedtrue- EPR Unchunk req configured, False - Epr unchunk req is not configured
Returns
True = Successful Configuration False = Failure in Configuration

◆ Set_SOP_Prime_DiscovID_Configuration()

bool GrlC2ApiLib.GrlC2Controller.Set_SOP_Prime_DiscovID_Configuration ( bool isSendSOPPrimeDiscId)

This API is to enable or disable Prime DiscoverID configuration.

Parameters
isSendSOPPrimeDiscIdtrue - SOP Prime DiscoverID is configured, False -SOP Prime DiscoverID is not configured
Returns
True = SOP Prime DiscovID is configured False = SOP Prime DiscovID is not configured

◆ SetAutoTestMode()

bool GrlC2ApiLib.GrlC2Controller.SetAutoTestMode ( bool bIsEnable,
ControllerPort por = ControllerPort::ONE )

This API is used to set auto test mode in GRl C2 controller.

Parameters
bIsEnableTo enable/disable auto test mode
porController port
Returns
True - Configured successfully,False - Failed in configuration

◆ SetBatteryStatusMessage()

int GrlC2ApiLib.GrlC2Controller.SetBatteryStatusMessage ( BatteryStatusMesaage batteryStatusMesaage,
BatteryStatus batteryStatus,
bool InvalidBatteryReference = false,
bool BatteryisPresent = false,
double BatteryPresentCapacity = 0,
ControllerPort port = ControllerPort::ONE )

Sets the Battery Status Messages to be sent as Runtime messages.

Parameters
batteryStatusMesaageGrlPdLib.BatteryStatusMessage
batteryStatusStatus of the Battery Charging/Discharging/Idle
InvalidBatteryReferenceIf Message contains reference to a battery.
BatteryisPresentTo be set to "True" if Battery is present.
BatteryPresentCapacityBattery's State of Charging. if UNKNOW pass 65535.
Returns
0 - If Success 1 - If Fail

◆ SetBISTSharedTestEntryMode()

bool GrlC2ApiLib.GrlC2Controller.SetBISTSharedTestEntryMode ( BIST_TYPE bistType = BIST_TYPE::Reserved,
SOP_TYPE sopType = SOP_TYPE::SOP )

This API is used to send BIST Shared Test Entry Mode message.

Parameters
bistTypeGrlPdLib.BIST_TYPE
sopTypeGrlPdLib.SOP_TYPE
Returns
If false BIST not send,Otherwise BIST send

◆ SetBISTSharedTestExitMode()

bool GrlC2ApiLib.GrlC2Controller.SetBISTSharedTestExitMode ( BIST_TYPE bistType = BIST_TYPE::Reserved,
SOP_TYPE sopType = SOP_TYPE::SOP )

This API is used to send BIST Shared Test Exit Mode.

Parameters
bistTypeGrlPdLib.BIST_TYPE
sopTypeGrlPdLib.SOP_TYPE
Returns
If false BIST not send,Otherwise BIST send

◆ SetC2Sniffer()

void GrlC2ApiLib.GrlC2Controller.SetC2Sniffer ( C2SnifferNew c2SniffObj)

This API is used to configure the C2 browser app in SNIFFER mode.

Parameters
c2SniffObj

◆ SetCableType()

bool GrlC2ApiLib.GrlC2Controller.SetCableType ( int cableType = 0,
ControllerPort port = ControllerPort::ONE )

This API is used to set the cable type.

Parameters
cableType0-GRL_SPL_Cable, 1-TypeC_Cable
Returns
true - Configured succesfully ;false - faliure in Configuration

◆ SetCommPort()

void GrlC2ApiLib.GrlC2Controller.SetCommPort ( ControllerPort port)

This API is used to set the Communication port.

Parameters
portCommunication Port (One/TWO).

◆ SetControllerConfiguration()

bool GrlC2ApiLib.GrlC2Controller.SetControllerConfiguration ( ControllerConfigEnum controllerConfigEnum,
ControllerPort port = ControllerPort::ONE )

This API is used for configuring the C2 controller mode.

Parameters
controllerConfigEnumconfigure the controller type sink, source,cable and etc..
port
Returns
If Configured successfully, return true; otherwise, return false

◆ SetControllerCurrentLimit_Type_C_Only_Mode()

int GrlC2ApiLib.GrlC2Controller.SetControllerCurrentLimit_Type_C_Only_Mode ( double cur_mA,
ControllerPort port = ControllerPort::ONE )

This API should be invoked after setting the controller mode to ControllerMode.Type_C_Only_SRC To set currnt limit.

Parameters
cur_mACurrent to be set in mA
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetControllerIndex()

void GrlC2ApiLib.GrlC2Controller.SetControllerIndex ( int controllerIndex)

This API isused to set controller index.

Parameters
controllerIndexSet controller index eg:"0"

◆ SetControllerMode()

int GrlC2ApiLib.GrlC2Controller.SetControllerMode ( ControllerMode mode,
ControllerPort port = ControllerPort::ONE )

This API is used to set the GRL-USB-PD-C2 controller mode as Source, Sink or DRP along with all related functionalities such as SourceCapability, SinkCapability etc. to allow the controller to send the required capabilities when requested by another PD device.

Parameters
modeGrlPdLib.ControllerMode Source = 0 Sink = 1 DRP = 2 Type_C_Only_SRC = 3 Type_C_Only_SNK = 4 UNKNOWN = 5
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetDataStreamService()

void GrlC2ApiLib.GrlC2Controller.SetDataStreamService ( DataStreamService dataStream)

This API is used to configure the parameters of the Data Stream service .

Parameters
dataStream

◆ SetDRswapConfiguration()

bool GrlC2ApiLib.GrlC2Controller.SetDRswapConfiguration ( DR_SWAP_ENUM dR_SWAP)

This API is used to send the response message to DR_SWAP message Send = 1, Accept = 2, Send_Accept = 3, NONE.

Parameters
dR_SWAPconfigure GrlUsbPdControllerLib.DR_SWAP_ENUM
Returns
Returns True if Success else False.

◆ SetEloadCurrent()

int GrlC2ApiLib.GrlC2Controller.SetEloadCurrent ( double voltageInVolts,
double maxCurrentInAmps,
SwitchState state,
EloadChannel channel,
ControllerPort port = ControllerPort::ONE )

Sets the E-load Current to be drawn in the constant current mode. Ensure that the GRL-USB-PD-C2/F1 controller mode is set as a Sink before calling this method and also turn ON the E-load switch using the SetEloadState function.

Parameters
voltageInVoltsVoltage sense range
maxCurrentInAmpsMaximum Current to be drawn by Tester
stateTester load switch state
channelChannel selection in Tester's Type-C port
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetEloadCurrentRange()

int GrlC2ApiLib.GrlC2Controller.SetEloadCurrentRange ( double LoadStart_Amps,
double LoadStop_Amps,
int LoadStep_MilliAmps,
int StepIntervalMilliSec,
EloadMode LoadMode,
double LoadStopCondition_VoltageDropMin_Volts,
EloadChannel channel,
ControllerPort port = ControllerPort::ONE )

API to sweep the load current with configurable load step in Constant Current or Constant Resistance mode In CC Mode, Lowest load step is 8mA In CR Mode, Lowest load step is 25mA.

Parameters
LoadStart_Ampsload current start value in Amps
LoadStop_Ampsload current stop value in Amps
LoadStep_MilliAmpsload current step value in MilliAmps
StepIntervalMilliSecTime interval between consecutive load step in MilliSeconds
LoadModeLoad Mode Supported Modes: CC or CR mode
LoadStopCondition_VoltageDropMin_VoltsSet the stop condition for load sweep by vbus voltage drop value
channelset the channel VBUS or VCONN
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetEloadState()

int GrlC2ApiLib.GrlC2Controller.SetEloadState ( EloadChannel channel,
SwitchState state,
ControllerPort port = ControllerPort::ONE )

Sets the E-load state as ON or OFF. Ensure that the GRL-USB-PD-C2 controller mode is set as a Sink before turning on the E-load. You may also need to ensure the VBUS switch is turned OFF before turning ON the E-load switch. Use this function with caution - in case the over current protection of the DUT is not turned on, drawing more power may cause damage to the DUT.

Parameters
stateGRLSharedModule.SwitchState
channelset the channel VBUS or VCONN
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetEPRActionConfiguration()

int GrlC2ApiLib.GrlC2Controller.SetEPRActionConfiguration ( EPRConfig eprConfig,
ControllerPort port = ControllerPort::ONE )

This API is used to Set EPR Configuration.

Parameters
portONE or TWO, parameter to select the controller port for this API configuration
eprConfigEPREntry, EPREnterModeConfig, EPREnterSuccededConfig, EPRSrcCapConfig, EPRModeWaitConfig, EPRModeEnterFailedConfig
Returns
0- Configured successfully 1- Failure in configuration

◆ SetEPRMode()

int GrlC2ApiLib.GrlC2Controller.SetEPRMode ( bool enableEPRMode,
ControllerPort port = ControllerPort::ONE )

This API is used to enable or disable the EPR mode.

Parameters
enableEPRModetrue or false, parameter to enable or disable the EPR mode
portONE or TWO, parameter to select the controller port for this API configuration
Returns
0- Configured successfully 1- Failure in configuration

◆ SetFRSwapDetection()

void GrlC2ApiLib.GrlC2Controller.SetFRSwapDetection ( bool isFRSwapEnable = true)

This API used to Set FRSwap signal detect configuration.

Parameters
isFRSwapEnableTrue - Enable FR_Swap;False - Disable FR_Swap

◆ SetGroupSinkCapability()

int GrlC2ApiLib.GrlC2Controller.SetGroupSinkCapability ( SinkCapability objSinkCapability,
ControllerPort port = ControllerPort::ONE,
SOP_TYPE sopType = SOP_TYPE::SOP )

This API is used to set the group of sink cap's.

Parameters
objSinkCapabilityConfigure th sinkcap
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
sopTypeConfigure the message sop type
Returns
0 = Success 1 = fail to set

◆ SetMessagePayload()

bool GrlC2ApiLib.GrlC2Controller.SetMessagePayload ( params byte[] payloadInByte)

This API is used to set payload for Data/Extended messages.

Parameters
payloadInByteConfigure Payload value in Byte
Returns
True - Valid payload, False - Invalid payload

◆ SetNotToSendRequestMessageResponse()

int GrlC2ApiLib.GrlC2Controller.SetNotToSendRequestMessageResponse ( MsgType msgType,
bool dontSendResponse,
ControllerPort port = ControllerPort::ONE )

This API is used to disables the GRL-USB-PD-C2/F1 controller from sending response messages to any particular message requests.

Parameters
msgTypeMessage type to which you want to configure response
dontSendResponseIf you want not to send response set true
port
Returns
0 if Connected 1 if Connection Error.

◆ SetOverCurrentProtection()

bool GrlC2ApiLib.GrlC2Controller.SetOverCurrentProtection ( bool enableOCP,
bool enableCurrentLimit,
int setOCPValue )

This API is used to set over current protection value of C2 controller.

Parameters
enableOCPFlag to enable/disable over current protection event
enableCurrentLimitFlag to enable/disable current limit of C2 while testing with PPS chargers
setOCPValueValue in percentage, This value added with requested current of sink
Returns
Returns True if Success else False.

◆ SetPd_Controller()

void GrlC2ApiLib.GrlC2Controller.SetPd_Controller ( PD_Controller pdCtrler)

This API is used for configuring the PD parameters to their default values.

Parameters
pdCtrlerSend the object of PD_Controller to set the values in PD_Controller variable

◆ SetPdSpecificationRevision()

int GrlC2ApiLib.GrlC2Controller.SetPdSpecificationRevision ( SpecRevision specRevision,
ControllerPort port = ControllerPort::ONE )

This API is used to set the PD spec revision value.

Parameters
specRevisionGrlPdLib.SpecRevision
portGRL-USB-PD-C2 / GRL-USB-PD-F1's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = fail to set

◆ SetQCVoltageChangeRequest()

int GrlC2ApiLib.GrlC2Controller.SetQCVoltageChangeRequest ( int Voltage)

This API is used to request QC sink DUT to change the voltage level to 5V, 9V, 12V or 20V.

Parameters
VoltageVoltage value to be requested by Tester. Applicable voltage levels are 5V, 9V, 12V or 20V
Returns
0 = Success. 1 = Fail.

◆ SetQCVoltageDecrementRequest_200mV()

int GrlC2ApiLib.GrlC2Controller.SetQCVoltageDecrementRequest_200mV ( )

This API is used to decrease VBUS voltage level by 200mV by sending pulses over D- line.

Returns
0 = Success. 1 = Fail. 3 = Error_In_QC3_Mode.

◆ SetQCVoltageIncrementRequest_200mV()

int GrlC2ApiLib.GrlC2Controller.SetQCVoltageIncrementRequest_200mV ( )

API to increase VBUS voltage level by 200mV by sending pulses over D+ line.

Returns
0 = Success. 1 = Fail. 3 = Error_In_QC3_Mode.

◆ SetRpValue()

int GrlC2ApiLib.GrlC2Controller.SetRpValue ( RpValue rpVal,
ControllerPort port = ControllerPort::ONE )

This API is used to set Rp value of the C2 Controller when it is set to Source mode Note: Using cable set API (UseTesterCable(EmulateCableOn.CC1)) you can define Rp value on CC1 or CC2.

Parameters
rpValSet the Rp value (900mA, 1.5A or 3A)
portController port
Returns
0 = Success 1 = Fail

◆ SetSinkCapability()

int GrlC2ApiLib.GrlC2Controller.SetSinkCapability ( SinkCapability objSinkCapability,
ControllerPort port = ControllerPort::ONE )

This API is used to set the sink capability of the GRL-USB-PD-C2/F1 controller. This is applicable only when the controller mode is set as Sink or DRP.

Parameters
objSinkCapabilityGrlPdLib.SourceCapability
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = fail to set

◆ SetSinkRequestMessage()

int GrlC2ApiLib.GrlC2Controller.SetSinkRequestMessage ( RequestMessage objRequest,
ControllerPort port = ControllerPort::ONE )

This API is used to set the sink request message during the PD contract negotiations. Once the GRL-USB-PD-C2 controller receives the source capability.

Parameters
objRequestGrlPdLib.RequestMessage
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = fail to set

◆ SetSnifferMode()

int GrlC2ApiLib.GrlC2Controller.SetSnifferMode ( bool enableSnifferMode,
bool IsGRL_SPL_TestCable_UsedOnBothC2Ports = false )

This API allows user to enable/disable the sniffer mode When sniffer was enabled, controller will capture VBUS/CC1/CC2 details exchanged between devices connected between Port1 and extension slot. When sniffer was enabled, controller will be set to default working mode This API allows user to enable/disable the sniffer mode When sniffer was enabled, controller will capture VBUS/CC1/CC2 details exchanged between devices connected between Port1 and extension slot. When sniffer was enabled, controller will be set to default working mode.

Parameters
enableSnifferModeSet this parameter to True to enable sniffer mode Set this parameter to False to disable sniffer mode
IsGRL_SPL_TestCable_UsedOnBothC2PortsSet this parameter to True if GRL-SPL test cable was connected to both Port1 and Port2 of C2 Controller (Controller emulates cable by appling Ra on CC-line) Set this parameter to False if GRL-SPL test cable was not connected to both Port1 and Port2 of C2 Controller (Controller does not emulates cable) Note: Set this parameter to False, if any standard USB-C cable(including tethered/captive DUT) was connected to Port1 or Port2 of C2 Controller
Returns
0 = Success. 1 = Fail.

◆ SetSourceCapability()

int GrlC2ApiLib.GrlC2Controller.SetSourceCapability ( SourceCapability objSourceCapability,
ControllerPort port = ControllerPort::ONE )

This API is used to set the Source cap value.

Parameters
objSourceCapabilityGrlPdLib.SourceCapability
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = fail to set

◆ SetTesterAsQuickChargeSink()

int GrlC2ApiLib.GrlC2Controller.SetTesterAsQuickChargeSink ( bool enableQCMode,
bool enablePDSupportInQCMode )

This API is used to set tester as quick charge sink device.

Parameters
enableQCModeTrue - Enable QC mode, False - Disable QC Mode
enablePDSupportInQCModeTrue- enable PD support in QC - False - disable PD support in QC
Returns
0 = Success. 1 = Fail.

◆ SetTesterCableDropCompensation()

int GrlC2ApiLib.GrlC2Controller.SetTesterCableDropCompensation ( bool compensateCableDrop)

This API is used to Configure Tester to enable or disable the cable drop compensation in VBUS/VCONN voltage measurements This API is applicable only for GRL-SPL cable.

Parameters
compensateCableDropSet this parameter to True to enable the cable drop compensation Set this parameter to False to disable the cable drop compensation
Returns
0 = Success. 1 = Fail.

◆ SetTesterUnChkExdMsgSupport()

int GrlC2ApiLib.GrlC2Controller.SetTesterUnChkExdMsgSupport ( int iSupported,
bool bClearConfig,
bool IsAppCtrl )

This API used to enable or disable the Unchunked Extended message.

Parameters
iSupported1-Supported, 0-Not Supported
bClearConfigTrue - Reset the unchunked False- set the unchunked
IsAppCtrlIf False - Overwrite DUT config, True-App config data
Returns
0- Configured successfully 1- Failure in configuration

◆ SetTesterVBUSCapacitance()

void GrlC2ApiLib.GrlC2Controller.SetTesterVBUSCapacitance ( Tester_VBus_Capacitance capacitance)

This API is used to set the VBUS Capacitance on the GRL-USB-PD-C2/F1 controller. When this function is called, appropriate capacitance is added across VBUS and ground.

Parameters
capacitanceGRLSharedModule.Tester_VBus_Capacitance.

◆ SetTriggerOutput()

bool GrlC2ApiLib.GrlC2Controller.SetTriggerOutput ( int TriggerPulseDurationInMicroSeconds = 300)

This API is used to set the output trigger with pulse signal.

Parameters
TriggerPulseDurationInMicroSecondsPulse trigger time duration
Returns
TRUE - Succeed, FALSE - Failed

◆ SetVbusVoltage()

int GrlC2ApiLib.GrlC2Controller.SetVbusVoltage ( double voltageInVolt,
double currentLimitInAmps,
ControllerPort port = ControllerPort::ONE )

This API is used to set the VBus voltage. Ensure that the GRL-USB-PD-C2/F1 controller mode is set as a Source before setting the voltage. After setting the voltage you may need to turn On the voltage switch using the SetVbusState function.

Parameters
voltageInVoltVoltage to be set
currentLimitInAmpsCurrent limit
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ SetVconnLoadCurrent()

int GrlC2ApiLib.GrlC2Controller.SetVconnLoadCurrent ( double Vconn_Current,
VCONNLoading vCONNLoading = VCONNLoading::VCONN_TO_CC2,
ControllerPort port = ControllerPort::ONE )

This API is used to set VCONN Current, Either CC1 or CC2.

Parameters
Vconn_Current
vCONNLoading
port
Returns
Connection_Success = 0, Controller_Connection_Error = 1, Error_in_Reading_Calibration_Data = 2, Error_In_QC3_Mode = 3, Over_Current_Error = 4, Unknown_Error = 100,

◆ SetVconnVoltage() [1/2]

bool GrlC2ApiLib.GrlC2Controller.SetVconnVoltage ( double dVconnVolt,
VCONNLoading vconnComm,
ControllerPort port = ControllerPort::ONE )

This API is used to set the tester Vconn voltage either CC2 or CC1.

Parameters
dVconnVoltsend double value of which voltage tester VCONN has to set
vconnCommSet on which communciation line VCONN has to set, either CC1 or CC2
Returns
True = Success;False = Fail.

◆ SetVconnVoltage() [2/2]

bool GrlC2ApiLib.GrlC2Controller.SetVconnVoltage ( double voltage,
ControllerPort port = ControllerPort::ONE )

This API is used for the configuring the VCONN voltage on CC1 or CC2 line.

Parameters
voltageConfigure the VCONN voltage in millivolts (mV).
port
Returns
If Configured successfully, return true; otherwise, return false.Based on the retry count>1 got the error

◆ SetVendorDefinedMessageResponse()

int GrlC2ApiLib.GrlC2Controller.SetVendorDefinedMessageResponse ( VDM_CMD cmdType,
VendorDefinedMessage responseMessage,
SOP_TYPE sopType = SOP_TYPE::SOP,
ControllerPort port = ControllerPort::ONE )

This API is used to set Payload details of VDM message responded by USB-PD-C2 controller.

Parameters
cmdTypeSelect the VDM message type for which payload details will be configured GrlPdLib.VDM_CMD.Discover_ID GrlPdLib.VDM_CMD.Discover_SVID GrlPdLib.VDM_CMD.Discover_Mode GrlPdLib.VDM_CMD.Enter_Mode GrlPdLib.VDM_CMD.Exit_Mode GrlPdLib.VDM_CMD.Attention GrlPdLib.VDM_CMD.DP_StatusUpdate GrlPdLib.VDM_CMD.DP_Configure
responseMessageObject to configure the payload details
sopTypeTo select SOP type GrlPdLib.SOP_TYPE.SOP GrlPdLib.SOP_TYPE.SOP1 GrlPdLib.SOP_TYPE.SOP2
Parameters
portGRL-USB-PD-C2/F1's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = Fail

◆ Short_Dplus_Dminus()

int GrlC2ApiLib.GrlC2Controller.Short_Dplus_Dminus ( bool isApplyShort)

Using this API to SHORT D+ and D- line.

Parameters
isApplyShortTrue - To apply short False - To Remove short
Returns
0 - Success

◆ ShortVBUSLine()

int GrlC2ApiLib.GrlC2Controller.ShortVBUSLine ( bool EnableShort,
ControllerPort port = ControllerPort::ONE )

Use this API to short VBUS line to ground.

Parameters
EnableShortSet this param to true to short VBUS line to ground Set this param to false to remove the short connection from VBUS line to ground
portGRL-USB-PD-C2/GRL-USB-PD-F1's Port 1 or Port 2. Default is Port 1
Returns
0 = Success. 1 = Fail.

◆ ShortVbustoGround()

bool GrlC2ApiLib.GrlC2Controller.ShortVbustoGround ( bool IsEnable,
int shortingTime_milliSec,
ControllerPort port = ControllerPort::ONE )

TO short VBUS to ground.

Parameters
IsEnabletrue - Enable Shorting; false - Disable short
shortingTime_milliSecupdate shorting time in milli seconds
portController port info port one or two
Returns
True - Configured successfully, False- Failure in configuration

◆ ShortVconntoGround()

bool GrlC2ApiLib.GrlC2Controller.ShortVconntoGround ( bool IsEnable,
int shortingTime_milliSec,
VCONNLoading Vconnlodg = VCONNLoading::VCONN_TO_CC2,
ControllerPort port = ControllerPort::ONE )

TO short VCONN to ground.

Parameters
IsEnabletrue - Enable Shorting; false - Disable short
shortingTime_milliSecupdate shorting time in milli seconds
VconnlodgVconn Line- VCONN_TO_CC2 or VCONN_TO_CC1
portController port info port one or two
Returns
True - Configured successfully, False- Failure in configuration

◆ StartCapture()

int GrlC2ApiLib.GrlC2Controller.StartCapture ( List< MeasurementChannel > listOfMeasurementChannel = null,
int subSamplingRatio = 1000,
bool enCableDrop = false,
bool bEnableLSADC = true,
bool bEnableCCLine = true,
int socBufferSize = 1,
ControllerPort port = ControllerPort::ONE )

This API starts the data capture from the C2 Controller, which includes PD messages and configured list of signal channels from USB-C port of C2 Controller.

Parameters
listOfMeasurementChannelParameter to configure the list of signal channels to be capture from USB-C port of C2 Controller
subSamplingRatio
  1. This parameter defines the sub sampling rate at which the signal channels are getting captured. Maximum supported sample rate by C2 controller in 2.4 Million Samples/second for 1 channel, if multiple channels are configured, then sample rate will get reduced by those many number of channels configured
  2. Recommended default value for this parameter in 1000, which means that configured signal lines will be captured at 2400 Samples/second for 1 channel
  3. If this parameter was set to 0, then signal will be captured at the max supported sample rate (2.4MS/s), choosing this value will cause huge memory accumulation for longer capture duration, so it is recommended to keep this value bigger for longer capture duration
enCableDropThis parameter enables the test cable drop compensation in the voltage measurements. Set this parametr to "true" when using test cable to connect the DUT to C2 controller Set this parametr to "false" when the DUT was connected directly to C2 controller(Captive or Tethered cable devices) Refer cable drop compensation section in USB-PD-C2 Software user guide for calculating the cable drop for the test cable
bEnableLSADCThis parameter enables the USB-C port signal acquisition by C2 controller
bEnableCCLineThis parameter enables the PD message acquisition by C2 controller
socBufferSizeThis parameter defines the Ethernet read buffer size in KiloBytes Supported values 1,8,16,32,62. Assigning any other values to this parameter will be considered as 1.
Returns
0 = Success 1 = Fail

◆ StartReadingStreamerData()

bool GrlC2ApiLib.GrlC2Controller.StartReadingStreamerData ( int controllerIndex)

Use this API to read streamer data from controller.

Parameters
controllerIndexSet controller index eg:"1"
Returns

◆ StopCapture()

int GrlC2ApiLib.GrlC2Controller.StopCapture ( int Timeout = 5000)

Stops the data capture, including any PD messages and voltage values.

///

Parameters
TimeoutTimeout for streamer to stop reading data from C2 Controller
Returns
0 = Success. 1 = Fail.

◆ SwitchToExternalEload()

bool GrlC2ApiLib.GrlC2Controller.SwitchToExternalEload ( bool isEnable)

External eload ON/OFF.

Parameters
isEnableEnable or disable eload True - Enable False - Disable
Returns
True - External Eload enabled;False - External Eload disabled

◆ UpdateController()

void GrlC2ApiLib.GrlC2Controller.UpdateController ( PD_Controller m_PDctrl,
PD_Controller_C2Gen2 m_PDctrlGen2 )

To update the Controllers.

Parameters
m_PDctrlAssign the properties to PD_Controller.cs
m_PDctrlGen2Assign the properties to PD_Controller_C2Gen2.cs

◆ UpdateVoltageToPDMessage()

double GrlC2ApiLib.GrlC2Controller.UpdateVoltageToPDMessage ( ControllerPort port = ControllerPort::ONE)

Use this API to Update the voltage to PDMessage.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
VBUS voltage value

◆ UseTesterCable()

int GrlC2ApiLib.GrlC2Controller.UseTesterCable ( VendorDefinedMessage vdm = null,
ControllerPort port = ControllerPort::ONE,
EmulateCableOn ccline = EmulateCableOn::CC2 )

Parameters
vdmIf the VDM is not set, default VDM with 20V 5A will be set
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
cclineUsing EmulateCableOn you can set Rp value on CC line ccline = EmulateCableOn.CC1 then Rp value in CC2 line ccline = EmulateCableOn.CC2 then Rp value in CC1 line
Returns
Return 0 if Success.

◆ UseTypeCCable()

int GrlC2ApiLib.GrlC2Controller.UseTypeCCable ( ControllerPort port = ControllerPort::ONE)

API to configure GRL-SPL cable.

Parameters
portGRL-USB-PD-C2's Port 1 or Port 2. Default is Port 1
Returns
0 = Success 1 = fail to set

◆ ValidateRequest_By_index()

int GrlC2ApiLib.GrlC2Controller.ValidateRequest_By_index ( int iPDOind,
ControllerPort port = ControllerPort::ONE )

API to validate request message by using request message PDO index.

Parameters
iPDOindRequest PDO index
port
Returns
0 = Success else Fail

◆ WaitFor()

void GrlC2ApiLib.GrlC2Controller.WaitFor ( int waitTimeMilli)

Method to provide delay in milliseconds.

Parameters
waitTimeMilliConfigure delay in milliseconds