aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-06-01 01:32:48 +0700
committerHarald Welte <laforge@gnumonks.org>2019-05-31 20:41:57 +0000
commit2f01fbd040bc9ad4e4f9a5073ad27cb329c249da (patch)
tree66d6e5ebc25b595e624332a7aa9519c746da54bb /library
parent32658b31c958caaaae806d05e4c57d5fe6d733c8 (diff)
ts_TRXC_FAKE_RSSI(): define RSSI range, allow signed values
Diffstat (limited to 'library')
-rw-r--r--library/TRXC_Types.ttcn6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/TRXC_Types.ttcn b/library/TRXC_Types.ttcn
index 37b86100..a87266e7 100644
--- a/library/TRXC_Types.ttcn
+++ b/library/TRXC_Types.ttcn
@@ -68,7 +68,11 @@ external function enc_TrxcMessage(in TrxcMessage id) return charstring
external function dec_TrxcMessage(in charstring id) return TrxcMessage
with { extension "prototype(convert) decode(TEXT)" };
-template (value) TrxcMessage ts_TRXC_FAKE_RSSI(uint8_t rssi, int16_t thresh := 0) := {
+/* rxlev2dbm(0..63) gives us [-110..-47], plus -10 dbm for noise */
+type integer TRXC_RSSI (-120..-47);
+type integer TRXC_RSSI_THRESH (-120..120);
+
+template (value) TrxcMessage ts_TRXC_FAKE_RSSI(TRXC_RSSI rssi, TRXC_RSSI_THRESH thresh := 0) := {
cmd := {
verb := "FAKE_RSSI",
params := { int2str(rssi), int2str(thresh) }