@@ -31,7 +31,7 @@ struct SubBruteWorker {
31
31
#define SUBBRUTE_TXRX_WORKER_BUF_SIZE 2048
32
32
#define SUBBRUTE_TXRX_WORKER_MAX_TXRX_SIZE 60
33
33
#define SUBBRUTE_TXRX_WORKER_TIMEOUT_READ_WRITE_BUF 40
34
- #define SUBBRUTE_TX_TIMEOUT 1
34
+ #define SUBBRUTE_TX_TIMEOUT 50
35
35
#define SUBBRUTE_SEND_DELAY 260
36
36
37
37
/**
@@ -52,7 +52,7 @@ int32_t subbrute_worker_thread(void* context) {
52
52
FURI_LOG_I (TAG , "Worker start" );
53
53
#endif
54
54
55
- // instance->environment = subghz_environment_alloc();
55
+ instance -> environment = subghz_environment_alloc ();
56
56
instance -> transmitter = subghz_transmitter_alloc_init (
57
57
instance -> environment , string_get_cstr (instance -> protocol_name ));
58
58
@@ -64,7 +64,7 @@ int32_t subbrute_worker_thread(void* context) {
64
64
furi_hal_gpio_write (& gpio_cc1101_g0 , true);
65
65
66
66
// Set ready to transmit value
67
- // instance->last_time_tx_data = furi_get_tick() - SUBBRUTE_SEND_DELAY;
67
+ instance -> last_time_tx_data = furi_get_tick () - SUBBRUTE_SEND_DELAY ;
68
68
69
69
while (instance -> worker_running ) {
70
70
// Transmit
@@ -80,8 +80,8 @@ int32_t subbrute_worker_thread(void* context) {
80
80
81
81
subghz_transmitter_free (instance -> transmitter );
82
82
instance -> transmitter = NULL ;
83
- /* subghz_environment_free(instance->environment);
84
- instance->environment = NULL;*/
83
+ subghz_environment_free (instance -> environment );
84
+ instance -> environment = NULL ;
85
85
86
86
#ifdef FURI_DEBUG
87
87
FURI_LOG_I (TAG , "Worker stop" );
@@ -117,10 +117,10 @@ void subbrute_worker_free(SubBruteWorker* instance) {
117
117
instance -> transmitter = NULL ;
118
118
}
119
119
120
- /* if(instance->environment != NULL) {
120
+ if (instance -> environment != NULL ) {
121
121
subghz_environment_free (instance -> environment );
122
122
instance -> environment = NULL ;
123
- }*/
123
+ }
124
124
125
125
furi_thread_free (instance -> thread );
126
126
flipper_format_free (instance -> flipper_format );
@@ -190,10 +190,9 @@ bool subbrute_worker_is_running(SubBruteWorker* instance) {
190
190
}
191
191
192
192
bool subbrute_worker_can_transmit (SubBruteWorker * instance ) {
193
- UNUSED (instance );
194
- return true;
195
- //furi_assert(instance);
196
- //return (furi_get_tick() - instance->last_time_tx_data) > SUBBRUTE_SEND_DELAY;
193
+ furi_assert (instance );
194
+
195
+ return (furi_get_tick () - instance -> last_time_tx_data ) > SUBBRUTE_SEND_DELAY ;
197
196
}
198
197
199
198
bool subbrute_worker_transmit (SubBruteWorker * instance , const char * payload ) {
@@ -277,7 +276,7 @@ bool subbrute_worker_init_manual_transmit(
277
276
FURI_LOG_I (TAG , "Frequency: %d" , frequency );
278
277
#endif
279
278
280
- // instance->environment = subghz_environment_alloc();
279
+ instance -> environment = subghz_environment_alloc ();
281
280
instance -> transmitter = subghz_transmitter_alloc_init (
282
281
instance -> environment , string_get_cstr (instance -> protocol_name ));
283
282
@@ -311,8 +310,8 @@ void subbrute_worker_manual_transmit_stop(SubBruteWorker* instance) {
311
310
subghz_transmitter_free (instance -> transmitter );
312
311
instance -> transmitter = NULL ;
313
312
}
314
- /* subghz_environment_free(instance->environment);
315
- instance->environment = NULL;*/
313
+ subghz_environment_free (instance -> environment );
314
+ instance -> environment = NULL ;
316
315
317
316
instance -> is_manual_init = false;
318
317
}
0 commit comments