ykp_ndef_as_text;
yk_check_firmware_version2;
yk_set_usb_mode;
+ ykp_alloc_device_config;
+ ykp_free_device_config;
+ ykp_set_device_mode;
+ ykp_set_device_chalresp_timeout;
+ ykp_set_device_autoeject_time;
# Variables:
} LIBYKPERS_1.9;
return 1;
}
+YK_DEVICE_CONFIG *ykp_alloc_device_config(void)
+{
+ YK_DEVICE_CONFIG *cfg = malloc(sizeof(YK_DEVICE_CONFIG));
+ if(cfg) {
+ memset(cfg, 0, sizeof(YK_DEVICE_CONFIG));
+ return cfg;
+ }
+ return 0;
+}
+
+int ykp_free_device_config(YK_DEVICE_CONFIG *device_config)
+{
+ if(device_config) {
+ free(device_config);
+ return 1;
+ }
+ return 0;
+}
+
+int ykp_set_device_mode(YK_DEVICE_CONFIG *device_config, unsigned char mode)
+{
+ if(device_config) {
+ device_config->mode = mode;
+ return 1;
+ }
+ ykp_errno = YKP_EINVAL;
+ return 0;
+}
+
+int ykp_set_device_chalresp_timeout(YK_DEVICE_CONFIG *device_config, unsigned char timeout)
+{
+ if(device_config) {
+ device_config->crTimeout = timeout;
+ return 1;
+ }
+ ykp_errno = YKP_EINVAL;
+ return 0;
+}
+
+int ykp_set_device_autoeject_time(YK_DEVICE_CONFIG *device_config, unsigned short eject_time)
+{
+ if(device_config) {
+ device_config->autoEjectTime = eject_time;
+ return 1;
+ }
+ ykp_errno = YKP_EINVAL;
+ return 0;
+}
+
static bool vcheck_all(const YKP_CONFIG *cfg)
{
return true;
int ykp_set_ndef_access_code(YK_NDEF *ndef, unsigned char *access_code);
int ykp_ndef_as_text(YK_NDEF *ndef, char *text, size_t len);
+YK_DEVICE_CONFIG *ykp_alloc_device_config(void);
+int ykp_free_device_config(YK_DEVICE_CONFIG *device_config);
+int ykp_set_device_mode(YK_DEVICE_CONFIG *device_config, unsigned char mode);
+int ykp_set_device_chalresp_timeout(YK_DEVICE_CONFIG *device_config, unsigned char timeout);
+int ykp_set_device_autoeject_time(YK_DEVICE_CONFIG *device_config, unsigned short eject_time);
+
int ykp_set_access_code(YKP_CONFIG *cfg, unsigned char *access_code, size_t len);
int ykp_set_fixed(YKP_CONFIG *cfg, unsigned char *fixed, size_t len);
int ykp_set_uid(YKP_CONFIG *cfg, unsigned char *uid, size_t len);