aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gprs/gprs_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gprs/gprs_test.c')
-rw-r--r--tests/gprs/gprs_test.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c
index 99e3ea519..f239b7032 100644
--- a/tests/gprs/gprs_test.c
+++ b/tests/gprs/gprs_test.c
@@ -24,7 +24,7 @@ static int nu_is_retransmission(uint16_t nu, uint16_t vur)
return ret;
}
-static void test_8_4_2()
+static void test_8_4_2(void)
{
printf("Testing gprs_llc_is_retransmit.\n");
@@ -48,6 +48,22 @@ static void test_8_4_2()
ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped
}
+/* GSM 04.08, 10.5.7.3 GPRS Timer */
+static int gprs_tmr_to_secs(uint8_t tmr)
+{
+ switch (tmr & GPRS_TMR_UNIT_MASK) {
+ case GPRS_TMR_2SECONDS:
+ return 2 * (tmr & GPRS_TMR_FACT_MASK);
+ default:
+ case GPRS_TMR_MINUTE:
+ return 60 * (tmr & GPRS_TMR_FACT_MASK);
+ case GPRS_TMR_6MINUTE:
+ return 360 * (tmr & GPRS_TMR_FACT_MASK);
+ case GPRS_TMR_DEACTIVATED:
+ return -1;
+ }
+}
+
static void test_gprs_timer_enc_dec(void)
{
int i, u, secs, tmr;