From ab9aba1a8464a24ac7e710bc0f6b9f0770a1e9bc Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 6 Jul 2016 16:11:24 +0200 Subject: B-Netz: Reply the station ID correctly It must be replied right after it has been received the first time. It does not matter if this happens a bit later, even a second later. Thanx to Hans Wigger for providing recording from his B-Netz tester to figure this out. --- src/bnetz/bnetz.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/bnetz') diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c index 16f4ac8..6c75997 100644 --- a/src/bnetz/bnetz.c +++ b/src/bnetz/bnetz.c @@ -560,15 +560,16 @@ void bnetz_receive_telegramm(bnetz_t *bnetz, uint16_t telegramm, double level, d bnetz->dial_mode = DIAL_MODE_NUMBER; memset(bnetz->dial_number, 0, sizeof(bnetz->dial_number)); bnetz->dial_pos = 0; + /* reply station ID */ + PDEBUG(DBNETZ, DEBUG_INFO, "Sending station id back to phone: %s.\n", bnetz->station_id); + bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM); + bnetz->station_id_pos = 0; } break; case DIAL_MODE_NUMBER: if (digit == 'e') { PDEBUG(DBNETZ, DEBUG_INFO, "Received number from mobile phone: %s\n", bnetz->dial_number); bnetz->dial_mode = DIAL_MODE_START2; - PDEBUG(DBNETZ, DEBUG_INFO, "Sending station id back to phone: %s.\n", bnetz->station_id); - bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM); - bnetz->station_id_pos = 0; break; } if (digit < '0' || digit > '9') { -- cgit v1.2.3