property OnTriggerOutbuffFree : TNotifyEvent
Defines an event handler that is called whenever the dispatcher detects that free space in its output buffer has reached a certain level.
This event handler is called in a subset of the cases where the more general OnTriggerStatus handler is called. OnTriggerStatus is called first when sufficient free space is detected, even if an OnTriggerOutbuffFree handler is installed. If the output buffer level is already below the specified level when the trigger is activated, an OnTriggerOutbuffFree event is generated the next time the internal dispatcher gains control.
The parameter passed to the TNotifyEvent is the TApxComPort component that generated the trigger.
Note that status triggers are not self-restarting. The event handler must call SetStatusTrigger again to reactivate the trigger as needed.
The following example adds and activates a status trigger for OnTriggerOutbuffFree events; when the output buffer free level reaches 255 or greater ApxComPortTriggerOutbuffFree transmits BigString:
TrigOBF : Word;
...
TrigOBF := ApxComPort.AddStatusTrigger(stOutbuffFree);
ApxComPort.SetStatusTrigger(TrigOBF, 255, True);
...
procedure TMyForm.ApxComPortTriggerOutbuffFree(CP : TObject);
begin
{buffer has at least 255 bytes free, transmit a big string}
ApxComPort.Output := BigString;
end;
See also: OnTriggerStatus, OnTriggerOutbuffUsed