Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ump_stream_responder.c File Reference

Macros

#define BIT_IF(cond, n)
#define MIDI_CI_VERSION_FORMAT_UMP_1_1   0x01
 MIDI-CI version identifier for UMP v1.1 devices.

Functions

static bool ep_has_midi1 (const struct ump_endpoint_dt_spec *ep)
static bool ep_has_midi2 (const struct ump_endpoint_dt_spec *ep)
static struct midi_ump make_endpoint_info (const struct ump_endpoint_dt_spec *ep)
 Build an Endpoint Info Notification Universal MIDI Packet.
static struct midi_ump make_function_block_info (const struct ump_endpoint_dt_spec *ep, size_t block_num)
 Build a Function Block Info Notification Universal MIDI Packet.
static size_t fill_str (struct midi_ump *ump, size_t offset, const char *src, size_t len)
 Copy an ASCII string into a Universal MIDI Packet while leaving some most significant bytes untouched, such that the caller can set this prefix.
static int send_string (const struct ump_stream_responder_cfg *cfg, const char *string, uint32_t prefix, size_t offset)
 Send a string as UMP Stream, possibly splitting into multiple packets if the string length is larger than 1 UMP.
static int ump_ep_discover (const struct ump_stream_responder_cfg *cfg, const struct midi_ump pkt)
 Handle Endpoint Discovery messages.
static int ump_fb_discover_block (const struct ump_stream_responder_cfg *cfg, size_t block_num, uint8_t filter)
static int ump_fb_discover (const struct ump_stream_responder_cfg *cfg, const struct midi_ump pkt)
 Handle Function Block Discovery messages.
const char * ump_product_instance_id (void)
int ump_stream_respond (const struct ump_stream_responder_cfg *cfg, const struct midi_ump pkt)
 Respond to an UMP Stream message.

Macro Definition Documentation

◆ BIT_IF

#define BIT_IF ( cond,
n )
Value:
((cond) ? BIT(n) : 0)
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44

◆ MIDI_CI_VERSION_FORMAT_UMP_1_1

#define MIDI_CI_VERSION_FORMAT_UMP_1_1   0x01

MIDI-CI version identifier for UMP v1.1 devices.

See also
Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol: 7.1.8 FB Info Notification > MIDI-CI Message Version/Format

Function Documentation

◆ ep_has_midi1()

bool ep_has_midi1 ( const struct ump_endpoint_dt_spec * ep)
inlinestatic

◆ ep_has_midi2()

bool ep_has_midi2 ( const struct ump_endpoint_dt_spec * ep)
inlinestatic

◆ fill_str()

size_t fill_str ( struct midi_ump * ump,
size_t offset,
const char * src,
size_t len )
inlinestatic

Copy an ASCII string into a Universal MIDI Packet while leaving some most significant bytes untouched, such that the caller can set this prefix.

Parameters
umpThe ump into which the string is copied
[in]offsetNumber of bytes from the most-significant side to leave free
[in]srcThe source string
[in]lenThe length of the source string
Returns
The number of bytes copied

◆ make_endpoint_info()

struct midi_ump make_endpoint_info ( const struct ump_endpoint_dt_spec * ep)
inlinestatic

Build an Endpoint Info Notification Universal MIDI Packet.

See also
Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol: 7.1.2 Endpoint Info Notification Message

◆ make_function_block_info()

struct midi_ump make_function_block_info ( const struct ump_endpoint_dt_spec * ep,
size_t block_num )
inlinestatic

Build a Function Block Info Notification Universal MIDI Packet.

See also
Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol: 7.1.8 Function Block Info Notification

◆ send_string()

int send_string ( const struct ump_stream_responder_cfg * cfg,
const char * string,
uint32_t prefix,
size_t offset )
inlinestatic

Send a string as UMP Stream, possibly splitting into multiple packets if the string length is larger than 1 UMP.

Parameters
[in]cfgThe responder configuration
[in]stringThe string to send
[in]prefixThe fixed prefix of UMP packets to send
[in]offsetThe offset the strings starts in the packet, in bytes
Returns
The number of packets sent

◆ ump_ep_discover()

int ump_ep_discover ( const struct ump_stream_responder_cfg * cfg,
const struct midi_ump pkt )
inlinestatic

Handle Endpoint Discovery messages.

Parameters
[in]cfgThe responder configuration
[in]pktThe discovery packet to handle
Returns
The number of UMP sent as reply

◆ ump_fb_discover()

int ump_fb_discover ( const struct ump_stream_responder_cfg * cfg,
const struct midi_ump pkt )
inlinestatic

Handle Function Block Discovery messages.

Parameters
[in]cfgThe responder configuration
[in]pktThe discovery packet to handle
Returns
The number of UMP sent as reply

◆ ump_fb_discover_block()

int ump_fb_discover_block ( const struct ump_stream_responder_cfg * cfg,
size_t block_num,
uint8_t filter )
inlinestatic