#include <cogent.h>
int DR_ApWriteBlock(
int card_id, int buf_id, unsigned short offset, unsigned short size, void* data, char** error )
;
The card ID of the requested block of data.
The buffer ID of the requested block of data.
The starting (byte) address of the requested block of data into the specified card buffer.
The number of bytes to be written.
The address of memory area, at least size byes long, containing the data.
The address of a string pointer. In case of error (non-zero return), the string pointer is set to the corresponding error description string. The error string is contained in a static buffer and remains valid only until the next API call. The parameter may be NULL if no error string is required.
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-2010 by Cogent Real-Time Systems, Inc. All rights reserved.