hci_pd_report_exception code text
This reports an exceptional condition to the engine, where code is any integer and text is arbitrary text.
For example, to log certain received messages for the system operator:
proc hci_pd.read {info} {
hci_pd_receive {{normal-msg handle_normal}\
{powering-down pwr_down}}
}
# receive a "power going down" message from the\ other end
proc pwr_down {info} {
hci_pd_report_exception 3 \
{Remote device is powering down!}
hci_pd_ignore_input [lindex [keylget info end] 0]
}
The use of hci_pd_ignore_input to remove the text of the powering-down phrase from the PD’s input buffer. This is necessary to avoid having the PD stop the driver on the assumption it was malfunctioning because it did not process its input.