Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'show the raw data' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
show the raw data
Authored by: gcole on Mar 13, '03 08:41:19PM
Try this, and post the results; it may indicate where the issue lies.

/usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p

(That's "w zero pipe" after the first "battery", where pipe is probably shift-\.) The sed portion shows everything between "battery" and the next line that ends in "}", which is the end of the battery block.

[ Reply to This | # ]

-> the raw data
Authored by: robx on Mar 14, '03 05:41:40AM
1:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
      | | +-o battery@3  
      | | |   {
      | | |     "reg" = 
      | | |     "AAPL,phandle" = 
      | | |     "device_type" = 
      | | |     "name" = 
      | | |     "IOBatteryInfo" = (
{"Voltage"=12657,"Flags"=133,
"Amperage"=1055,"Capacity"=4425,"Current"=0},
{"Voltage"=0,"Flags"=1,
"Amperage"=0,"Capacity"=0,"Current"=0})
      | | |   }

2:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
      | | +-o battery@3  
      | | |   {
      | | |     "reg" = 
      | | |     "AAPL,phandle" = 
      | | |     "device_type" = 
      | | |     "name" = 
      | | |     "IOBatteryInfo" = (
{"Voltage"=11154,"Flags"=133,
"Amperage"=1055,"Capacity"=2642,"Current"=0},
{"Voltage"=0,"Flags"=1,
"Amperage"=0,"Capacity"=0,"Current"=0})
      | | |   }
BOTH:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
      | | +-o battery@3  
      | | |   {
      | | |     "reg" = 
      | | |     "AAPL,phandle" = 
      | | |     "device_type" = 
      | | |     "name" = 
      | | |     "IOBatteryInfo" = (
{"Voltage"=11154,"Flags"=133,
"Amperage"=1200,"Capacity"=2642,"Current"=0},
{"Voltage"=12520,"Flags"=133,
"Amperage"=1200,"Capacity"=4425,"Current"=0})
      | | |   }
     

[ Reply to This | # ]