summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-30 16:25:09 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-30 16:25:09 -0400
commita9051a94473b63da8f6adb50ed08c6817145f159 (patch)
treeeaf5ad50b8bc7101bca859c681177494e39df431
parent957432309fe1eeae85fb5aced142183be2b86242 (diff)
network info menu
-rw-r--r--menus.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/menus.c b/menus.c
index f1759cf..bb04da0 100644
--- a/menus.c
+++ b/menus.c
@@ -7,6 +7,7 @@
#include "dummy_functions.h"
#include "version.h"
#include "flash.h"
+#include "nicutils.h"
#include <glib.h>
@@ -3413,33 +3414,20 @@ static int Submenu_Implement_Changes(void)
static void Nonstd_menu_network(void)
{
- char ip_buf[LCD_cols+1];
- char mac_buf[6];
- char response[LCD_cols+1];
- int i;
- char model[32];
- char serial_num[16];
-
- LCD_clear();
- /* FIXME - network info
- if (globals.Flash.network_enabled==0) {
- LCD_write(0,0,"This instrument does not have the");
- LCD_write(1,0,"TCP/IP telnet access networking option");
- LCD_write(2,0,"installed.");
- } else {
- pd_getaddress(0,mac_buf);
-
- sprintf(response,"MAC address: %02x:%02x:%02x:%02x:%02x:%02x",
- mac_buf[0], mac_buf[1], mac_buf[2], mac_buf[3], mac_buf[4], mac_buf[5]);
- LCD_write(0,0,response);
-
- sprintf(response,"IP address: %s",inet_ntoa(ip_buf,gethostid()));
- LCD_write(1,0,response);
- }
-
- LCD_write(3,0,response);
- */
- LCD_write(3,0,"Press CHANGE to continue.");
+ nicinfo info;
+ if (nicutils_infofordefaultroute(&info)) {
+ gchar *response = g_strdup_printf ("MAC address: %s", info.mac);
+ LCD_write(0,0,response);
+ g_free (response);
+
+ response = g_strdup_printf ("IP address: %s", info.ip);
+ LCD_write(1,0,response);
+ g_free (response);
+
+ LCD_write(3,0,"Press CHANGE to continue.");
+ } else {
+ LCD_display_extended_message("No network found.", TRUE, FALSE);
+ }
globals.MenuStatus.Nonstd_Display=YES;
}