Hi,
I take care that all application I maintain work on FreeBSD. The battery monitor for gnustep is really a pain to maintain, due to the myriad of power management systems and different BIOS's!
Anyway, the problem: the battery state. For FreeBSD I have this code:
On my laptop however I get sometimes nothing and the state is unknown. I don't see any other states defined in acpiio.h
apiconf -i0 tells me:
May I suppose that a firth state is implicit, that is if no flags are set the state is of neither charge nor discharge and thus "high"? I like explicit states, it is clearer 
Riccardo
I take care that all application I maintain work on FreeBSD. The battery monitor for gnustep is really a pain to maintain, due to the myriad of power management systems and different BIOS's!
Anyway, the problem: the battery state. For FreeBSD I have this code:
Code:
if( battio.bst.state & ACPI_BATT_STAT_CRITICAL )
batteryType = @"CRITICAL "; // could be complementary!
if( battio.bst.state & ACPI_BATT_STAT_CHARGING )
status = @"Charging";
else if( battio.bst.state & ACPI_BATT_STAT_DISCHARG )
status = @"Discharging";
else if (battio.bst.state & ACPI_BATT_STAT_INVALID )
status = @"Invalid";
else
NSLog(@"unknown state: %u", battio.bst.state);
On my laptop however I get sometimes nothing and the state is unknown. I don't see any other states defined in acpiio.h
apiconf -i0 tells me:
Code:
State: high
Remaining capacity: 100%
Remaining time: unknown

Riccardo