libjaylink 0.3.1
Library to access J-Link devices
Loading...
Searching...
No Matches
Functions
emucom.c File Reference

Emulator communication (EMUCOM). More...

#include <stdint.h>
#include <stdbool.h>
#include "libjaylink.h"
#include "libjaylink-internal.h"

Functions

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

Detailed Description

Emulator communication (EMUCOM).

Function Documentation

◆ jaylink_emucom_read()

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

◆ jaylink_emucom_write()

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