summaryrefslogtreecommitdiffstats
path: root/src/stringutils.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-05-24 22:57:13 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-07-04 23:18:45 -0700
commit6eb99ceb647cf35c39dc97292f00040fbb821170 (patch)
tree1db97cb18370f6b25902bb06b2e01a74aae169e2 /src/stringutils.h
parentf9e5259d74c8cf521921a96377c64691b5b3c3ae (diff)
binding: nfc: new initial binding
Slight rewrite to use libnfc initially for getting tag uid's for user settings. Bug-AGL: SPEC-1554 Change-Id: I7b8c30102b82e86a92c89909bcbfba9ab7164c1f Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'src/stringutils.h')
-rw-r--r--src/stringutils.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/stringutils.h b/src/stringutils.h
deleted file mode 100644
index 824d09d..0000000
--- a/src/stringutils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#pragma once
-
-#include <stdlib.h>
-
-/**
- * @brief Get a hexadecimal string representation from memory buffer.
- * @param[in] src Buffer's pointer.
- * @param[in] sz Buffer's size.
- * @return A pointer to the result string. Caller is responsible for the result lifetime.
- */
-static inline char* to_hex_string(const void* src, long unsigned int sz)
-{
- static const char lookup[] =
- {
- '0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'a', 'b',
- 'c', 'd', 'e', 'f'
- };
-
- const char* source;
- char* result;
- long unsigned int i;
-
- result = NULL;
- if (src && sz)
- {
- source = (const char*)src;
- result = (char*)malloc(sz * 2 + 1);
- if (result)
- {
- result[sz * 2] = 0;
- for (i = 0; i < sz; ++i)
- {
- result[i * 2] = lookup[(source[i] & 0xf0) >> 4];
- result[i * 2 + 1] = lookup[source[i] & 0x0f];
- }
- }
- }
- return result;
-}