[PATCH 02/25] efw-downloader: efw-proto: define EfwProto as derived object of HinawaFwResp
Takashi Sakamoto
o-takashi at sakamocchi.jp
Fri Aug 21 09:30:48 CEST 2020
Echo Digital Audio corporation designed specific protocol to operate
Fireworks board module. The protocol includes a pair of asynchronous
transactions on IEEE 1394 bus to transfer command frame and receive
response frame.
This commit adds EfwProto GObject object. This object inherits
HinawaFwResp to receive the response frame from Linux 1394 OHCI driver,
thus libglib-2.0, libgobject-2.0 and libhinawa 2.1 is added for
build and runtime dependency.
Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
efw-downloader/src/efw-proto.c | 25 +++++++++++++++++++++
efw-downloader/src/efw-proto.h | 40 ++++++++++++++++++++++++++++++++++
efw-downloader/src/meson.build | 21 +++++++++++++++++-
3 files changed, 85 insertions(+), 1 deletion(-)
create mode 100644 efw-downloader/src/efw-proto.c
create mode 100644 efw-downloader/src/efw-proto.h
diff --git a/efw-downloader/src/efw-proto.c b/efw-downloader/src/efw-proto.c
new file mode 100644
index 0000000..63fd2c5
--- /dev/null
+++ b/efw-downloader/src/efw-proto.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright (c) 2020 Takashi Sakamoto
+#include "efw-proto.h"
+
+/**
+ * SECTION:efw_proto
+ * @Title: EfwProto
+ * @Short_description: Transaction implementation for Fireworks protocol
+ * @include: fw_fcp.h
+ *
+ * Fireworks board module from Echo Digital Audio corporation supports specific protocol based on
+ * a pair of asynchronous transactions in IEEE 1394 bus. The EfwProto class is an implementation
+ * for the protocol.
+ */
+G_DEFINE_TYPE(EfwProto, efw_proto, HINAWA_TYPE_FW_RESP)
+
+static void efw_proto_class_init(EfwProtoClass *klass)
+{
+ return;
+}
+
+static void efw_proto_init(EfwProto *self)
+{
+ return;
+}
diff --git a/efw-downloader/src/efw-proto.h b/efw-downloader/src/efw-proto.h
new file mode 100644
index 0000000..83e52be
--- /dev/null
+++ b/efw-downloader/src/efw-proto.h
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright (c) 2020 Takashi Sakamoto
+#ifndef __EFW_PROTO_H__
+#define __EFW_PROTO_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <libhinawa/fw_resp.h>
+
+G_BEGIN_DECLS
+
+#define EFW_TYPE_PROTO (efw_proto_get_type())
+
+#define EFW_PROTO(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), EFW_TYPE_PROTO, EfwProto))
+#define EFW_IS_PROTO(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EFW_TYPE_PROTO))
+
+#define EFW_PROTO_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), EFW_TYPE_PROTO, EfwProtoClass))
+#define EFW_IS_PROTO_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), EFW_TYPE_PROTO))
+#define EFW_PROTO_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), EFW_TYPE_PROTO, EfwProtoClass))
+
+typedef struct _EfwProto EfwProto;
+typedef struct _EfwProtoClass EfwProtoClass;
+
+struct _EfwProto {
+ HinawaFwResp parent_instance;
+};
+
+struct _EfwProtoClass {
+ HinawaFwRespClass parent_class;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/efw-downloader/src/meson.build b/efw-downloader/src/meson.build
index b837e92..b7992a2 100644
--- a/efw-downloader/src/meson.build
+++ b/efw-downloader/src/meson.build
@@ -1,11 +1,30 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2020 Takashi Sakamoto
+# Depends on glib-2.0 and gobject-2.0.
+gobject = dependency('gobject-2.0',
+ version: '>=2.34.0',
+)
+
+# Depends on libhinawa v2.1.0 or later.
+hinawa = dependency('hinawa',
+ version: '>=2.1',
+)
+
sources = [
'main.c',
+ 'efw-proto.c',
+]
+
+headers = [
+ 'efw-proto.h',
]
executable('efw-downloader',
- sources: sources,
+ sources: sources + headers,
+ dependencies: [
+ gobject,
+ hinawa,
+ ],
install: true,
)
--
2.25.1
More information about the Alsa-devel
mailing list