aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-06-29 12:52:17 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2023-06-29 19:47:24 +0900
commit97e3b0e12ab17580032d79258b7d5090bf0539c7 (patch)
tree449bcbd012b54ba9c2bed293da589651670d3ed6
parent36cf15da013a36637a3385143e9583457a9eb79e (diff)
downloadlibhinawa-97e3b0e12ab17580032d79258b7d5090bf0539c7.tar.gz
fw_fcp: add responded2 signal
The responded signal has the lack of time stamp. This commit adds a new variation of signal to deliver data with time stamp. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--src/fw_fcp.c36
-rw-r--r--src/hinawa_sigs_marshal.list1
-rwxr-xr-xtests/fw-fcp1
3 files changed, 37 insertions, 1 deletions
diff --git a/src/fw_fcp.c b/src/fw_fcp.c
index cc2c652..c3fa8f9 100644
--- a/src/fw_fcp.c
+++ b/src/fw_fcp.c
@@ -122,6 +122,7 @@ static void fw_fcp_finalize(GObject *obj)
enum fw_fcp_sig_type {
FW_FCP_SIG_TYPE_RESPONDED = 1,
+ FW_FCP_SIG_TYPE_RESPONDED2,
FW_FCP_SIG_TYPE_COUNT,
};
static guint fw_fcp_sigs[FW_FCP_SIG_TYPE_COUNT] = { 0 };
@@ -181,9 +182,11 @@ static void hinawa_fw_fcp_class_init(HinawaFwFcpClass *klass)
* @frame_size: The number of elements of the array.
*
* Emitted when the node transfers asynchronous packet as response for FCP and the process
- * successfully read the content of packet.
+ * successfully read the content of packet, except for the case that
+ * [signal@FwFcp::responded2] signal handler is already assigned.
*
* Since: 2.1
+ * Deprecated: 2.6: Use [signal@FwFcp::responded2], instead.
*/
fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED] =
g_signal_new("responded",
@@ -194,6 +197,37 @@ static void hinawa_fw_fcp_class_init(HinawaFwFcpClass *klass)
hinawa_sigs_marshal_VOID__POINTER_UINT,
G_TYPE_NONE,
2, G_TYPE_POINTER, G_TYPE_UINT);
+
+ /**
+ * HinawaFwFcp::responded2:
+ * @self: A [class@FwFcp].
+ * @frame: (array length=frame_size)(element-type guint8): The array with elements for byte
+ * data of response for FCP.
+ * @frame_size: The number of elements of the array.
+ * @tstamp: The time stamp at which the request arrived for the response of FCP
+ * transaction.
+ *
+ * Emitted when the node transfers asynchronous packet as response for FCP and the process
+ * successfully read the content of packet.
+ *
+ * The values of @tstamp is unsigned 16 bit integer including higher 3 bits for three low
+ * order bits of second field and the rest 13 bits for cycle field in the format of IEEE
+ * 1394 CYCLE_TIMER register.
+ *
+ * If the version of kernel ABI for Linux FireWire subsystem is less than 6, the value of
+ * @tstamp argument has invalid value (=G_MAXUINT).
+ *
+ * Since: 2.6.
+ */
+ fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED2] =
+ g_signal_new("responded2",
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ hinawa_sigs_marshal_VOID__POINTER_UINT_UINT,
+ G_TYPE_NONE,
+ 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT);
}
static void hinawa_fw_fcp_init(HinawaFwFcp *self)
diff --git a/src/hinawa_sigs_marshal.list b/src/hinawa_sigs_marshal.list
index dd868e7..f93573c 100644
--- a/src/hinawa_sigs_marshal.list
+++ b/src/hinawa_sigs_marshal.list
@@ -4,5 +4,6 @@ VOID:ENUM,POINTER,UINT
VOID:ENUM,POINTER,UINT,UINT,UINT
VOID:ENUM,UINT,UINT,UINT,POINTER,UINT
VOID:POINTER,UINT
+VOID:POINTER,UINT,UINT
ENUM:ENUM,UINT64,UINT,UINT,UINT,UINT,POINTER,UINT
ENUM:ENUM,UINT64,UINT,UINT,UINT,UINT,UINT,POINTER,UINT
diff --git a/tests/fw-fcp b/tests/fw-fcp
index 8edeeaa..4f1ab35 100755
--- a/tests/fw-fcp
+++ b/tests/fw-fcp
@@ -27,6 +27,7 @@ vmethods = (
)
signals = (
'responded',
+ 'responded2',
)
if not test_object(target_type, props, methods, vmethods, signals):