[-]
[+]
|
Changed |
_service:tar_git:nfcd-binder-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:nfcd-binder-plugin.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,8 +1,8 @@
<services>
<service name="tar_git">
- <param name="url">https://github.com/sailfishos-oneplus5/nfcd-binder-plugin.git</param>
+ <param name="url">https://github.com/mer-hybris/nfcd-binder-plugin.git</param>
<param name="branch">master</param>
- <param name="revision">HEAD</param>
+ <param name="revision">1.1.8</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:nfcd-binder-plugin-1.1.8.tar.bz2/Makefile
^
|
@@ -56,10 +56,12 @@
DEBUG_FLAGS = -g
RELEASE_FLAGS =
-ifndef KEEP_SYMBOLS
-KEEP_SYMBOLS = 0
+DISABLE_HEXDUMP ?= 0
+ifneq ($(DISABLE_HEXDUMP),0)
+DEFINES += -DDISABLE_HEXDUMP
endif
+KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
@@ -136,14 +138,15 @@
# Install
#
-INSTALL_PERM = 755
+PLUGIN_DIR ?= usr/lib/nfcd/plugins
+ABS_PLUGIN_DIR := $(shell echo /$(PLUGIN_DIR) | sed -r 's|/+|/|g')
+
INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
-INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
-INSTALL_LIB_DIR = $(DESTDIR)/usr/lib/nfcd/plugins
+INSTALL_PLUGIN_DIR = $(DESTDIR)$(ABS_PLUGIN_DIR)
-install: $(INSTALL_LIB_DIR)
- $(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
+install: $(INSTALL_PLUGIN_DIR)
+ $(INSTALL) -m 755 $(RELEASE_LIB) $(INSTALL_PLUGIN_DIR)
-$(INSTALL_LIB_DIR):
+$(INSTALL_PLUGIN_DIR):
$(INSTALL_DIRS) $@
|
[-]
[+]
|
Changed |
_service:tar_git:nfcd-binder-plugin-1.1.8.tar.bz2/src/binder_nfc_adapter.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2018-2019 Jolla Ltd.
- * Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2018-2021 Jolla Ltd.
+ * Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -132,19 +132,8 @@
#define DIR_IN '>'
#define DIR_OUT '<'
-#define DUMP(f,args...) gutil_log(&binder_hexdump_log, \
- GLOG_LEVEL_VERBOSE, f, ##args)
-
-static
-gboolean
-binder_nfc_adapter_close(
- BinderNfcAdapter* self);
-
-static
-void
-binder_nfc_adapter_state_check(
- BinderNfcAdapter* self);
+#ifndef DISABLE_HEXDUMP
static
void
binder_hexdump(
@@ -182,6 +171,24 @@
}
}
+ #define BINDER_DUMP(dir, data, len) binder_dump_data(dir, data, len)
+ #define DUMP(f,args...) gutil_log(&binder_hexdump_log, \
+ GLOG_LEVEL_VERBOSE, f, ##args)
+#else
+ #define BINDER_DUMP(dir, data, len)
+ #define DUMP(f,args...)
+#endif /* !DISABLE_HEXDUMP */
+
+static
+gboolean
+binder_nfc_adapter_close(
+ BinderNfcAdapter* self);
+
+static
+void
+binder_nfc_adapter_state_check(
+ BinderNfcAdapter* self);
+
/*==========================================================================*
* INfcClientCallback
*==========================================================================*/
@@ -243,7 +250,7 @@
NciHalClient* hal_client = self->hal_client;
DUMP("%c data, %u byte(s)", DIR_IN, (guint)len);
- binder_dump_data(DIR_IN, data, len);
+ BINDER_DUMP(DIR_IN, data, len);
if (hal_client) {
hal_client->fn->read(hal_client, data, len);
}
@@ -328,7 +335,7 @@
GBinderWriter writer;
gulong id;
- binder_dump_data(DIR_OUT, data, len);
+ BINDER_DUMP(DIR_OUT, data, len);
gbinder_local_request_init_writer(req, &writer);
gbinder_writer_append_hidl_vec(&writer, data, len, 1);
id = gbinder_client_transact(self->client, BINDER_NFC_REQ_WRITE,
@@ -508,7 +515,7 @@
BinderNfcAdapter* self)
{
/* We can release our local object now */
- gbinder_local_object_unref(self->callback);
+ gbinder_local_object_drop(self->callback);
self->callback = NULL;
GDEBUG("Power off");
@@ -577,6 +584,18 @@
binder_nfc_adapter_close(
BinderNfcAdapter* self)
{
+ NciCore* nci = self->adapter.nci;
+
+ /* Should never be > NCI_RFST_IDLE but let's check >= just in case */
+ if (nci->current_state >= NCI_RFST_IDLE) {
+ /*
+ * Make sure that state machine isn't going to continue
+ * transition to RFST_DISCOVERY while we are closing the
+ * adapter.
+ */
+ nci_core_set_state(nci, NCI_RFST_IDLE);
+ }
+
GDEBUG("Closing adapter");
GASSERT(!self->pending_tx);
self->close_cplt = binder_nfc_adapter_close_cplt;
|
[-]
[+]
|
Changed |
_service:tar_git:nfcd-binder-plugin-1.1.8.tar.bz2/src/binder_nfc_plugin.c
^
|
@@ -130,15 +130,18 @@
void* plugin)
{
BinderNfcPlugin* self = BINDER_NFC_PLUGIN(plugin);
- char** ptr;
self->list_call_id = 0;
- for (ptr = services; *ptr; ptr++) {
- if (g_str_has_prefix(*ptr, BINDER_NFC)) {
- const char* sep = strchr(*ptr, '/');
+ if (services) {
+ char** ptr;
- if (sep) {
- binder_nfc_plugin_add_adapter(self, sep + 1);
+ for (ptr = services; *ptr; ptr++) {
+ if (g_str_has_prefix(*ptr, BINDER_NFC)) {
+ const char* sep = strchr(*ptr, '/');
+
+ if (sep) {
+ binder_nfc_plugin_add_adapter(self, sep + 1);
+ }
}
}
}
|