diff options
| author | 2014-10-29 06:58:10 +0100 | |
|---|---|---|
| committer | 2014-10-29 06:58:10 +0100 | |
| commit | 4868c6c235243ae004cf819bdcbb843374ac5b52 (patch) | |
| tree | d2eed093a1e0a30056f4ac0ff2d294dd69db9f16 /hasplib.h | |
| download | hasplib-4868c6c235243ae004cf819bdcbb843374ac5b52.tar.xz hasplib-4868c6c235243ae004cf819bdcbb843374ac5b52.zip | |
Initial commit.
Diffstat (limited to 'hasplib.h')
| -rw-r--r-- | hasplib.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/hasplib.h b/hasplib.h new file mode 100644 index 0000000..e8662f1 --- /dev/null +++ b/hasplib.h @@ -0,0 +1,37 @@ +#ifndef HASPLIB_H +#define HASPLIB_H +#if defined(__cplusplus) +extern "C" { +#endif + +#include <stdint.h> +#include <stdbool.h> +#include <stddef.h> + +typedef struct _hasp_dongle hasp_dongle; + +size_t hasp_find_dongles(hasp_dongle ***dongles); +void hasp_free_dongles(hasp_dongle **dongles); +void hasp_free_dongle(hasp_dongle *dongle); + +hasp_dongle *hasp_find_login_first_dongle(uint16_t password1, uint16_t password2); + +bool hasp_init(hasp_dongle *dongle); +bool hasp_login(hasp_dongle *dongle, uint16_t password1, uint16_t password2, uint16_t *memory_size); + +bool hasp_id(hasp_dongle *dongle, uint32_t *id); +bool hasp_read(hasp_dongle *dongle, uint16_t location, uint16_t *value); +bool hasp_write(hasp_dongle *dongle, uint16_t location, uint16_t value); + +typedef struct _hasp_simple hasp_simple; +hasp_simple *hasp_simple_login(uint16_t password1, uint16_t password2); +void hasp_simple_free(hasp_simple *simple); +uint32_t hasp_simple_id(hasp_simple *simple); +uint16_t hasp_simple_read(hasp_simple *simple, uint16_t location); +bool hasp_simple_write(hasp_simple *simple, uint16_t location, uint16_t value); + + +#if defined(__cplusplus) +} +#endif +#endif |
