library/Osmocom_VTY_Functions: make VTY prompt timeout configurable

Change-Id: Iadec95446b98d9767d08a841fa1c28f8c71c5eea
This commit is contained in:
Vadim Yanitskiy 2021-01-30 14:14:15 +01:00
parent 26e30aa4e0
commit bc1e66a3f1
1 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ module Osmocom_VTY_Functions {
modulepar {
charstring mp_prompt_prefix := "OpenBSC";
float mp_prompt_timeout := 2.0;
}
const charstring VTY_VIEW_SUFFIX := "> ";
@ -60,9 +61,9 @@ module Osmocom_VTY_Functions {
return charstring {
var charstring rx, buf := "";
var integer fd;
timer T := 2.0;
timer T;
T.start;
T.start(mp_prompt_timeout);
alt {
[] pt.receive(pattern "[\w-]+" & VTY_VIEW_SUFFIX) { };
[] pt.receive(pattern "[\w-]+\# ") { };