#include <cogent.h>
int DR_ApWriteBlock(int card_id, int buf_id, unsigned short offset, unsigned short size, void* data, char** error );
The integer value 0 if the function was successful, otherwise one of the following error codes:
DR_API_IPC_ERRORS DR_ERR_CARD_INVALID DR_ERR_BLK_INVALID DR_ERR_BLK_OFS_INVALID DR_ERR_BLK_SIZE_INVALID DR_ERR_CMD_INVALID
/* continued from example in DR_ApReadBlock */
printf (" Write Block Bit Cycle:\n", 1);
data[32] = 0;
for (i=0; i<=8 && result==0; i++)
{
if (data[32] == 0)
data[32] = 1;
else
data[32] *= 2;
printf ("\r %4X ", data[32]);
fflush (stdout);
if (result = DR_ApWriteBlock (0, 0, 0, 64, data,
&error_str))
printf (" Error@WriteBlock (%d,%s)\n",
result, error_str);
delay (250);
}
printf ("\n");Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.