// =============================================================================
// device status information getter functions
// =============================================================================
-static int get_wifi_status()
+static int get_wifi_status()
{
int wifi_status = 0;
return gps_status;
}
-static int get_brightness_status()
+static int get_brightness_status()
{
static int brightnessfd = -1;
int brightness_status = 0;
return brightness_status;
}
-static int get_max_brightness()
+static int get_max_brightness()
{
int maxbrightnessfd = -1;
static int max_brightness = -1;
}
// this means silent mode?
-static int get_sound_status()
+static int get_sound_status()
{
int sound_status = 0;
if(fp == NULL)
return -1;
- while(ret != EOF)
+ while(ret != EOF)
{
ret = fscanf(fp, "%[^:] %*c %[^\n] ", dev, state);
if(strncmp(dev,"SPKR",4) == 0 && strncmp(state, "On",2) == 0)
{
audio_state = 1;
- }
+ }
else if(ret == 2 && strncmp(dev,"Head",4) == 0 && strncmp(state, "On",2) == 0)
{
audio_state = 2;
return audio_state;
}
-static int get_vibration_status()
+static int get_vibration_status()
{
int vibration_status = 0;
return -1;
buf[num] = '\0';
-
+
// scan from buffer
// copy command name
abuf = strchr(buf, '(') + 1;
&P->start_time,
&P->vir_mem,
&P->res_memblock
- );
+ );
if(P->numofthread == 0)
P->numofthread = 1;
}
}
}
- else // we know about probe.so size already
+ else // we know about probe.so size already
{
while(fgets(buf, MIDDLE_BUFFER, fp) != NULL)
{
// return 0 for error case
// return system total memory in MB
-//static
+//static
unsigned long get_system_total_memory()
{
int meminfo_fd = -1;
break;
head = tail + 1;
}
-
+
return (totalmem * 1024);
}
{
int total = 0;
int free = 0;
- int storage = stat_get_storageinfo(FSINFO_TYPE_FREE);
+ int storage = stat_get_storageinfo(FSINFO_TYPE_FREE);
int card = stat_get_cardinfo(FSINFO_TYPE_FREE);
if (storage < 0 && card < 0)
while((entry = readdir(taskdir)) != NULL)
{
if(*entry->d_name > '0' && *entry->d_name <= '9')
- {
+ {
tid = atoi(entry->d_name);
sprintf(buf, "/proc/%d/task/%d", pid, tid);
// this code is not necessary anymore
/*
-static void get_app_info(const char* binary_path, char* width,
- char* height, char* theme, char* version,
- char* scale, char* removable,
+static void get_app_info(const char* binary_path, char* width,
+ char* height, char* theme, char* version,
+ char* scale, char* removable,
char* comment)
{
int fd = 0;
if (res == 0)
{
break;
- }
- if (res < 0)
+ }
+ if (res < 0)
{
if (errno == EINTR)
continue;
}
LOGI("read buffer ===%s===\n", buffer);
- for (i = 0; i < res; i++)
+ for (i = 0; i < res; i++)
{
if (i < res - 22 && strncmp(&buffer[i], "X-SLP-BaseLayoutWidth=", 22) == 0)
{
fill_data_msg_head(msg, NMSG_SYSTEM, 0, len);
p = msg->payload;
-
+
pack_int(p, sys_info->energy);
pack_int(p, sys_info->wifi_status);
pack_int(p, sys_info->bt_status);