(bufferInit card_id buf_id size)
If the buffer is initialized successfully:
(bufferInit card_id buf_id size)
Otherwise, one of the following error messages:
(error "bufferInit DR_ERR_CARD_INVALID (time) invalid card: card_id") (error "bufferInit DR_ERR_BLK_INVALID (time) invalid buffer id: buf_id") (error "bufferInit DVN_ERR_BUFFER_ALLOC (time) failed to allocate buffer: buf_id")
![]() | The DR_ERR_BLK_INVALID error can also indicate that the buffer has already been initialized. |
This command allocates the specified buffer with a particular size. The buffers defined by this command mirror in the driver the various areas of memory contained in the card. Allocation of the buffers and managing of the card memory is done automatically by the driver as needed (for example as part of the dnsOnline and dnsDeviceAdd commands), using specified size parameters, or default sizes.
This command gives the user greater control of the buffer sizes, allowing the card memory usage to be tailored to the requirements of a particular installation. The following table provides a list of the buffers defined in the DVN Driver (see dvn_api.h in the distribution), along with the default size value.
Table 1. DVN Driver Buffers
| Buffer ID | Buffer Name | Defined size (bytes) |
|---|---|---|
| 0 | DVN_BUF_OUTPUT | 4K |
| 1 | DVN_BUF_INPUT | 4K |
| 2 | DVN_BUF_SERVER_OUT | (see dnsOnLine) |
| 3 | DVN_BUF_SERVER_IN | (see dnsOnLine) |
| 4 | DVN_BUF_SERVER_REQUEST | 64 |
| 5 | DVN_BUF_SERVER_RESPONSE | 64 |
| 6+(0..63) | DVN_BUF_DEV_MSG+(0..63) | 64, (see dnsDeviceAdd) |
The bufferInit command must be used after cardInit (requires that a card be initialized), but before buffers are automatically allocated by the dnsOnline or dnsDeviceAdd commands.
> (bufferInit 0 1 6144) (bufferInit 0 1 6144) > (bufferDescribe 0) (bufferDescribe 0 (1 6144 0x1000 0)) > (dnsOnline 0 0 0 1024 0) (dnsOnline 0) > (bufferDescribe 0) (bufferDescribe 0 (1 6144 0x1000 0) (2 1024 0x2800 1024) (3 256 0x2C00 256)) > (dnsDeviceAdd 0 2 7 6) (dnsDeviceAdd 0 2) > (bufferDescribe 0) (bufferDescribe 0 (0 4096 0x2D00 6) (1 6144 0x1000 7) (2 1024 0x2800 1024) (3 256 0x2C00 256) (8 64 0x3D00 0))
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.