Add info key 'i' to show some states.

Currently showing C-Netz attached subscribers
This commit is contained in:
Andreas Eversberg
2016-08-02 09:03:46 +02:00
parent c9012c7663
commit 038ce9d1b7
10 changed files with 32 additions and 1 deletions

View File

@@ -155,3 +155,19 @@ void flush_db(void)
remove_db(cnetz_db_head);
}
void dump_db(void)
{
cnetz_db_t *db = cnetz_db_head;
PDEBUG(DDB, DEBUG_NOTICE, "Dump of subscriber database:\n");
if (!db) {
PDEBUG(DDB, DEBUG_NOTICE, " - No subscribers attached!\n");
return;
}
while (db) {
PDEBUG(DDB, DEBUG_NOTICE, " - Subscriber '%d,%d,%d' is attached.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
db = db->next;
}
}

View File

@@ -2,4 +2,5 @@
void update_db(cnetz_t *cnetz, uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest, int busy, int failed);
int find_db(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest);
void flush_db(void);
void dump_db(void);

View File

@@ -81,6 +81,7 @@ void print_help(const char *arg0)
printf(" we just accept any card. With this we get the vendor IDs of the phone.\n");
printf("\nstation-id: Give 7 digit station-id, you don't need to enter it for every\n");
printf(" start of this program.\n");
printf("\nPress 'i' key for dumping currently attached subscribers.\n");
}
static int handle_options(int argc, char **argv)