OpenOCD
emucom.c File Reference

Emulator communication (EMUCOM). More...

Include dependency graph for emucom.c:

Go to the source code of this file.

Functions

JAYLINK_API int jaylink_emucom_read (struct jaylink_device_handle *devh, uint32_t channel, uint8_t *buffer, uint32_t *length)
 Read from an EMUCOM channel. More...
 
JAYLINK_API int jaylink_emucom_write (struct jaylink_device_handle *devh, uint32_t channel, const uint8_t *buffer, uint32_t *length)
 Write to an EMUCOM channel. More...
 

Detailed Description

Emulator communication (EMUCOM).

Definition in file emucom.c.

Function Documentation

◆ jaylink_emucom_read()

JAYLINK_API int jaylink_emucom_read ( struct jaylink_device_handle devh,
uint32_t  channel,
uint8_t *  buffer,
uint32_t *  length 
)

Read from an EMUCOM channel.

Note
This function must only be used if the device has the JAYLINK_DEV_CAP_EMUCOM capability.
Parameters
[in,out]devhDevice handle.
[in]channelChannel to read data from.
[out]bufferBuffer to store read data on success. Its content is undefined on failure.
[in,out]lengthNumber of bytes to read. On success, the value gets updated with the actual number of bytes read. Unless otherwise specified, the value is undefined on failure.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_PROTOProtocol violation.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEV_NOT_SUPPORTEDChannel is not supported by the device.
JAYLINK_ERR_DEV_NOT_AVAILABLEChannel is not available for the requested amount of data. length is updated with the number of bytes available on this channel.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.1.0

Definition at line 93 of file emucom.c.

References buffer_get_u32(), buffer_set_u32(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_ERR_DEV, JAYLINK_ERR_DEV_NOT_AVAILABLE, JAYLINK_ERR_DEV_NOT_SUPPORTED, JAYLINK_ERR_PROTO, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_read(), transport_start_write_read(), and transport_write().

Referenced by COMMAND_HANDLER().

◆ jaylink_emucom_write()

JAYLINK_API int jaylink_emucom_write ( struct jaylink_device_handle devh,
uint32_t  channel,
const uint8_t *  buffer,
uint32_t *  length 
)

Write to an EMUCOM channel.

Note
This function must only be used if the device has the JAYLINK_DEV_CAP_EMUCOM capability.
Parameters
[in,out]devhDevice handle.
[in]channelChannel to write data to.
[in]bufferBuffer to write data from.
[in,out]lengthNumber of bytes to write. On success, the value gets updated with the actual number of bytes written. The value is undefined on failure.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_PROTOProtocol violation.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEV_NOT_SUPPORTEDChannel is not supported by the device.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.1.0

Definition at line 206 of file emucom.c.

References buffer_get_u32(), buffer_set_u32(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_ERR_DEV, JAYLINK_ERR_DEV_NOT_SUPPORTED, JAYLINK_ERR_PROTO, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_write(), transport_start_write_read(), and transport_write().

Referenced by COMMAND_HANDLER().