Exported Tcl interface

This table shows what functions are required in the Tcl section of a PDL program. It also shows what interface these functions must present to the programmable driver module:

Function Description
hci_pd.open info This function is called when the driver is opened, after the Tcl data structures are initialized, but before anything happens.

The info argument is the configuration keylist for the driver.

When this (Tcl) function returns, the driver enters the NEW state.

If this function fails, then the driver is destroyed and the attempt of the system to open the driver fails.

hci_pd.initialize info This is called to initialize the driver, when the driver moves from the NEW state to the IDLE state.

Typical functionality for hci_pd.initialize is to open the physical device using hci_pd_open_device and perform any required initialization.

Currently, info is empty.

hci_pd.shutdown info

This function is called to shut down the driver.

This procedure is not invoked when the driver is shut down in panic mode.

Currently, info is empty.

hci_pd.read info

This function is called when data becomes available on the line and the driver is in the IDLE state. Under these conditions, it is presumed that a message phrase is arriving over the line, and this function is called to handle message reading.

Handling data arriving on the line involves invoking hci_pd_receive.

  • hci_pd_receive is the only way to start the PDL parsing the input, although the input can be manipulated in other ways (that is, using hci_pd_ignore_input).
  • Handle the input, even if that means discarding it. Otherwise, the driver terminates on the assumption that it is buggy.

Currently, info is empty.

hci_pd.write info This function is called to write a message on the line from the thread, where info contains the key message.
  • The value is the name of the message object to write. This message object is unbound from the Tcl context when the write operation completes.
  • If this operation completes with an error indication, then the engine tries again to send the message.
Note: Do not define your own procedures or variables with the hci_pd prefix. This name subspace is reserved for this version and later versions of PDL.