summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 22:25:11 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 22:28:54 +0200
commit010d25fceb91360ac3d8bd0bd61604649f7994ac (patch)
treeb46833aa9ca1efecad38ad12952e647e2114b16b /include
parent4ac5f8bbbd6e007ecd02be46bfbc0c11de010722 (diff)
downloadlibnitrokey-010d25fceb91360ac3d8bd0bd61604649f7994ac.tar.gz
libnitrokey-010d25fceb91360ac3d8bd0bd61604649f7994ac.tar.bz2
Move get_payload to misc
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include')
-rw-r--r--include/misc.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/misc.h b/include/misc.h
index 07f221c..a5d9e6d 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -6,7 +6,16 @@
namespace nitrokey {
namespace misc {
-std::string hexdump(const char *p, size_t size);
+template <typename T>
+typename T::CommandPayload get_payload(){
+ //Create, initialize and return by value command payload
+ typename T::CommandPayload st;
+ bzero(&st, sizeof(st));
+ return st;
+}
+
+
+ std::string hexdump(const char *p, size_t size);
uint32_t stm_crc32(const uint8_t *data, size_t size);
}
}