proconX: Protocol Converter & Gateways

Programmable Gateways

Smart Industrial Communication and Embeddeded Ethernet Solutions
 Login 
We accept VISA, MasterCard, PayPal

World Wide Shipping

XgBankMem


Functions

char * NutSegBufReset (void)
 Reset the segmented buffer.
char * NutSegBufInit (size_t size)
 Initialize the segmented buffer.
char * NutSegBufWriteRequest (size_t *bcp)
 Request segmented buffer space for writing.
char * NutSegBufReadRequest (size_t *bcp)
 Request segmented buffer space for reading.
char * NutSegBufWriteCommit (u_short bc)
 Commit written buffer space.
char * NutSegBufReadCommit (size_t bc)
 Commit read buffer space.
void NutSegBufWriteLast (u_short bc)
 Commit written buffer space and finish write access.
void NutSegBufReadLast (u_short bc)
 Commit written buffer space and finish read access.
u_long NutSegBufAvailable (void)
 Return the available buffer space.
u_long NutSegBufUsed (void)
 Return the used buffer space.


Function Documentation

u_long NutSegBufAvailable void   ) 
 

Return the available buffer space.

Returns:
Total number of free bytes in the buffer.

char* NutSegBufInit size_t  size  ) 
 

Initialize the segmented buffer.

Parameters:
size Number of bytes to allocate for the global buffer. In systems with banked memory this parameter is ignored and all banked memory is occupied for the global buffer. In systems without banked memory, the specified number of bytes is taken from heap memory.
Returns:
Pointer to the first buffer segment or null on failures.

char* NutSegBufReadCommit size_t  bc  ) 
 

Commit read buffer space.

The read pointer will be incremented by the specified number of bytes. If the pointer reaches the end of a segment, the next segment will be enabled and the pointer will point to the start of the new segement.

Parameters:
bc Number of bytes to commit.
Returns:
Pointer to the next read position.

void NutSegBufReadLast u_short  bc  ) 
 

Commit written buffer space and finish read access.

The write pointer will be incremented by the specified number of bytes. This call will also enable the current read segment and may disable the current write segment.

Parameters:
bc Number of bytes to commit.

char* NutSegBufReadRequest size_t *  bcp  ) 
 

Request segmented buffer space for reading.

This call will also enable the current read segment and may disable the current write segment.

Parameters:
bcp Pointer to a variable, which receives the number of consecutive bytes available for reading.
Returns:
Pointer to the next read position.

char* NutSegBufReset void   ) 
 

Reset the segmented buffer.

Returns:
Pointer to the first buffer segment.

u_long NutSegBufUsed void   ) 
 

Return the used buffer space.

Returns:
Total number of used bytes in the buffer.

char* NutSegBufWriteCommit u_short  bc  ) 
 

Commit written buffer space.

The write pointer will be incremented by the specified number of bytes. If the pointer reaches the end of a segment, the next segment will be enabled and the pointer will point to the start of the new segement.

Parameters:
bc Number of bytes to commit.
Returns:
Pointer to the next write position.

void NutSegBufWriteLast u_short  bc  ) 
 

Commit written buffer space and finish write access.

The write pointer will be incremented by the specified number of bytes. This call will also enable the current read segment and may disable the current write segment.

Parameters:
bc Number of bytes to commit.

char* NutSegBufWriteRequest size_t *  bcp  ) 
 

Request segmented buffer space for writing.

This call will also enable the current write segment and may disable the current read segment.

Parameters:
bcp Pointer to a variable, which receives the number of consecutive bytes available for writing.
Returns:
Pointer to the next write position.