Data Sheet

Table Of Contents
40
4 Basic Commands
4.1 PD_SendPacket
Sends the data payload towards the device. You can customize its behavior using provided
settings.
Format
Call PD_SendPacket(PD_Packet $send_packet, PD_SendPacketSettings $settings)
Parameters
$send_packet
Defines the payload. Refer to Packet Templates for available packet templates.
$settings
Settings for sending packet. It should be inherited from PD_SendPacketSettings template.
Table below shows PD_SendPacketSettings structure in detail:
Field Name
Description
OrderedSetType
Defines Ordered set type. Possible values:
PD_ORDERED_SET_TYPE_SOP(default)
PD_ORDERED_SET_TYPE_SOP_PRIME
PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME
PD_ORDERED_SET_TYPE_HARDRESET
PD_ORDERED_SET_TYPE_CABLERESET
WaitForGoodCrc
If the command should wait for peer GoodCrc message. Possible values:
PD_TRUE(default)
PD_FALSE
ResetOnError
Send Soft Reset if relative GoodCrc has not been received, in case of sending
SoftReset failure, HardReset will be sent. Possible values:
PD_TRUE(default)
PD_FALSE
RetryCount
Indicates the Retry Count.
Default: PD_DEFAULT_RETRY_COUNT_REV_2(Rev2.0 only)
Default: PD_DEFAULT_RETRY_COUNT_REV_3(Rev3.0)
RetryDelayTime
Delay time between two consecutive retries.
Default: 0
AutoMessageId
To increase MessageId automatically. Possible values:
PD_TRUE(default)
PD_FALSE
Result
User can evaluate the command results(including sub-results) using IfMatched/ElseMatched
command.
Value
Description
PD_RESULT_OK
Command succeeded
PD_RESULT_FAILED
Command failed
PD_SUBRESULT_NO_GOODCRC
Subresult - No GoodCRC received for sent packet
PD_SUBRESULT_HARDRESET
Subresult - HardReset occurred.
PD_SUBRESULT_SOFTRESET
Subresult - SoftReset occurred.
Examples
#send a discover identity command
#################################
$send_setting = PD_SendPacketSettings
{
# could be PD_ORDERED_SET_TYPE_SOP_PRIME for cables
OrderedSetType = PD_ORDERED_SET_TYPE_SOP
}