aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2022-12-18 10:44:46 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2022-12-18 15:38:44 +0900
commit1ea37b27921b8b5b4f339a038899c5aa85f86012 (patch)
treee4787dc4705c65631473608871e3025d99f3cbb8
parente13e0d023c1197b5f19a22c76229533e0b60c8e1 (diff)
downloadlibhinoko-1ea37b27921b8b5b4f339a038899c5aa85f86012.tar.gz
fw_iso_ir_single: rename to HinokoFwIsoIrSingle
In teminology of device driver development, the choice of word is device-oriented, thus 'rx' is for incoming data path to target device, and 'tx' is for outgoing data path from target device. Current implementation uses the words for different ways. This commit corrects the usage of words with loss of backward compatibility. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rwxr-xr-xsamples/iso-ir-single (renamed from samples/iso-rx-single)4
-rw-r--r--src/fw_iso_ir_single.c (renamed from src/fw_iso_rx_single.c)226
-rw-r--r--src/fw_iso_ir_single.h (renamed from src/fw_iso_rx_single.h)32
-rw-r--r--src/hinoko.h2
-rw-r--r--src/hinoko.map19
-rw-r--r--src/meson.build4
-rwxr-xr-xtests/fw-iso-ir-single (renamed from tests/fw-iso-rx-single)2
-rw-r--r--tests/meson.build2
8 files changed, 146 insertions, 145 deletions
diff --git a/samples/iso-rx-single b/samples/iso-ir-single
index fb9d041..2b7f453 100755
--- a/samples/iso-rx-single
+++ b/samples/iso-ir-single
@@ -9,7 +9,7 @@ from gi.repository import GLib
gi.require_version('Hinoko', '0.0')
from gi.repository import Hinoko
-class IsoRxSingle(Hinoko.FwIsoRxSingle):
+class IsoIrSingle(Hinoko.FwIsoIrSingle):
def new(self, path, channel, maximum_bytes_per_payload):
self.allocate(path, channel, 8)
@@ -107,7 +107,7 @@ class IsoRxSingle(Hinoko.FwIsoRxSingle):
channel = 1
maximum_bytes_per_payload = (2 + 3 * 8) * 4
-ctx = IsoRxSingle()
+ctx = IsoIrSingle()
ctx.new('/dev/fw0', channel, maximum_bytes_per_payload)
dispatcher = GLib.MainLoop.new(None, False)
diff --git a/src/fw_iso_rx_single.c b/src/fw_iso_ir_single.c
index 3517daf..85a5f11 100644
--- a/src/fw_iso_rx_single.c
+++ b/src/fw_iso_ir_single.c
@@ -2,10 +2,10 @@
#include "fw_iso_ctx_private.h"
/**
- * HinokoFwIsoRxSingle:
+ * HinokoFwIsoIrSingle:
* An object to receive isochronous packet for single channel.
*
- * A [class@FwIsoRxSingle] receives isochronous packets for single channel by IR
+ * A [class@FwIsoIrSingle] receives isochronous packets for single channel by IR
* context for packet-per-buffer mode in 1394 OHCI. The content of packet is
* split to two parts; context header and context payload in a manner of Linux
* FireWire subsystem.
@@ -18,52 +18,52 @@ typedef struct {
guint chunk_cursor;
const struct fw_cdev_event_iso_interrupt *ev;
-} HinokoFwIsoRxSinglePrivate;
+} HinokoFwIsoIrSinglePrivate;
static void fw_iso_ctx_iface_init(HinokoFwIsoCtxInterface *iface);
-G_DEFINE_TYPE_WITH_CODE(HinokoFwIsoRxSingle, hinoko_fw_iso_rx_single, G_TYPE_OBJECT,
- G_ADD_PRIVATE(HinokoFwIsoRxSingle)
+G_DEFINE_TYPE_WITH_CODE(HinokoFwIsoIrSingle, hinoko_fw_iso_ir_single, G_TYPE_OBJECT,
+ G_ADD_PRIVATE(HinokoFwIsoIrSingle)
G_IMPLEMENT_INTERFACE(HINOKO_TYPE_FW_ISO_CTX, fw_iso_ctx_iface_init))
-enum fw_iso_rx_single_sig_type {
- FW_ISO_RX_SINGLE_SIG_TYPE_IRQ = 1,
- FW_ISO_RX_SINGLE_SIG_TYPE_COUNT,
+enum fw_iso_ir_single_sig_type {
+ FW_ISO_IR_SINGLE_SIG_TYPE_IRQ = 1,
+ FW_ISO_IR_SINGLE_SIG_TYPE_COUNT,
};
-static guint fw_iso_rx_single_sigs[FW_ISO_RX_SINGLE_SIG_TYPE_COUNT] = { 0 };
+static guint fw_iso_ir_single_sigs[FW_ISO_IR_SINGLE_SIG_TYPE_COUNT] = { 0 };
-static void fw_iso_rx_single_get_property(GObject *obj, guint id, GValue *val, GParamSpec *spec)
+static void fw_iso_ir_single_get_property(GObject *obj, guint id, GValue *val, GParamSpec *spec)
{
- HinokoFwIsoRxSingle *self = HINOKO_FW_ISO_RX_SINGLE(obj);
- HinokoFwIsoRxSinglePrivate *priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ HinokoFwIsoIrSingle *self = HINOKO_FW_ISO_IR_SINGLE(obj);
+ HinokoFwIsoIrSinglePrivate *priv = hinoko_fw_iso_ir_single_get_instance_private(self);
fw_iso_ctx_state_get_property(&priv->state, obj, id, val, spec);
}
-static void fw_iso_rx_single_finalize(GObject *obj)
+static void fw_iso_ir_single_finalize(GObject *obj)
{
hinoko_fw_iso_ctx_release(HINOKO_FW_ISO_CTX(obj));
- G_OBJECT_CLASS(hinoko_fw_iso_rx_single_parent_class)->finalize(obj);
+ G_OBJECT_CLASS(hinoko_fw_iso_ir_single_parent_class)->finalize(obj);
}
-static void hinoko_fw_iso_rx_single_class_init(HinokoFwIsoRxSingleClass *klass)
+static void hinoko_fw_iso_ir_single_class_init(HinokoFwIsoIrSingleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
- gobject_class->get_property = fw_iso_rx_single_get_property;
- gobject_class->finalize = fw_iso_rx_single_finalize;
+ gobject_class->get_property = fw_iso_ir_single_get_property;
+ gobject_class->finalize = fw_iso_ir_single_finalize;
fw_iso_ctx_class_override_properties(gobject_class);
/**
- * HinokoFwIsoRxSingle::interrupted:
- * @self: A [class@FwIsoRxSingle]
+ * HinokoFwIsoIrSingle::interrupted:
+ * @self: A [class@FwIsoIrSingle]
* @sec: sec part of isochronous cycle when interrupt occurs, up to 7.
* @cycle: cycle part of of isochronous cycle when interrupt occurs, up to 7999.
* @header: (array length=header_length) (element-type guint8): The headers of IR context
* for packets handled in the event of interrupt. The content is different
- * depending on header_size parameter of [method@FwIsoRxSingle.allocate].
+ * depending on header_size parameter of [method@FwIsoIrSingle.allocate].
* @header_length: the number of bytes for @header.
* @count: the number of packets to handle.
*
@@ -77,13 +77,13 @@ static void hinoko_fw_iso_rx_single_class_init(HinokoFwIsoRxSingleClass *klass)
* - When application calls [method@FwIsoCtx.flush_completions] explicitly.
*
* The handler of signal can retrieve context payload of received packet by call of
- * [method@FwIsoRxSingle.get_payload].
+ * [method@FwIsoIrSingle.get_payload].
*/
- fw_iso_rx_single_sigs[FW_ISO_RX_SINGLE_SIG_TYPE_IRQ] =
+ fw_iso_ir_single_sigs[FW_ISO_IR_SINGLE_SIG_TYPE_IRQ] =
g_signal_new("interrupted",
G_OBJECT_CLASS_TYPE(klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(HinokoFwIsoRxSingleClass, interrupted),
+ G_STRUCT_OFFSET(HinokoFwIsoIrSingleClass, interrupted),
NULL, NULL,
hinoko_sigs_marshal_VOID__UINT_UINT_POINTER_UINT_UINT,
G_TYPE_NONE,
@@ -91,22 +91,22 @@ static void hinoko_fw_iso_rx_single_class_init(HinokoFwIsoRxSingleClass *klass)
G_TYPE_UINT, G_TYPE_UINT);
}
-static void hinoko_fw_iso_rx_single_init(HinokoFwIsoRxSingle *self)
+static void hinoko_fw_iso_ir_single_init(HinokoFwIsoIrSingle *self)
{
- HinokoFwIsoRxSinglePrivate *priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ HinokoFwIsoIrSinglePrivate *priv = hinoko_fw_iso_ir_single_get_instance_private(self);
fw_iso_ctx_state_init(&priv->state);
}
-static void fw_iso_rx_single_stop(HinokoFwIsoCtx *inst)
+static void fw_iso_ir_single_stop(HinokoFwIsoCtx *inst)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
gboolean running;
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst));
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst));
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
running = priv->state.running;
@@ -116,72 +116,72 @@ static void fw_iso_rx_single_stop(HinokoFwIsoCtx *inst)
g_signal_emit_by_name(G_OBJECT(inst), STOPPED_SIGNAL_NAME, NULL);
}
-static void fw_iso_rx_single_unmap_buffer(HinokoFwIsoCtx *inst)
+static void fw_iso_ir_single_unmap_buffer(HinokoFwIsoCtx *inst)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst));
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst));
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
fw_iso_ctx_state_unmap_buffer(&priv->state);
}
-static void fw_iso_rx_single_release(HinokoFwIsoCtx *inst)
+static void fw_iso_ir_single_release(HinokoFwIsoCtx *inst)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst));
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst));
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
fw_iso_ctx_state_release(&priv->state);
}
-static gboolean fw_iso_rx_single_get_cycle_timer(HinokoFwIsoCtx *inst, gint clock_id,
+static gboolean fw_iso_ir_single_get_cycle_timer(HinokoFwIsoCtx *inst, gint clock_id,
HinokoCycleTimer *const *cycle_timer,
GError **error)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst), FALSE);
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst), FALSE);
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
return fw_iso_ctx_state_get_cycle_timer(&priv->state, clock_id, cycle_timer, error);
}
-static gboolean fw_iso_rx_single_flush_completions(HinokoFwIsoCtx *inst, GError **error)
+static gboolean fw_iso_ir_single_flush_completions(HinokoFwIsoCtx *inst, GError **error)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst), FALSE);
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst), FALSE);
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
return fw_iso_ctx_state_flush_completions(&priv->state, error);
}
-gboolean fw_iso_rx_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
+gboolean fw_iso_ir_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
GError **error)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
const struct fw_cdev_event_iso_interrupt *ev;
guint sec;
guint cycle;
guint count;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst), FALSE);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst), FALSE);
g_return_val_if_fail(event->common.type == FW_CDEV_EVENT_ISO_INTERRUPT, FALSE);
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
ev = &event->iso_interrupt;
sec = ohci1394_isoc_desc_tstamp_to_sec(ev->cycle);
@@ -190,7 +190,7 @@ gboolean fw_iso_rx_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev
// TODO; handling error?
priv->ev = ev;
- g_signal_emit(self, fw_iso_rx_single_sigs[FW_ISO_RX_SINGLE_SIG_TYPE_IRQ], 0,
+ g_signal_emit(self, fw_iso_ir_single_sigs[FW_ISO_IR_SINGLE_SIG_TYPE_IRQ], 0,
sec, cycle, ev->header, ev->header_length, count);
priv->ev = NULL;
@@ -201,48 +201,48 @@ gboolean fw_iso_rx_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev
return fw_iso_ctx_state_queue_chunks(&priv->state, error);
}
-gboolean fw_iso_rx_single_create_source(HinokoFwIsoCtx *inst, GSource **source, GError **error)
+gboolean fw_iso_ir_single_create_source(HinokoFwIsoCtx *inst, GSource **source, GError **error)
{
- HinokoFwIsoRxSingle *self;
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSingle *self;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(inst), FALSE);
- self = HINOKO_FW_ISO_RX_SINGLE(inst);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(inst), FALSE);
+ self = HINOKO_FW_ISO_IR_SINGLE(inst);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
- return fw_iso_ctx_state_create_source(&priv->state, inst, fw_iso_rx_single_handle_event,
+ return fw_iso_ctx_state_create_source(&priv->state, inst, fw_iso_ir_single_handle_event,
source, error);
}
static void fw_iso_ctx_iface_init(HinokoFwIsoCtxInterface *iface)
{
- iface->stop = fw_iso_rx_single_stop;
- iface->unmap_buffer = fw_iso_rx_single_unmap_buffer;
- iface->release = fw_iso_rx_single_release;
- iface->get_cycle_timer = fw_iso_rx_single_get_cycle_timer;
- iface->flush_completions = fw_iso_rx_single_flush_completions;
- iface->create_source = fw_iso_rx_single_create_source;
+ iface->stop = fw_iso_ir_single_stop;
+ iface->unmap_buffer = fw_iso_ir_single_unmap_buffer;
+ iface->release = fw_iso_ir_single_release;
+ iface->get_cycle_timer = fw_iso_ir_single_get_cycle_timer;
+ iface->flush_completions = fw_iso_ir_single_flush_completions;
+ iface->create_source = fw_iso_ir_single_create_source;
}
/**
- * hinoko_fw_iso_rx_single_new:
+ * hinoko_fw_iso_ir_single_new:
*
- * Instantiate [class@FwIsoRxSingle] object and return the instance.
+ * Instantiate [class@FwIsoIrSingle] object and return the instance.
*
- * Returns: an instance of [class@FwIsoRxSingle].
+ * Returns: an instance of [class@FwIsoIrSingle].
*/
-HinokoFwIsoRxSingle *hinoko_fw_iso_rx_single_new(void)
+HinokoFwIsoIrSingle *hinoko_fw_iso_ir_single_new(void)
{
- return g_object_new(HINOKO_TYPE_FW_ISO_RX_SINGLE, NULL);
+ return g_object_new(HINOKO_TYPE_FW_ISO_IR_SINGLE, NULL);
}
/**
- * hinoko_fw_iso_rx_single_allocate:
- * @self: A [class@FwIsoRxSingle].
+ * hinoko_fw_iso_ir_single_allocate:
+ * @self: A [class@FwIsoIrSingle].
* @path: A path to any Linux FireWire character device.
* @channel: An isochronous channel to listen, up to 63.
* @header_size: The number of bytes for header of IR context, greater than 4 at least to include
- * isochronous packet header in header parameter of [signal@FwIsoRxSingle::interrupted].
+ * isochronous packet header in header parameter of [signal@FwIsoIrSingle::interrupted].
* @error: A [struct@GLib.Error].
*
* Allocate an IR context to 1394 OHCI controller for packet-per-buffer mode. A local node of the
@@ -250,7 +250,7 @@ HinokoFwIsoRxSingle *hinoko_fw_iso_rx_single_new(void)
* long as process has enough permission for the path.
*
* The header_size parameter has an effect for the content of header parameter in
- * [signal@FwIsoRxSingle::interrupted]. When it's greater than 8, header includes the series of two
+ * [signal@FwIsoIrSingle::interrupted]. When it's greater than 8, header includes the series of two
* quadlets for isochronous packet header and timestamp per isochronous packet. When it's greater
* than 12, header includes the part of isochronous packet data per packet.
*
@@ -258,17 +258,17 @@ HinokoFwIsoRxSingle *hinoko_fw_iso_rx_single_new(void)
*
* Since: 0.7.
*/
-gboolean hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self, const char *path,
+gboolean hinoko_fw_iso_ir_single_allocate(HinokoFwIsoIrSingle *self, const char *path,
guint channel, guint header_size, GError **error)
{
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self), FALSE);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(self), FALSE);
g_return_val_if_fail(channel <= IEEE1394_MAX_CHANNEL, FALSE);
g_return_val_if_fail(header_size >= 4, FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
if (!fw_iso_ctx_state_allocate(&priv->state, path, HINOKO_FW_ISO_CTX_MODE_IR_SINGLE, 0,
channel, header_size, error))
@@ -280,8 +280,8 @@ gboolean hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self, const char
}
/**
- * hinoko_fw_iso_rx_single_map_buffer:
- * @self: A [class@FwIsoRxSingle].
+ * hinoko_fw_iso_ir_single_map_buffer:
+ * @self: A [class@FwIsoIrSingle].
* @maximum_bytes_per_payload: The maximum number of bytes per payload of IR context.
* @payloads_per_buffer: The number of payload in buffer.
* @error: A [struct@GLib.Error].
@@ -292,50 +292,50 @@ gboolean hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self, const char
*
* Since: 0.7.
*/
-gboolean hinoko_fw_iso_rx_single_map_buffer(HinokoFwIsoRxSingle *self,
+gboolean hinoko_fw_iso_ir_single_map_buffer(HinokoFwIsoIrSingle *self,
guint maximum_bytes_per_payload,
guint payloads_per_buffer, GError **error)
{
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self), FALSE);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(self), FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
return fw_iso_ctx_state_map_buffer(&priv->state, maximum_bytes_per_payload,
payloads_per_buffer, error);
}
/**
- * hinoko_fw_iso_rx_single_register_packet:
- * @self: A [class@FwIsoRxSingle].
+ * hinoko_fw_iso_ir_single_register_packet:
+ * @self: A [class@FwIsoIrSingle].
* @schedule_interrupt: Whether to schedule hardware interrupt at isochronous cycle for the packet.
* @error: A [struct@GLib.Error].
*
* Register chunk of buffer to process packet for future isochronous cycle. The caller can schedule
* hardware interrupt to generate interrupt event. In detail, please refer to documentation about
- * [signal@FwIsoRxSingle::interrupted] signal.
+ * [signal@FwIsoIrSingle::interrupted] signal.
*
* Returns: TRUE if the overall operation finishes successfully, otherwise FALSE.
*
* Since: 0.7.
*/
-gboolean hinoko_fw_iso_rx_single_register_packet(HinokoFwIsoRxSingle *self,
+gboolean hinoko_fw_iso_ir_single_register_packet(HinokoFwIsoIrSingle *self,
gboolean schedule_interrupt, GError **error)
{
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self), FALSE);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(self), FALSE);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
return fw_iso_ctx_state_register_chunk(&priv->state, FALSE, 0, 0, NULL, 0, 0,
schedule_interrupt, error);
}
/**
- * hinoko_fw_iso_rx_single_start:
- * @self: A [class@FwIsoRxSingle].
+ * hinoko_fw_iso_ir_single_start:
+ * @self: A [class@FwIsoIrSingle].
* @cycle_match: (array fixed-size=2) (element-type guint16) (in) (nullable): The isochronous cycle
* to start packet processing. The first element should be the second part of
* isochronous cycle, up to 3. The second element should be the cycle part of
@@ -350,12 +350,12 @@ gboolean hinoko_fw_iso_rx_single_register_packet(HinokoFwIsoRxSingle *self,
*
* Since: 0.7.
*/
-gboolean hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16 *cycle_match,
+gboolean hinoko_fw_iso_ir_single_start(HinokoFwIsoIrSingle *self, const guint16 *cycle_match,
guint32 sync_code, HinokoFwIsoCtxMatchFlag tags, GError **error)
{
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSinglePrivate *priv;
- g_return_val_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self), FALSE);
+ g_return_val_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(self), FALSE);
g_return_val_if_fail(cycle_match == NULL ||
cycle_match[0] <= OHCI1394_IR_contextMatch_cycleMatch_MAX_SEC ||
cycle_match[1] <= OHCI1394_IR_contextMatch_cycleMatch_MAX_CYCLE,
@@ -363,7 +363,7 @@ gboolean hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16
g_return_val_if_fail(sync_code <= IEEE1394_MAX_SYNC_CODE, FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
priv->chunk_cursor = 0;
@@ -371,8 +371,8 @@ gboolean hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16
}
/**
- * hinoko_fw_iso_rx_single_get_payload:
- * @self: A [class@FwIsoRxSingle].
+ * hinoko_fw_iso_ir_single_get_payload:
+ * @self: A [class@FwIsoIrSingle].
* @index: the index inner available packets at the event of interrupt.
* @payload: (element-type guint8)(array length=length)(out)(transfer none): The array with data
* frame for payload of IR context.
@@ -383,10 +383,10 @@ gboolean hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16
*
* Since: 0.7.
*/
-void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
+void hinoko_fw_iso_ir_single_get_payload(HinokoFwIsoIrSingle *self, guint index,
const guint8 **payload, guint *length)
{
- HinokoFwIsoRxSinglePrivate *priv;
+ HinokoFwIsoIrSinglePrivate *priv;
unsigned int bytes_per_chunk;
unsigned int chunks_per_buffer;
unsigned int pos;
@@ -394,9 +394,9 @@ void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
guint offset;
guint frame_size;
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
+ g_return_if_fail(HINOKO_IS_FW_ISO_IR_SINGLE(self));
- priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+ priv = hinoko_fw_iso_ir_single_get_instance_private(self);
g_return_if_fail(priv->ev != NULL);
g_return_if_fail(index * priv->header_size <= priv->ev->header_length);
diff --git a/src/fw_iso_rx_single.h b/src/fw_iso_ir_single.h
index f2cf221..042e6dc 100644
--- a/src/fw_iso_rx_single.h
+++ b/src/fw_iso_ir_single.h
@@ -1,54 +1,54 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
-#ifndef __HINOKO_FW_ISO_RX_SINGLE_H__
-#define __HINOKO_FW_ISO_RX_SINGLE_H__
+#ifndef __HINOKO_FW_ISO_IR_SINGLE_H__
+#define __HINOKO_FW_ISO_IR_SINGLE_H__
#include <hinoko.h>
G_BEGIN_DECLS
-#define HINOKO_TYPE_FW_ISO_RX_SINGLE (hinoko_fw_iso_rx_single_get_type())
+#define HINOKO_TYPE_FW_ISO_IR_SINGLE (hinoko_fw_iso_ir_single_get_type())
-G_DECLARE_DERIVABLE_TYPE(HinokoFwIsoRxSingle, hinoko_fw_iso_rx_single, HINOKO, FW_ISO_RX_SINGLE,
+G_DECLARE_DERIVABLE_TYPE(HinokoFwIsoIrSingle, hinoko_fw_iso_ir_single, HINOKO, FW_ISO_IR_SINGLE,
GObject);
-struct _HinokoFwIsoRxSingleClass {
+struct _HinokoFwIsoIrSingleClass {
GObjectClass parent_class;
/**
- * HinokoFwIsoRxSingleClass::interrupted:
- * @self: A [class@FwIsoRxSingle].
+ * HinokoFwIsoIrSingleClass::interrupted:
+ * @self: A [class@FwIsoIrSingle].
* @sec: The sec part of isochronous cycle when interrupt occurs, up to 7.
* @cycle: The cycle part of of isochronous cycle when interrupt occurs, up to 7999.
* @header: (array length=header_length) (element-type guint8): The headers of IR context
* for packets handled in the event of interrupt. The content is different
- * depending on header_size parameter of [method@FwIsoRxSingle.allocate].
+ * depending on header_size parameter of [method@FwIsoIrSingle.allocate].
* @header_length: the number of bytes for header.
* @count: the number of packets to handle.
*
- * Class closure for the [signal@FwIsoRxSingle::interrupted] signal.
+ * Class closure for the [signal@FwIsoIrSingle::interrupted] signal.
*/
- void (*interrupted)(HinokoFwIsoRxSingle *self, guint sec, guint cycle,
+ void (*interrupted)(HinokoFwIsoIrSingle *self, guint sec, guint cycle,
const guint8 *header, guint header_length,
guint count);
};
-HinokoFwIsoRxSingle *hinoko_fw_iso_rx_single_new(void);
+HinokoFwIsoIrSingle *hinoko_fw_iso_ir_single_new(void);
-gboolean hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self, const char *path,
+gboolean hinoko_fw_iso_ir_single_allocate(HinokoFwIsoIrSingle *self, const char *path,
guint channel, guint header_size, GError **error);
-gboolean hinoko_fw_iso_rx_single_map_buffer(HinokoFwIsoRxSingle *self,
+gboolean hinoko_fw_iso_ir_single_map_buffer(HinokoFwIsoIrSingle *self,
guint maximum_bytes_per_payload,
guint payloads_per_buffer, GError **error);
-gboolean hinoko_fw_iso_rx_single_register_packet(HinokoFwIsoRxSingle *self,
+gboolean hinoko_fw_iso_ir_single_register_packet(HinokoFwIsoIrSingle *self,
gboolean schedule_interrupt, GError **error);
-gboolean hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16 *cycle_match,
+gboolean hinoko_fw_iso_ir_single_start(HinokoFwIsoIrSingle *self, const guint16 *cycle_match,
guint32 sync_code, HinokoFwIsoCtxMatchFlag tags,
GError **error);
-void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
+void hinoko_fw_iso_ir_single_get_payload(HinokoFwIsoIrSingle *self, guint index,
const guint8 **payload, guint *length);
G_END_DECLS
diff --git a/src/hinoko.h b/src/hinoko.h
index c4a1a46..15164cd 100644
--- a/src/hinoko.h
+++ b/src/hinoko.h
@@ -16,7 +16,7 @@
#include <cycle_timer.h>
#include <fw_iso_ctx.h>
-#include <fw_iso_rx_single.h>
+#include <fw_iso_ir_single.h>
#include <fw_iso_rx_multiple.h>
#include <fw_iso_tx.h>
diff --git a/src/hinoko.map b/src/hinoko.map
index cf60eb9..b0d64df 100644
--- a/src/hinoko.map
+++ b/src/hinoko.map
@@ -4,8 +4,6 @@ HINOKO_0_1_0 {
"hinoko_fw_scode_get_type";
"hinoko_fw_iso_ctx_match_flag_get_type";
- "hinoko_fw_iso_rx_single_new";
-
"hinoko_fw_iso_rx_multiple_new";
"hinoko_fw_iso_tx_new";
@@ -51,13 +49,6 @@ HINOKO_0_7_0 {
"hinoko_fw_iso_ctx_create_source";
"hinoko_fw_iso_ctx_flush_completions";
- "hinoko_fw_iso_rx_single_get_type";
- "hinoko_fw_iso_rx_single_allocate";
- "hinoko_fw_iso_rx_single_map_buffer";
- "hinoko_fw_iso_rx_single_register_packet";
- "hinoko_fw_iso_rx_single_start";
- "hinoko_fw_iso_rx_single_get_payload";
-
"hinoko_fw_iso_rx_multiple_get_type";
"hinoko_fw_iso_rx_multiple_allocate";
"hinoko_fw_iso_rx_multiple_map_buffer";
@@ -85,3 +76,13 @@ HINOKO_0_7_0 {
"hinoko_fw_iso_resource_once_deallocate_async";
"hinoko_fw_iso_resource_once_deallocate_sync";
} HINOKO_0_5_0;
+
+HINOKO_0_8_0 {
+ "hinoko_fw_iso_ir_single_get_type";
+ "hinoko_fw_iso_ir_single_new";
+ "hinoko_fw_iso_ir_single_allocate";
+ "hinoko_fw_iso_ir_single_map_buffer";
+ "hinoko_fw_iso_ir_single_register_packet";
+ "hinoko_fw_iso_ir_single_start";
+ "hinoko_fw_iso_ir_single_get_payload";
+} HINOKO_0_7_0;
diff --git a/src/meson.build b/src/meson.build
index 98db774..e1293ce 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -8,7 +8,7 @@ dependencies = [
sources = [
'fw_iso_ctx.c',
- 'fw_iso_rx_single.c',
+ 'fw_iso_ir_single.c',
'fw_iso_rx_multiple.c',
'fw_iso_tx.c',
'cycle_timer.c',
@@ -20,7 +20,7 @@ sources = [
headers = [
'hinoko.h',
'fw_iso_ctx.h',
- 'fw_iso_rx_single.h',
+ 'fw_iso_ir_single.h',
'fw_iso_rx_multiple.h',
'fw_iso_tx.h',
'cycle_timer.h',
diff --git a/tests/fw-iso-rx-single b/tests/fw-iso-ir-single
index 07a0c59..42a64fb 100755
--- a/tests/fw-iso-rx-single
+++ b/tests/fw-iso-ir-single
@@ -9,7 +9,7 @@ import gi
gi.require_version('Hinoko', '0.0')
from gi.repository import Hinoko
-target_type = Hinoko.FwIsoRxSingle
+target_type = Hinoko.FwIsoIrSingle
props = (
# From interface.
'bytes-per-chunk',
diff --git a/tests/meson.build b/tests/meson.build
index 4107b85..6ea2c9f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,7 +1,7 @@
tests = [
'hinoko-enum',
'fw-iso-ctx',
- 'fw-iso-rx-single',
+ 'fw-iso-ir-single',
'fw-iso-rx-multiple',
'fw-iso-tx',
'fw-iso-resource',