1 /*
2  * Copyright (c) 2017 Oticon A/S
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef NRF_HW_ARGS_H
7 #define NRF_HW_ARGS_H
8 
9 #include <stdbool.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef struct {
16   double xo_drift;
17   double start_offset;
18   bool useRealAES;
19 } nrf_hw_sub_args_t;
20 
21 void nrf_hw_sub_cmline_set_defaults(nrf_hw_sub_args_t *ptr);
22 int nrf_hw_sub_cmdline_parse(char *argv_i, nrf_hw_sub_args_t *args);
23 void nrf_hw_sub_command_line_handle(nrf_hw_sub_args_t *args, double start_time);
24 
25 extern double nrfhw_start_of;
26 void nrf_hw_cmd_starto_found(char * argv, int offset);
27 extern double nrfhw_drift;
28 void nrf_hw_cmd_drift_found(char * argv, int offset);
29 extern bool nrfhw_useRealAES;
30 void nrf_hw_cmd_useRealAES_found(char * argv, int offset);
31 
32 #define _NRF_HW_SUB_CMD_ARG_STRUCT \
33   /*manual,mandatory,switch, option,             name ,   type,  destination,                callback,                      , description*/ \
34   { false  , false , false, "start_offset" ,  "start_of", 'f', (void*)&nrfhw_start_of, nrf_hw_cmd_starto_found,"Offset in time (at the start of the simulation) of this device. At time 0 of the device, the phy will be at <start_of>"}, \
35   { false  , false , false, "xo_drift" ,      "xo_drift", 'f', (void*)&nrfhw_drift,    nrf_hw_cmd_drift_found, "Simple linear model of the XO drift of this device. For ex. for -30ppm set to -30e-6"}, \
36   { false  , false , false, "RealEncryption", "realAES",  'b', (void*)&nrfhw_useRealAES, nrf_hw_cmd_useRealAES_found, "(0)/1 Use the real AES encryption for the LL or just send everything in plain text (default) (requires the ext_libCryptov1 component)"}
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif
43