aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-06-30 12:00:30 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2023-06-30 18:41:23 +0900
commitb5cecfc928386aa3e1b9467aabc0c214e9c1e573 (patch)
tree9d0bd77f6e9bf07b63ed81e9c12f7c44cbbdc88f
parent566a48f7bb6beb6a1bc2dd2ff4edf9c91c3284b3 (diff)
downloadlibhinawa-b5cecfc928386aa3e1b9467aabc0c214e9c1e573.tar.gz
fcp: refine the order of argument for new signal
It is preferable to locate the argument for variable-length of array in the end of argument list. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--samples/common/__init__.py2
-rw-r--r--src/fw_fcp.c14
-rw-r--r--src/fw_fcp.h6
-rw-r--r--src/hinawa_sigs_marshal.list2
4 files changed, 12 insertions, 12 deletions
diff --git a/samples/common/__init__.py b/samples/common/__init__.py
index f8dba9c..9a3f9f6 100644
--- a/samples/common/__init__.py
+++ b/samples/common/__init__.py
@@ -173,7 +173,7 @@ def listen_region(node: Hinawa.FwNode):
resp.release()
-def handle_responded2(fcp: Hinawa.FwFcp, frame: list, length: int, tstamp: int,
+def handle_responded2(fcp: Hinawa.FwFcp, tstamp: int, frame: list, length: int,
args: tuple[Hinawa.FwNode, Hinawa.CycleTime]):
node, cycle_time = args
print('Event responded2: length {}'.format(length))
diff --git a/src/fw_fcp.c b/src/fw_fcp.c
index 5bc0c11..93f8c24 100644
--- a/src/fw_fcp.c
+++ b/src/fw_fcp.c
@@ -201,11 +201,11 @@ static void hinawa_fw_fcp_class_init(HinawaFwFcpClass *klass)
/**
* HinawaFwFcp::responded2:
* @self: A [class@FwFcp].
+ * @tstamp: The time stamp at which the request arrived for the response of FCP
+ * transaction.
* @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.
@@ -225,9 +225,9 @@ static void hinawa_fw_fcp_class_init(HinawaFwFcpClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET(HinawaFwFcpClass, responded2),
NULL, NULL,
- hinawa_sigs_marshal_VOID__POINTER_UINT_UINT,
+ hinawa_sigs_marshal_VOID__UINT_POINTER_UINT,
G_TYPE_NONE,
- 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT);
+ 3, G_TYPE_UINT, G_TYPE_POINTER, G_TYPE_UINT);
}
static void hinawa_fw_fcp_init(HinawaFwFcp *self)
@@ -341,8 +341,8 @@ struct waiter {
GMutex mutex;
};
-static void handle_responded2_signal(HinawaFwFcp *self, const guint8 *frame, guint frame_size,
- guint tstamp, gpointer user_data)
+static void handle_responded2_signal(HinawaFwFcp *self, guint tstamp, const guint8 *frame,
+ guint frame_size, gpointer user_data)
{
struct waiter *w = (struct waiter *)user_data;
@@ -565,7 +565,7 @@ static HinawaFwRcode handle_requested3_signal(HinawaFwResp *resp, HinawaFwTcode
src == node_id) {
if (klass->responded2 != NULL ||
g_signal_has_handler_pending(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED2], 0, TRUE)) {
- g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED2], 0, frame, length, tstamp);
+ g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED2], 0, tstamp, frame, length);
} else if (klass->responded != NULL ||
g_signal_has_handler_pending(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED], 0, TRUE)) {
g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED], 0, frame, length);
diff --git a/src/fw_fcp.h b/src/fw_fcp.h
index 62748b6..7d9682f 100644
--- a/src/fw_fcp.h
+++ b/src/fw_fcp.h
@@ -33,17 +33,17 @@ struct _HinawaFwFcpClass {
/**
* HinawaFwFcpClass::responded2:
* @self: A [class@FwFcp].
+ * @tstamp: The time stamp at which the request arrived for the response for FCP
+ * transaction.
* @frame: (array length=frame_size)(element-type guint8): The array with elements for byte
* data of response for Function Control Protocol.
* @frame_size: The number of elements of the array.
- * @tstamp: The time stamp at which the request arrived for the response for FCP
- * transaction.
*
* Class closure for the [signal@FwFcp::responded2] signal.
*
* Since: 2.6
*/
- void (*responded2)(HinawaFwFcp *self, const guint8 *frame, guint frame_size, guint tstamp);
+ void (*responded2)(HinawaFwFcp *self, guint tstamp, const guint8 *frame, guint frame_size);
};
HinawaFwFcp *hinawa_fw_fcp_new(void);
diff --git a/src/hinawa_sigs_marshal.list b/src/hinawa_sigs_marshal.list
index f93573c..311d2da 100644
--- a/src/hinawa_sigs_marshal.list
+++ b/src/hinawa_sigs_marshal.list
@@ -4,6 +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
+VOID:UINT,POINTER,UINT
ENUM:ENUM,UINT64,UINT,UINT,UINT,UINT,POINTER,UINT
ENUM:ENUM,UINT64,UINT,UINT,UINT,UINT,UINT,POINTER,UINT