Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/temperature


Modified Files:
        e_mod_main.c 


Log Message:


TODO items. bugs. start module - its a START. it doesnt work that well. needs
work in the menu code to handle fixing menus to a launch rect.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- e_mod_main.c        23 Apr 2005 05:16:25 -0000      1.26
+++ e_mod_main.c        18 May 2005 05:06:05 -0000      1.27
@@ -793,6 +793,40 @@
               ret = 1;
             fclose(f);
          }
+       else
+         {
+            therms = ecore_file_ls("/sys/bus/i2c/devices");
+            if ((therms) && (!ecore_list_is_empty(therms)))
+              {
+                 char *name;
+                 
+                 while ((name = ecore_list_next(therms)))
+                   {
+                      char fname[1024];
+                      
+                      sprintf(fname, "/sys/bus/i2c/devices/%s/temp1_input",
+                              name);
+                      if (ecore_file_exists(fname))
+                        {
+                           FILE *f;
+                           
+                           f = fopen(fname,"r");
+                           if (f) 
+                             {
+                                fgets(buf, sizeof(buf), f);
+                                buf[sizeof(buf) - 1] = 0;
+                                
+                                /* actuallty read the temp */
+                                if (sscanf(buf, "%i", &temp) == 1)
+                                  ret = 1;
+                                /* Hack for temp */
+                                temp = temp / 1000;
+                                fclose(f);
+                             }
+                        }
+                   }
+              }
+         }
      }
    else
      {




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to