modules/batt_health/sys.c
bool BHD_SYS_bms_state_write(bhd_state_t *state)
{
	bool is_success = true;
	int i;
	int value;
	char *bhd_state = (char *) state;
	int array_size = sizeof(bms_param_table)/sizeof(bms_param_table[0]);

	for (i = 0; i < array_size; i++)
	{
		value = *((int*)(bhd_state + bms_param_table[i].offset));
		if (value == BHD_INVALID_VALUE)
			ALOGE("Skipping %s", bms_param_table[i].path);
		else {
			is_success = sys_param_int_set_retry(bms_param_table[i].path,
							value, 5, 250000);
			if (is_success == false)
				return is_success;
		}
	}


	is_success = sys_bms_aged_capacity_write(state, 5, 250000);
	if (is_success)
		is_success = sys_bms_aged_timestamp_write(state, 5, 250000);

	return is_success;
}
/* Update BMS sysfs entries with info from battery health daemon */
Update BMS sysfs entries with info from battery health daemon
Update BMS sysfs entries with info from battery health daemon
bool BHD_SYS_bms_state_write(bhd_state_t *state)
{
	bool is_success = true;
	int i;
	int value;
	char *bhd_state = (char *) state;
	int array_size = sizeof(bms_param_table)/sizeof(bms_param_table[0]);
	for (i = 0; i < array_size; i++)
	{
		value = *((int*)(bhd_state + bms_param_table[i].offset));
		if (value == BHD_INVALID_VALUE)
			ALOGE("Skipping %s", bms_param_table[i].path);
		else {
			is_success = sys_param_int_set_retry(bms_param_table[i].path,
							value, 5, 250000);
			if (is_success == false)
				return is_success;
		}
	}
	is_success = sys_bms_aged_capacity_write(state, 5, 250000);
	if (is_success)
		is_success = sys_bms_aged_timestamp_write(state, 5, 250000);
	return is_success;
}
bool BHD_SYS_bms_state_write ( bhd_state_t * state ) { bool is_success = true ; int i ; int value ; char * bhd_state = ( char * ) state ; int array_size = sizeof ( bms_param_table ) / sizeof ( bms_param_table [ 0 ] ) ; for ( i = 0 ; i < array_size ; i ++ ) { value = * ( ( int * ) ( bhd_state + bms_param_table [ i ] . offset ) ) ; if ( value == BHD_INVALID_VALUE ) ALOGE ( " " , bms_param_table [ i ] . path ) ; else { is_success = sys_param_int_set_retry ( bms_param_table [ i ] . path , value , 5 , 250000 ) ; if ( is_success == false ) return is_success ; } } is_success = sys_bms_aged_capacity_write ( state , 5 , 250000 ) ; if ( is_success ) is_success = sys_bms_aged_timestamp_write ( state , 5 , 250000 ) ; return is_success ; }
Update BMS sysfs entries with info from battery health daemon
Update BMS sysfs entries with info from battery health daemon