Dynamo Middleware

libDynamoMiddlewareARM.h File Reference

ARM Middleware Libraries. More...


Data Structures

struct  dynamo_backlight
 Contains Backlight information. More...
struct  dynamo_battery
 Contains Battery information. More...
struct  dynamo_cpu
 Contains CPU Information. More...
struct  dynamo_memory
 Contains Memory Information. More...
struct  dynamo_network
 Contains Network Information. More...

Functions

int get_backlight_level ()
 Gets the backlight level.
int set_backlight_level (int lvl)
 Sets the backlight to level Allows the caller to set the backlight intensity.
int get_backlight_status ()
 Gets the backlights status [on|off].
int set_backlight_status (int status)
 Sets the backlight [on 1|off 0] Allows the caller to set the status of the backlight 1 for on 0 for off.
int get_battery_ac_status ()
 Checks if the Device is plugged in.
int get_battery_power_level ()
 Gets devices battery level.
int get_battery_min_remaining ()
 Gets the amount of power in minutes remaining.
char * get_cpu_model ()
 Gets the CPU model string.
float get_cpu_load ()
 returns the average load of the device
int get_cpu_total_process ()
 Gets the amount of total processes on the device.
int get_cpu_running_process ()
 Gets the current number of active processes on the device.
int get_mem_total ()
 Gets the total amount of memory.
int get_mem_free ()
 Gets the amount of free memory.
int get_mem_total_swap ()
 Gets the total amount of swap.
int get_mem_free_swap ()
 Gets the amount of free swap.
int get_net_is_connected ()
 Gets the current network connection status.
int get_net_is_wireless ()
 Gets the current wireless network connection status.
int get_net_link_quality ()
 Gets the link quality of the wireless network.
int get_net_sig_strength ()
 Gets the signal strength of the wireless network.
int get_backlight_info (struct dynamo_backlight *backlight)
 Collects the devices backlight information.
int get_battery_info (struct dynamo_battery *battery)
 Collects the devices battery information.
int get_cpu_info (struct dynamo_cpu *cpu)
 Collects the devices cpu information.
int get_memory_info (struct dynamo_memory *memory)
 Collects the devices memory information.
int get_network_info (struct dynamo_network *network)
 Collects the devices network information.
int createSharedMemory (int key, int size)
 creates a chunk of shared memory
int readSharedMemory (int shmid, void *data, int size)
 reads from the shared memory into a structuer
int writeSharedMemory (int shmid, void *data, int size)
 writes data to the shared memory
int freeSharedMemory (int shmid)
 releases the memory with id of shmid
int createSemaphore (int key)
 translate semaphore key to an ID
int freeSemaphore (int sem_id)
 free specified Semaphore
void P (int sid)
 acquire semaphore
void V (int sid)
 release semaphore
int SendDatagram (char *targetIP, int targetPort, int localPort, void *buf, int bufsiz)
 Sends a Datagram to a remote computer.
int CreateUDPSocket (char *localIP, int localPort)
 creates a UPD socket
int UDP_Recv (int sockfd, void *buf, int size)
 Recives a datagram a remote computer.
int UDP_Send (int sockfd, char *targetIP, int targetPort, int localPort, void *buf, int bufsiz)
 Sends a Datagram to a remote computer.


Detailed Description

ARM Middleware Libraries.

Dynamo Middleware libraries, provide a easy to use interface for querying system information, utilizing shared memory, and communication framework

Copyright (C) 2004 Dynamo Middleware Group

version 0.5

Authors: Michael Philpott, Shivajit Mohapatra


Function Documentation

int createSemaphore int  key  ) 
 

translate semaphore key to an ID

Parameters:
key the Key that the semaphore should be created with
Returns:
the ID to the shared memory

int createSharedMemory int  key,
int  size
 

creates a chunk of shared memory

Parameters:
key the Key to the shared memory
size the size that the shaed memory should be
Returns:
The ID to the shared memory

int CreateUDPSocket char *  localIP,
int  localPort
 

creates a UPD socket

Parameters:
*localIP character array of the local IP address
localPort a port number

int freeSemaphore int  sem_id  ) 
 

free specified Semaphore

Parameters:
sem_id the ID of the semaphore to free

int freeSharedMemory int  shmid  ) 
 

releases the memory with id of shmid

Parameters:
shmid the id of the shared memory that is being freed

int get_backlight_info struct dynamo_backlight backlight  ) 
 

Collects the devices backlight information.

See also:
get_backlight_level()

get_backlight_status()

int get_backlight_level  ) 
 

Gets the backlight level.

Returns:
the backlight level 0 - 255 or -1 if an error

int get_backlight_status  ) 
 

Gets the backlights status [on|off].

Returns:
0 (off) 1 (on) or -1 (error reading backlight)

int get_battery_ac_status  ) 
 

Checks if the Device is plugged in.

Returns:
0 or 1

int get_battery_info struct dynamo_battery battery  ) 
 

Collects the devices battery information.

See also:
get_battery_ac_status()

get_battery_power_level()

get_battery_min_remaining()

int get_battery_min_remaining  ) 
 

Gets the amount of power in minutes remaining.

Returns:
the amount of minutes that the system will have power for Note: need to implament to return -1 if its pluged in

int get_battery_power_level  ) 
 

Gets devices battery level.

Returns:
the systems power level in percentage 0(empty) - 100(full)

int get_cpu_info struct dynamo_cpu cpu  ) 
 

Collects the devices cpu information.

See also:
get_cpu_model()

get_cpu_load()

get_cpu_total_process()

get_cpu_running_process()

float get_cpu_load  ) 
 

returns the average load of the device

Returns:
the average load of the cpu over the past minute

char* get_cpu_model  ) 
 

Gets the CPU model string.

Returns:
a char* of the processors model information this will have to be freed by the caller

int get_cpu_running_process  ) 
 

Gets the current number of active processes on the device.

Returns:
the amount of active tasks on the device

int get_cpu_total_process  ) 
 

Gets the amount of total processes on the device.

Returns:
the amount of processes that have been started (active or passive)

int get_mem_free  ) 
 

Gets the amount of free memory.

Returns:
the amount of free memory available on your system

int get_mem_free_swap  ) 
 

Gets the amount of free swap.

Returns:
the free swap amount of the system

int get_mem_total  ) 
 

Gets the total amount of memory.

Returns:
the full amount of memory (ie your system has 512 megs of ram)

int get_mem_total_swap  ) 
 

Gets the total amount of swap.

Returns:
the total swap amount avaiable to your system

int get_memory_info struct dynamo_memory memory  ) 
 

Collects the devices memory information.

See also:
get_mem_total()

get_mem_free()

get_mem_total_swap()

get_mem_free_swap()

int get_net_is_connected  ) 
 

Gets the current network connection status.

Returns:
1 if the device is connected or 0 if no network is present

int get_net_is_wireless  ) 
 

Gets the current wireless network connection status.

Returns:
1 if the device has a wireless connection or 0 if no wireless connection
need to test when the card is in but not connected

int get_net_link_quality  ) 
 

Gets the link quality of the wireless network.

Returns:
the link quality of the wireless network or -1 if nothing is present

int get_net_sig_strength  ) 
 

Gets the signal strength of the wireless network.

Returns:
the signal quality of the wireless network or -1 nothing is present

int get_network_info struct dynamo_network network  ) 
 

Collects the devices network information.

See also:
get_net_is_connected()

get_net_is_wireless()

get_net_link_quality()

get_net_sig_strength()

void P int  sid  ) 
 

acquire semaphore

Parameters:
sid the ID of the semaphore to obtain

int readSharedMemory int  shmid,
void *  data,
int  size
 

reads from the shared memory into a structuer

Parameters:
shmid the ID of the shared memory
*data the structure that will be read
size the size of the item that will be read

int SendDatagram char *  targetIP,
int  targetPort,
int  localPort,
void *  buf,
int  bufsiz
 

Sends a Datagram to a remote computer.

Parameters:
*targetIP character array of target computers IP Address
localPort local port of the UPD socket
targetPort the remote hosts port
*buf the information to be sent
bufsiz the size of the item to be sent

int set_backlight_level int  lvl  ) 
 

Sets the backlight to level Allows the caller to set the backlight intensity.

Parameters:
lvl integer 0-255 with 255 being the highest level

int set_backlight_status int  status  ) 
 

Sets the backlight [on 1|off 0] Allows the caller to set the status of the backlight 1 for on 0 for off.

Parameters:
status 0 or 1

int UDP_Recv int  sockfd,
void *  buf,
int  size
 

Recives a datagram a remote computer.

Parameters:
sockfd pointer to the UDP socket
*buf address of the structure to fill
size size of the structure to fill

int UDP_Send int  sockfd,
char *  targetIP,
int  targetPort,
int  localPort,
void *  buf,
int  bufsiz
 

Sends a Datagram to a remote computer.

Parameters:
sockfd pointer to the upd socket
*targetIP character array of target computers IP Address
targetPort the remote hosts port
localPort local port of the UPD socket
*buf the information to be sent
bufsiz the size of the item to be sent

void V int  sid  ) 
 

release semaphore

Parameters:
sid the ID of the semaphore to release

int writeSharedMemory int  shmid,
void *  data,
int  size
 

writes data to the shared memory

Parameters:
shmid the ID of the shared memory to write to
*data the information to write inot the shared memory
size the size of the item that will be written