Exemplo n.º 1
0
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	// char *ker_ver = "HUAWEI_KERNEL_VERSION";
	char *ker_ver = HUAWEI_KERNEL_VERSION;
	char *lcd_name = NULL;
	char * touch_info = NULL;
	char *wifi_device_name = NULL;
	char audio_property[AUDIO_PROPERTY_LEN] = {0};
	/*print sensor info into app_info*/
	/*< DTS2012032003522 zengxiangguang 20120320 begin */
	/* Array **_**_id must be large enough to hold both id and sub id */
	/* 'cause the following code would call strcat function to connect */
	/* sub id to array **_**_id[] */
	char s_board_id[BOARD_ID_LEN + BOARD_ID_SUB_VER_LEN] = {0};
    char sub_ver[BOARD_ID_SUB_VER_LEN] = {0};
	char hw_version_id[HW_VERSION + HW_VERSION_SUB_VER] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	/* DTS2012032003522 zengxiangguang 20120320 end >*/
	char *compass_gs_name = NULL;
	char *sensors_list_name = NULL;
    set_s_board_hw_version(s_board_id,hw_version_id);
    sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
   sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
    strcat(s_board_id, sub_ver);
    strcat(hw_version_id, hw_version_sub_ver);
    set_s_board_hw_version_special(hw_version_id,hw_version_sub_ver,s_board_id,sub_ver);
	compass_gs_name=get_compass_gs_position_name();
	sensors_list_name = get_sensors_list_name();
	lcd_name = get_lcd_panel_name();
	wifi_device_name = get_wifi_device_name();
	get_audio_property(audio_property);
	touch_info = get_touch_info();
	if (touch_info == NULL)
	{
		touch_info = "Unknow touch";
	}
	
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
    charge_flag = get_charge_flag();
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
    "wifi_chip:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name,sensors_list_name, hw_version_id,wifi_device_name,audio_property, touch_info);
#else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name,sensors_list_name, hw_version_id,audio_property, touch_info);
#endif
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}
Exemplo n.º 2
0
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	// char *ker_ver = "HUAWEI_KERNEL_VERSION";
	char *ker_ver = HUAWEI_KERNEL_VERSION;
	char *lcd_name = NULL;
	char * touch_info = NULL;
	char *wifi_device_name = NULL;
    char *bt_device_name = NULL;
	char audio_property[AUDIO_PROPERTY_LEN] = {0};
	char s_board_id[BOARD_ID_LEN + BOARD_ID_SUB_VER_LEN] = {0};
    char sub_ver[BOARD_ID_SUB_VER_LEN] = {0};
	char hw_version_id[HW_VERSION + HW_VERSION_SUB_VER] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	char *compass_gs_name = NULL;
	char *sensors_list_name = NULL;
    set_s_board_hw_version(s_board_id,hw_version_id);
    sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
   sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
    strcat(s_board_id, sub_ver);
    strcat(hw_version_id, hw_version_sub_ver);
    set_s_board_hw_version_special(hw_version_id,hw_version_sub_ver,s_board_id,sub_ver);
	compass_gs_name=get_compass_gs_position_name();
	sensors_list_name = get_sensors_list_name();
	lcd_name = get_lcd_panel_name();
	wifi_device_name = get_wifi_device_name();
	bt_device_name = get_bt_device_name();
	get_audio_property(audio_property);
	touch_info = get_touch_info();
	if (touch_info == NULL)
	{
		touch_info = "Unknow touch";
	}
	
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
    charge_flag = get_charge_flag();
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
    "wifi_chip:\n%s\n"
    "bt_chip:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name,sensors_list_name, hw_version_id,wifi_device_name,bt_device_name,audio_property, touch_info);
#else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name,sensors_list_name, hw_version_id,audio_property, touch_info);
#endif
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}