#include <vxWorks.h>
#include <stdlib.h>
#include <sysLib.h>
#include <tickLib.h>
#include <wdLib.h>
#include "BBC/FPA.h"
#include "BFU/BFC.h"
Data Structures | |
| struct | _BFC_msgDst |
| Defines a BFC message destination. More... | |
| struct | _BFC_rto |
| Defines a BFC run timeout control structure. More... | |
| struct | _BFC_runCtl |
| Encapsulates the information needed to control a run. More... | |
Defines | |
| #define | BFC_M_RUN_ACTIVE |
| A bit mask, where the set bits indicate states which occur during an active run. More... | |
| #define | _TICKS(_time, _scale_factor, _ticks_per_second) ((_time * _ticks_per_second) / _scale_factor) |
| Converts a time to VxWorks Ticks. More... | |
Typedefs | |
| typedef _BFC_msgDst | BFC_msgDst |
| Typedef for struct _BFC_msgDst. More... | |
| typedef _BFC_rto | BFC_rto |
| Typedef for struct _BFC_rto. More... | |
| typedef int(* | BFC_setRtn )(BFC_runCtl *rc, unsigned int value) |
| Typedef for generic set routine. More... | |
Functions | |
| int | destroy (BFC_runCtl *rc) |
| Returns all the resources associated with the run control block. More... | |
| int | runIsActive (BFC_runState state) |
| Indicates whether the specified run state occurs while a run is active. More... | |
| FPA_fcb * | msgsInit (int nmsgs, int msgSize) |
| Initializes a fixed packet pool to contain nmsgs. More... | |
| void | msgInit (void *unused, void *msg, int size, int loff) |
| Initializes each packet as it is put on the free list. More... | |
| void | rtoRtn (BFC_rto *rto) |
| Watchdog timer routine to signal the end of a run. More... | |
| BFC_runCtl * | BFC_get (void) |
| Return a handle to the run control structure. More... | |
| int | BFC_init (BFC_runCtl *rc, BFI_group group, unsigned int rto_signal, unsigned int msg_signal, int nmsgs, int msgSize) |
| Initializes a previously allocated BFC run control structure. More... | |
| int | BFC_blimitSet (BFC_runCtl *rc, unsigned int nbytes) |
| Sets the byte limit for the run duration. More... | |
| int | BFC_elimitSet (BFC_runCtl *rc, unsigned int nevts) |
| Sets the event limit for the run duration. More... | |
| int | BFC_maxBlimitSet (BFC_runCtl *rc, unsigned int nbytes) |
| Sets the max byte limit for files. More... | |
| int | BFC_tlimitSet (BFC_runCtl *rc, unsigned int msecs) |
| Sets the time limit for the run duration. More... | |
| int | BFC_quantitySet (BFC_runCtl *rc, BFC_quantity name, unsigned int value) |
| Sets one of the run control quantities. More... | |
| int | BFC_runIsActive (const BFC_runCtl *rc) |
| Indicates whether the specified run state occurs while a run is active. More... | |
| int | BFC_runNumberSet (BFC_runCtl *rc, unsigned int runNumber) |
| Assigns the number to be to designate the next run. More... | |
| int | BFC_runStart (BFC_runCtl *rc, BFC_runUsrRtn usr, void *prm1, void *prm2) |
| Starts a run. More... | |
| int | BFC_runPause (BFC_runCtl *rc, BFC_runUsrRtn usr, void *prm1, void *prm2) |
| Pause a run. More... | |
| int | BFC_runResume (BFC_runCtl *rc, BFC_runUsrRtn usr, void *prm1, void *prm2) |
| Pause a run. More... | |
| int | BFC_runStop (BFC_runCtl *rc, BFC_runUsrRtn usr, void *prm1, void *prm2) |
| Stops a run. More... | |
| int | BFC_runUpdate (BFC_runCtl *rc, unsigned int nevts, unsigned int nbytes) |
| Updates the number of bytes of data taken during this run. More... | |
| int | BFC_configure (BFC_runCtl *rc, unsigned int elimit, unsigned int tlimit, unsigned int blimit) |
| Convenience routine to set up some of the initial parameters. More... | |
| BFC_msg * | BFC_msgAllocate (BFC_msgStream *mstrm, int timeout) |
| Allocates a command message. More... | |
| int | BFC_msgQue (BFC_msgStream *mstrm, BFC_msg *msg, unsigned int type, unsigned int prm) |
| Ques a previously allocate message. More... | |
| int | BFC_msgStreamInit (BFC_msgStream *mstrm, BFC_runCtl *rc, int ackTo) |
| Initializes a message stream. More... | |
| int | BFC_msgSend (BFC_msgStream *mstrm, unsigned int type, unsigned int prm) |
| Sends a message to the event taking task. More... | |
| BFC_msg * | BFC_msgReceive (BFC_runCtl *rc) |
| Returns the message at the head of the send message que. More... | |
| int | BFC_msgAcknowledge (BFC_msg *msg, int status) |
| Acknowledges the receipt of the specified message. More... | |
| const BFC_runInfo * | BFC_runInfoGet (const BFC_runCtl *rc) |
| BFC_runState | BFC_runStateGet (const BFC_runCtl *rc) |
| Returns the current run state. More... | |
| unsigned int | BFC_runNumberGet (const BFC_runCtl *rc) |
| Returns the current run state. More... | |
| int | BFC_timeLeftGet (const BFC_runCtl *rc) |
| Returns the time left in the current run. More... | |
| int | BFC_nbytesLeftGet (const BFC_runCtl *rc) |
| Returns the number of bytes to be accumulated before the current run is finished. More... | |
| int | BFC_nevtsLeftGet (const BFC_runCtl *rc) |
| Returns the number of events to be accumulated before the current run is finished. More... | |
| int | BFC_tlimitGet (const BFC_runCtl *rc) |
| Returns the run time limit in ticks. More... | |
| int | BFC_maxBlimitGet (const BFC_runCtl *rc) |
| Returns the max number of bytes one can ever write. More... | |
|
|
Converts a time to VxWorks Ticks.
A time, _time, expressed in some units, _scale_factor, is converted to VxWorks ticks. The calculation is straightforward.
ticks = (time * ticks_per_second) / scale_factor
For example, if one had a time, expressed in milliseconds, then
ticks = _TICKS(time_in_msecs, 1000, sysClkRateGet())
|
|
|
Value: (((1 << (BFC_K_STATE_STOPPING - BFC_K_STATE_STARTED + 1)) -1) \ << BFC_K_STATE_STARTED)
|
|
|
Typedef for struct _BFC_msgDst.
A BFC message destination contains information to direct a message from the sender to receiver, ie the destination. The BFC command path is a full-duplex, synchronous, many-to-one arrangement. Many applications can messages to a single command handler. The command handler serially handles each message and acknowledges this by returning the original message to the sender along with a disposition status code. Since this is a synchronous protocol, the sender is blocked until the message is returned or a timeout occurs. The message stuff is strictly not part of the Run Control, but finds its must usage there. This stuff should really be split off to its own facility, but there is no time at this point. |
|
|
Typedef for struct _BFC_rto.
When a run expires on a time limit, a watchdog timer is activated. This ISR routine merely sends the appropriate signal to the BFI group. |
|
|
Typedef for generic set routine. \typdef BFC_setRtn The call signature of the generic set routine is
status = (*set) (BFC_runCtl *rc, int value);
|
|
||||||||||||
|
Sets the byte limit for the run duration.
If this number is specified as 0, then no byte limit will be imposed. This number is ultimately limited by the 'max_blimit'. This is limiting is not down until a run is actually started. This preserves the set value for as long as possible. This is somewhat of a kludge. The right way to handle this sort of problem is to have a current limit and an active limit. The current limit is only set be this routine. The active limit is meaningful only when a run is in progress and would be the minimum of the current and maximum. |
|
||||||||||||||||||||
|
Convenience routine to set up some of the initial parameters.
The byte limit parameter is used to set both the current limit and the maximum limit. If the user wishes to set the limit for the current run, BFC_blimitSet() should be called. |
|
||||||||||||
|
Sets the event limit for the run duration.
If this number is specified as 0, then no event limit will be imposed. |
|
|
Return a handle to the run control structure.
|
|
||||||||||||||||||||||||||||
|
Initializes a previously allocated BFC run control structure.
|
|
|
Returns the max number of bytes one can ever write.
|
|
||||||||||||
|
Sets the max byte limit for files.
If this number is specified as 0, there is no maximum in effect. |
|
||||||||||||
|
Acknowledges the receipt of the specified message.
|
|
||||||||||||
|
Allocates a command message.
|
|
||||||||||||||||||||
|
Ques a previously allocate message.
|
|
|
Returns the message at the head of the send message que.
|
|
||||||||||||||||
|
Sends a message to the event taking task.
|
|
||||||||||||||||
|
Initializes a message stream.
|
|
|
Returns the number of bytes to be accumulated before the current run is finished.
|
|
|
Returns the number of events to be accumulated before the current run is finished.
|
|
||||||||||||||||
|
Sets one of the run control quantities.
Note that this is only a convenience routine. The more specific set routines should be used when possible. This routine supports a more generic 'set' interface routine such as that found in a command parser. |
|
|
|
|
|
Indicates whether the specified run state occurs while a run is active.
|
|
|
Returns the current run state.
|
|
||||||||||||
|
Assigns the number to be to designate the next run.
|
|
||||||||||||||||||||
|
Pause a run.
|
|
||||||||||||||||||||
|
Pause a run.
|
|
||||||||||||||||||||
|
Starts a run.
|
|
|
Returns the current run state.
|
|
||||||||||||||||||||
|
Stops a run.
|
|
||||||||||||||||
|
Updates the number of bytes of data taken during this run.
|
|
|
Returns the time left in the current run.
|
|
|
Returns the run time limit in ticks.
|
|
||||||||||||
|
Sets the time limit for the run duration.
|
|
|
Returns all the resources associated with the run control block.
|
|
||||||||||||||||||||
|
Initializes each packet as it is put on the free list.
|
|
||||||||||||
|
Initializes a fixed packet pool to contain nmsgs.
|
|
|
Watchdog timer routine to signal the end of a run.
|
|
|
Indicates whether the specified run state occurs while a run is active.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002