Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Translated Format I/O
[I/O Management]

This module is no longer supported. More...

Functions

int NutDeviceReadTran (NUTDEVICE *dev, void *data, int size)
 Read up to a specified number of bytes from a device translating non printables.

int NutDeviceWriteTran (NUTDEVICE *dev, CONST void *data)
 Write a buffer to a specified device using character translation for non printables.


Detailed Description

This module is no longer supported.


Function Documentation

int NutDeviceReadTran NUTDEVICE   dev,
void *    data,
int    size
 

Read up to a specified number of bytes from a device translating non printables.

This call works like NutDeviceRead(), but translates character codes below 33, above 126 or equal 34 into their hex representation prepended by a backslash and the letter x. Backslashes are duplicated and the complete string is terminated by character code zero. This offers the ability to store binary data in printable strings.

Deprecated:
Will be removed.
Parameters:
dev Identifies the device that read from. A null pointer specifies the first on-chip UART. If this pointer is not null, it must have been retrieved by using the NutDeviceOpen() function.
data Pointer to the buffer that receives the translated string.
size Size of the buffer.
Returns:
The number of bytes read, 0 on timeouts and broken connections or -1 in case of an error. Due to code translation, the number of bytes read be less than the number of characters returned in the string.

int NutDeviceWriteTran NUTDEVICE   dev,
CONST void *    data
 

Write a buffer to a specified device using character translation for non printables.

This call works like NutDeviceWrite(), but translates hex representations prepended by a backslash and the letter x to equivalent characters. Duplicate backslashes are converted to a single backslash.

Deprecated:
Will be removed.
Parameters:
dev Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
data Buffer to be written.
Returns:
If successful, the number of bytes added to the output buffer. This may be less than the specified number of bytes to print. The return value -1 indicates an error.


© 2000-2003 by egnite Software GmbH - visit http://www.ethernut.de/