File tree 4 files changed +5
-28
lines changed
4 files changed +5
-28
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ int nrf70_bm_rt_init(struct nrf70_bm_regulatory_info *reg_info)
30
30
goto deinit ;
31
31
}
32
32
33
- ret = nrf70_bm_rt_fmac_get_reg (& reg_info_curr );
33
+ ret = nrf70_bm_rt_get_reg (& reg_info_curr );
34
34
if (ret ) {
35
35
NRF70_LOG_ERR ("Failed to get regulatory info" );
36
36
goto deinit ;
@@ -48,17 +48,17 @@ int nrf70_bm_rt_init(struct nrf70_bm_regulatory_info *reg_info)
48
48
goto deinit ;
49
49
}
50
50
51
- memset (reg_info -> chan_info ,
51
+ memset (reg_info_curr . chan_info ,
52
52
0 ,
53
53
sizeof (struct nrf70_bm_reg_chan_info ) * NRF70_MAX_CHANNELS );
54
54
55
- ret = nrf70_bm_rt_get_reg (reg_info );
55
+ ret = nrf70_bm_rt_get_reg (& reg_info_curr );
56
56
if (ret ) {
57
57
printf ("Failed to get regulatory info: %d\n" , ret );
58
58
return -1 ;
59
59
}
60
60
61
- printf ("Regulatory country code set to: %s\n" , reg_info -> country_code );
61
+ printf ("Regulatory country code set to: %s\n" , reg_info_curr . country_code );
62
62
}
63
63
return 0 ;
64
64
deinit :
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ int nrf70_bm_sys_init(uint8_t *mac_addr,
116
116
sizeof (struct nrf70_bm_reg_chan_info ) *
117
117
NRF70_MAX_CHANNELS );
118
118
119
- ret = nrf70_bm_sys_fmac_get_reg (& reg_info_curr );
119
+ ret = nrf70_bm_sys_get_reg (& reg_info_curr );
120
120
if (ret ) {
121
121
NRF70_LOG_ERR ("Failed to get regulatory info" );
122
122
goto deinit ;
Original file line number Diff line number Diff line change @@ -34,13 +34,6 @@ int main(void)
34
34
memcpy (reg_info .country_code , CONFIG_WIFI_RT_REG_DOMAIN , 2 );
35
35
reg_info .force = true;
36
36
37
- reg_info .chan_info = malloc (sizeof (struct nrf70_bm_reg_chan_info ) * NRF70_MAX_CHANNELS );
38
- if (!reg_info .chan_info ) {
39
- printf ("Failed to allocate memory for regulatory info\n" );
40
- ret = - ENOMEM ;
41
- goto cleanup ;
42
- }
43
-
44
37
/* Initialize the Wi-Fi module */
45
38
CHECK_RET (nrf70_bm_rt_init (& reg_info ));
46
39
printf ("Initialized WiFi module, ready for radio test\n" );
@@ -52,10 +45,6 @@ int main(void)
52
45
}
53
46
54
47
cleanup :
55
- if (reg_info .chan_info ) {
56
- free (reg_info .chan_info );
57
- }
58
-
59
48
if (ret ) {
60
49
nrf70_bm_rt_deinit ();
61
50
printf ("Exiting WiFi radio test sample application with error: %d\n" , ret );
Original file line number Diff line number Diff line change @@ -226,13 +226,6 @@ int main(void)
226
226
int ret = -1 ;
227
227
int i ;
228
228
229
- reg_info .chan_info = malloc (sizeof (struct nrf70_bm_reg_chan_info ) * NRF70_MAX_CHANNELS );
230
- if (!reg_info .chan_info ) {
231
- printf ("Failed to allocate memory for regulatory info\n" );
232
- ret = - ENOMEM ;
233
- goto cleanup ;
234
- }
235
-
236
229
for (i = 0 ; i < 2 ; i ++ ) {
237
230
/*
238
231
* Radio test operation
@@ -318,11 +311,6 @@ int main(void)
318
311
319
312
ret = 0 ;
320
313
cleanup :
321
- if (reg_info .chan_info ) {
322
- free (reg_info .chan_info );
323
- reg_info .chan_info = NULL ;
324
- }
325
-
326
314
if (sys_init ) {
327
315
nrf70_bm_sys_deinit ();
328
316
sys_init = false;
You can’t perform that action at this time.
0 commit comments