summaryrefslogtreecommitdiff
path: root/include/adapter.h
diff options
context:
space:
mode:
authorWiktor Lawski <wiktor.lawski@tieto.com>2012-09-27 10:31:26 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-09 17:52:16 +0200
commitfce1942401571af6ae1ca9e93081a8dee1fa306e (patch)
tree3747247e6ed407ef3a8cf743985f79f6f81ce644 /include/adapter.h
parent6134061b9cc34bc8472be985e2bded59e907a889 (diff)
downloadneard-fce1942401571af6ae1ca9e93081a8dee1fa306e.tar.gz
neard-fce1942401571af6ae1ca9e93081a8dee1fa306e.tar.bz2
neard-fce1942401571af6ae1ca9e93081a8dee1fa306e.zip
adapter: Refactor function near_adapter_send
Now this function will release allocated data using callback, so it will be unnecessary to check its returned error code (if callback was passed). Main reasons to prepare this change were improvement of code readability and removing error prone code paths.
Diffstat (limited to 'include/adapter.h')
-rw-r--r--include/adapter.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/adapter.h b/include/adapter.h
index faf32ba..e547d3d 100644
--- a/include/adapter.h
+++ b/include/adapter.h
@@ -27,10 +27,12 @@
#include <unistd.h>
typedef int (*near_recv)(uint8_t *resp, int length, void *data);
+typedef int (*near_release)(int err, void *data);
int near_adapter_connect(uint32_t idx, uint32_t target_idx, uint8_t protocol);
int near_adapter_disconnect(uint32_t idx);
-int near_adapter_send(uint32_t idx, uint8_t *buf, size_t length, near_recv rx_cb, void *data);
+int near_adapter_send(uint32_t idx, uint8_t *buf, size_t length,
+ near_recv rx_cb, void *data, near_release data_rel);
int near_adapter_recv(uint32_t idx, uint8_t *buf, size_t length);
#endif