diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-07-14 19:17:24 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2023-07-15 09:36:57 +0900 |
commit | aa3f0c726e14e9eff18d995cdc7342f3b5bb8ab6 (patch) | |
tree | 8bee864009b7c09c6168489c31ffb562876bd453 | |
parent | d72eb6dcae8f55b72dcbb69b9ad3d881a24a76f2 (diff) | |
download | libhinawa-aa3f0c726e14e9eff18d995cdc7342f3b5bb8ab6.tar.gz |
fw_req: remove 'sync' suffix from Hinawa.FwReq.transaction_with_tstamp()
The suffixes, 'sync' and 'async', in name of method is special in GNOME
project. They are related to usage of GTask for asynchronous I/O, while
current usage in the library is for blocking I/O.
This commit removes 'sync' suffix from the added API. In future 3.0
release, existent method, hinawa_fw_req_transaction(), will be deleted
once, then it will be redefined as the one without time stamp.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | README.rst | 10 | ||||
-rw-r--r-- | samples/common/__init__.py | 2 | ||||
-rw-r--r-- | src/fw_fcp.c | 10 | ||||
-rw-r--r-- | src/fw_req.c | 15 | ||||
-rw-r--r-- | src/fw_req.h | 8 | ||||
-rw-r--r-- | src/hinawa.map | 2 | ||||
-rwxr-xr-x | tests/fw-req | 2 |
7 files changed, 28 insertions, 21 deletions
@@ -50,8 +50,14 @@ Example of Python3 with PyGobject addr = 0xfffff0000404 req = Hinawa.FwReq.new() frame = [0] * 4 - frame = req.transaction_sync(node, Hinawa.FwTcode.READ_QUADLET_REQUEST, addr, - len(frame), frame, 50) + _, frame, tstamp = req.transaction_with_tstamp( + node, + Hinawa.FwTcode.READ_QUADLET_REQUEST, + addr, + len(frame), + frame, + 50 + ) quad = unpack('>I', frame)[0] print('0x{:012x}: 0x{:02x}'.format(addr, quad)) diff --git a/samples/common/__init__.py b/samples/common/__init__.py index 9a3f9f6..816a8dd 100644 --- a/samples/common/__init__.py +++ b/samples/common/__init__.py @@ -75,7 +75,7 @@ def read_quadlet(node: Hinawa.FwNode, req: Hinawa.FwReq, addr: int) -> int: frame = [0] * 4 try: - _, frame, tstamp = req.transaction_with_tstamp_sync( + _, frame, tstamp = req.transaction_with_tstamp( node, Hinawa.FwTcode.READ_QUADLET_REQUEST, addr, diff --git a/src/fw_fcp.c b/src/fw_fcp.c index cb41698..9a893c3 100644 --- a/src/fw_fcp.c +++ b/src/fw_fcp.c @@ -266,11 +266,11 @@ static gboolean complete_command_transaction(HinawaFwFcp *self, const guint8 *cm req = g_object_new(HINAWA_TYPE_FW_REQ, NULL); // Finish transaction for command frame. - result = hinawa_fw_req_transaction_with_tstamp_sync(req, priv->node, - HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST, - FCP_REQUEST_ADDR, cmd_size, - (guint8 **)&cmd, &cmd_size, - tstamp, timeout_ms, error); + result = hinawa_fw_req_transaction_with_tstamp(req, priv->node, + HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST, + FCP_REQUEST_ADDR, cmd_size, + (guint8 **)&cmd, &cmd_size, + tstamp, timeout_ms, error); g_object_unref(req); return result; diff --git a/src/fw_req.c b/src/fw_req.c index 94e1999..4fe0c1c 100644 --- a/src/fw_req.c +++ b/src/fw_req.c @@ -113,7 +113,7 @@ static void hinawa_fw_req_class_init(HinawaFwReqClass *klass) * HinawaFwReq:timeout: * * Since: 1.4 - * Deprecated: 2.1: Use timeout_ms parameter of [method@FwReq.transaction_sync]. + * Deprecated: 2.1: Use timeout_ms parameter of [method@FwReq.transaction_with_tstamp]. */ fw_req_props[FW_REQ_PROP_TYPE_TIMEOUT] = g_param_spec_uint("timeout", "timeout", @@ -434,6 +434,7 @@ static gboolean complete_transaction(HinawaFwReq *self, HinawaFwNode *node, Hina * instance is ignored. * * Since: 2.1. + * Deprecated: 2.6. Use [method@FwReq.transaction_with_tstamp] instead. */ void hinawa_fw_req_transaction_sync(HinawaFwReq *self, HinawaFwNode *node, HinawaFwTcode tcode, guint64 addr, gsize length, @@ -447,7 +448,7 @@ void hinawa_fw_req_transaction_sync(HinawaFwReq *self, HinawaFwNode *node, } /** - * hinawa_fw_req_transaction_with_tstamp_sync: + * hinawa_fw_req_transaction_with_tstamp: * @self: A [class@FwReq]. * @node: A [class@FwNode]. * @tcode: A transaction code of [enum@FwTcode]. @@ -481,10 +482,10 @@ void hinawa_fw_req_transaction_sync(HinawaFwReq *self, HinawaFwNode *node, * Returns: TRUE if the overall operation finishes successfully, otherwise FALSE. * Since: 2.6 */ -gboolean hinawa_fw_req_transaction_with_tstamp_sync(HinawaFwReq *self, HinawaFwNode *node, - HinawaFwTcode tcode, guint64 addr, gsize length, - guint8 **frame, gsize *frame_size, guint tstamp[2], - guint timeout_ms, GError **error) +gboolean hinawa_fw_req_transaction_with_tstamp(HinawaFwReq *self, HinawaFwNode *node, + HinawaFwTcode tcode, guint64 addr, gsize length, + guint8 **frame, gsize *frame_size, guint tstamp[2], + guint timeout_ms, GError **error) { struct waiter w; gboolean result; @@ -522,7 +523,7 @@ gboolean hinawa_fw_req_transaction_with_tstamp_sync(HinawaFwReq *self, HinawaFwN * for response subaction within the value of timeout argument. * * Since: 1.4 - * Deprecated: 2.1: Use [method@FwReq.transaction_sync] instead. + * Deprecated: 2.1: Use [method@FwReq.transaction_with_tstamp()] instead. */ void hinawa_fw_req_transaction(HinawaFwReq *self, HinawaFwNode *node, HinawaFwTcode tcode, guint64 addr, gsize length, diff --git a/src/fw_req.h b/src/fw_req.h index 66c24bf..66d1360 100644 --- a/src/fw_req.h +++ b/src/fw_req.h @@ -63,10 +63,10 @@ void hinawa_fw_req_transaction_sync(HinawaFwReq *self, HinawaFwNode *node, guint8 *const *frame, gsize *frame_size, guint timeout_ms, GError **error); -gboolean hinawa_fw_req_transaction_with_tstamp_sync(HinawaFwReq *self, HinawaFwNode *node, - HinawaFwTcode tcode, guint64 addr, gsize length, - guint8 **frame, gsize *frame_size, guint tstamp[2], - guint timeout_ms, GError **error); +gboolean hinawa_fw_req_transaction_with_tstamp(HinawaFwReq *self, HinawaFwNode *node, + HinawaFwTcode tcode, guint64 addr, gsize length, + guint8 **frame, gsize *frame_size, guint tstamp[2], + guint timeout_ms, GError **error); void hinawa_fw_req_transaction(HinawaFwReq *self, HinawaFwNode *node, HinawaFwTcode tcode, guint64 addr, gsize length, diff --git a/src/hinawa.map b/src/hinawa.map index f0d1d92..f31df1e 100644 --- a/src/hinawa.map +++ b/src/hinawa.map @@ -172,7 +172,7 @@ HINAWA_2_6_0 { "hinawa_fw_node_read_cycle_time"; - "hinawa_fw_req_transaction_with_tstamp_sync"; + "hinawa_fw_req_transaction_with_tstamp"; "hinawa_fw_fcp_command_with_tstamp"; "hinawa_fw_fcp_avc_transaction_with_tstamp"; diff --git a/tests/fw-req b/tests/fw-req index 341ca1b..823d84d 100755 --- a/tests/fw-req +++ b/tests/fw-req @@ -18,7 +18,7 @@ methods = ( 'transaction', 'transaction_async', 'transaction_sync', - 'transaction_with_tstamp_sync', + 'transaction_with_tstamp', ) vmethods = ( 'do_responded', |