core/device.h File Reference

#include <glib.h>
#include "configuration.h"
#include "interface.h"

Include dependency graph for device.h:


Typedefs

typedef _BotDevice BotDevice
typedef _BotDriver BotDriver

Functions

BotDevicebot_device_new (BotDriver *driver, const gchar *name, const gchar *description, BotDeviceConfiguration *configuration)
void bot_device_free (BotDevice *device)
gpointer bot_device_get_interface (BotDevice *device, BotInterface *type)
gchar * bot_device_get_name (BotDevice *device)
gchar * bot_device_get_description (BotDevice *device)
gpointer bot_device_get_data (BotDevice *device)

Detailed Description

Overview of devices

A device encapsulates...


Typedef Documentation

typedef struct _BotDevice BotDevice

typedef struct _BotDriver BotDriver


Function Documentation

void bot_device_free ( BotDevice device  ) 

Free a device

TODO: Document failure conditions

Examples:
creating_devices_programmatically.c.

gpointer bot_device_get_data ( BotDevice device  ) 

Get the device-specific data associated with a device

Parameters:
device The device in question
Returns:
The data associated with it
Examples:
maximal_driver.c.

gchar* bot_device_get_description ( BotDevice device  ) 

Get the description of a device

Parameters:
device The device in question
Returns:
The description of the device

gpointer bot_device_get_interface ( BotDevice device,
BotInterface type 
)

Get an interface from a device or NULL if not supported

Parameters:
device The device in question
type The interface to retrieve
Returns:
The requested interface, or NULL if unavailable
Examples:
basic.c, and creating_devices_programmatically.c.

gchar* bot_device_get_name ( BotDevice device  ) 

Get the name of a device

Parameters:
device The device in question
Returns:
The name of the device

BotDevice* bot_device_new ( BotDriver driver,
const gchar *  name,
const gchar *  description,
BotDeviceConfiguration configuration 
)

Create a new device using a specific driver

If configuration is invalid or we're out of memory, return NULL TODO: Add error reporting i.e. explain failure

Parameters:
driver The driver for this device
name The name for this device
description A description of this device, may be NULL
configuration The configuration for this device, may be NULL
Returns:
The newly created device, or NULL on failure
Examples:
creating_devices_programmatically.c.


(c) 2006 Edinburgh Robotics Ltd.
Generated on Fri Feb 2 11:24:05 2007 for libbot by doxygen 1.5.1