1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
23 #define _USE_MATH_DEFINES
25 typedef enum {STYLE_BAR
, STYLE_MIXED
, STYLE_VALUE
} barMode_t
;
26 typedef enum logLevel
{NORMAL
, SUCCESS
, INFO
, FAILED
, WARNING
, ERR
, DEBUG
, INPLACE
, HINT
} logLevel_t
;
27 typedef enum emojiMode
{EMO_ALIAS
, EMO_EMOJI
, EMO_ALTTEXT
, EMO_NONE
} emojiMode_t
;
28 typedef enum clientdebugLevel
{cdbOFF
, cdbSIMPLE
, cdbFULL
} clientdebugLevel_t
;
29 // typedef enum devicedebugLevel {ddbOFF, ddbERROR, ddbINFO, ddbDEBUG, ddbEXTENDED} devicedebugLevel_t;
30 typedef enum savePaths
{spDefault
, spDump
, spTrace
, spItemCount
} savePaths_t
; // last item spItemCount used to auto map to number of files
31 typedef struct {int x
; int y
; int h
; int w
;} qtWindow_t
;
34 bool preferences_loaded
;
38 emojiMode_t emoji_mode
;
42 bool window_changed
; // track if plot/overlay pos/size changed to save on exit
47 char *defaultPaths
[spItemCount
]; // Array should allow loop searching for files
48 clientdebugLevel_t client_debug_level
;
50 // uint8_t device_debug_level;
52 pm3_device
*current_device
;
55 extern session_arg_t session
;
56 extern bool showDemod
;
58 #define M_PI 3.14159265358979323846264338327
60 #define MAX_PRINT_BUFFER 2048
62 #define PROMPT_CLEARLINE PrintAndLogEx(INPLACE, " \r")
63 void PrintAndLogOptions(const char *str
[][2], size_t size
, size_t space
);
64 void PrintAndLogEx(logLevel_t level
, const char *fmt
, ...);
65 void SetFlushAfterWrite(bool value
);
66 void memcpy_filter_ansi(void *dest
, const void *src
, size_t n
, bool filter
);
67 void memcpy_filter_rlmarkers(void *dest
, const void *src
, size_t n
);
68 void memcpy_filter_emoji(void *dest
, const void *src
, size_t n
, emojiMode_t mode
);
70 int searchHomeFilePath(char **foundpath
, const char *subdir
, const char *filename
, bool create_home
);
72 extern pthread_mutex_t print_lock
;
74 void print_progress(size_t count
, uint64_t max
, barMode_t style
);
76 void iceIIR_Butterworth(int *data
, const size_t len
);
77 void iceSimple_Filter(int *data
, const size_t len
, uint8_t k
);