Make communication timeout configurable
This commit is contained in:
4 files changed
+57
-2
No files matched your search
@@ -74,8 +74,12 @@ bool uart_set_speed(serial_port sp, const uint32_t uiPortSpeed);
|
||||
*/
|
||||
uint32_t uart_get_speed(const serial_port sp);
|
||||
|
||||
/* Reconfigure timeouts
|
||||
/* Reconfigure timeouts (ms)
|
||||
*/
|
||||
int uart_reconfigure_timeouts(uint32_t value);
|
||||
#endif // _UART_H_
|
||||
|
||||
/* Get timeouts (ms)
|
||||
*/
|
||||
uint32_t uart_get_timeouts(void);
|
||||
|
||||
#endif // _UART_H_
|
||||
@@ -69,6 +69,10 @@ int uart_reconfigure_timeouts(uint32_t value) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t uart_get_timeouts(void) {
|
||||
return newtimeout_value;
|
||||
}
|
||||
|
||||
serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||
serial_port_unix_t_t *sp = calloc(sizeof(serial_port_unix_t_t), sizeof(uint8_t));
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ int uart_reconfigure_timeouts(uint32_t value) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t uart_get_timeouts(void) {
|
||||
return newtimeout_value;
|
||||
}
|
||||
|
||||
static int uart_reconfigure_timeouts_polling(serial_port sp) {
|
||||
if (newtimeout_pending == false)
|
||||
return PM3_SUCCESS;
|
||||
|
||||
Reference in new issue
Block a user