modules/batt_health/sys.c
static int sys_bms_param_read(bhd_state_t *battery_state)
{
	int i;
	int value;
	char *bhd_state = (char *) battery_state;
	int array_size = sizeof(bms_param_table)/sizeof(bms_param_table[0]);

	for (i = 0; i < array_size; i++)
	{
		/* TODO: There anything better to do if getting value failed? */
		value = BHD_SYS_sys_param_int_get(bms_param_table[i].path, BHD_INVALID_VALUE);
		*((int*)(bhd_state + bms_param_table[i].offset)) = value;
	}

	return 0;
}
/* Read all of the BMS sysfs entries */
Read all of the BMS sysfs entries
Read all of the BMS sysfs entries
static int sys_bms_param_read(bhd_state_t *battery_state)
{
	int i;
	int value;
	char *bhd_state = (char *) battery_state;
	int array_size = sizeof(bms_param_table)/sizeof(bms_param_table[0]);
	for (i = 0; i < array_size; i++)
	{
		value = BHD_SYS_sys_param_int_get(bms_param_table[i].path, BHD_INVALID_VALUE);
		*((int*)(bhd_state + bms_param_table[i].offset)) = value;
	}
	return 0;
}
static int sys_bms_param_read ( bhd_state_t * battery_state ) { int i ; int value ; char * bhd_state = ( char * ) battery_state ; int array_size = sizeof ( bms_param_table ) / sizeof ( bms_param_table [ 0 ] ) ; for ( i = 0 ; i < array_size ; i ++ ) { value = BHD_SYS_sys_param_int_get ( bms_param_table [ i ] . path , BHD_INVALID_VALUE ) ; * ( ( int * ) ( bhd_state + bms_param_table [ i ] . offset ) ) = value ; } return 0 ; }
Read all of the BMS sysfs entries
Read all of the BMS sysfs entries
/* TODO: There anything better to do if getting value failed? */