Author: remi
Date: 2008-12-02 10:54:58 +0100 (Tue, 02 Dec 2008)
New Revision: 2977
Modified:
software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.c
software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.h
software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.c
software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.h
Log:
* added comments and doxygen.
Modified: software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.c
===================================================================
--- software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.c
2008-12-02 09:29:22 UTC (rev 2976)
+++ software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.c
2008-12-02 09:54:58 UTC (rev 2977)
@@ -18,6 +18,13 @@
* 02111-1307, USA.
*/
+/**
+ * \file tux_hid_unix.c
+ * \brief Tux HID functions.
+ * \author [EMAIL PROTECTED]
+ * \ingroup hid_interface
+ */
+
#ifndef WIN32
#include <stdlib.h>
@@ -41,6 +48,13 @@
static struct hiddev_usage_ref uref_out;
static struct hiddev_report_info rinfo_out;
+/**
+ * \brief Search the HID dongle in a "dev" path.
+ * \param path Path how to search.
+ * \param vendor_id Dongle vendor ID.
+ * \param product_id Dongle product ID.
+ * \return true or false
+ */
static bool
find_dongle_from_path(const char *path, int vendor_id, int product_id)
{
@@ -87,6 +101,10 @@
return false;
}
+/**
+ * \brief Check if the dongle is still plugged.
+ * \return true or false.
+ */
static bool
check_device_still_plugged(void)
{
@@ -111,6 +129,12 @@
}
}
+/**
+ * \brief Capture the HID dongle.
+ * \param vendor_id Dongle vendor ID.
+ * \param product_id Dongle product ID.
+ * \return true or false.
+ */
bool LIBLOCAL
tux_hid_capture(int vendor_id, int product_id)
{
@@ -130,6 +154,9 @@
return false;
}
+/**
+ * \brief Release the access to the HID dongle.
+ */
void LIBLOCAL
tux_hid_release(void)
{
@@ -140,6 +167,12 @@
}
}
+/**
+ * \brief Write data to the HID dongle.
+ * \param size Data size.
+ * \param buffer Data to write.
+ * \return The write success.
+ */
bool LIBLOCAL
tux_hid_write(int size, const char *buffer)
{
@@ -183,6 +216,12 @@
return true;
}
+/**
+ * \brief Read data from the HID dongle.
+ * \param size Data size.
+ * \param buffer Data buffer.
+ * \return The read success.
+ */
bool LIBLOCAL
tux_hid_read(int size, char *buffer)
{
Modified: software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.h
===================================================================
--- software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.h
2008-12-02 09:29:22 UTC (rev 2976)
+++ software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_unix.h
2008-12-02 09:54:58 UTC (rev 2977)
@@ -18,6 +18,13 @@
* 02111-1307, USA.
*/
+/**
+ * \file tux_hid_unix.h
+ * \brief Tux HID header.
+ * \author [EMAIL PROTECTED]
+ * \ingroup hid_interface
+ */
+
#ifndef WIN32
#ifndef _TUX_HID_H_
@@ -25,6 +32,7 @@
#include <stdbool.h>
+/** \brief HID USB timout */
#define HID_RW_TIMEOUT 1000
extern bool tux_hid_capture(int vendor_id, int product_id);
Modified: software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.c
===================================================================
--- software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.c
2008-12-02 09:29:22 UTC (rev 2976)
+++ software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.c
2008-12-02 09:54:58 UTC (rev 2977)
@@ -18,6 +18,13 @@
* 02111-1307, USA.
*/
+/**
+ * \file tux_hid_win32.c
+ * \brief Tux HID functions.
+ * \author [EMAIL PROTECTED]
+ * \ingroup hid_interface
+ */
+
#ifdef WIN32
#include <windows.h>
@@ -34,6 +41,12 @@
static HANDLE tux_device_hdl = NULL;
static COMMTIMEOUTS timeout;
+/**
+ * \brief Capture the HID dongle.
+ * \param vendor_id Dongle vendor ID.
+ * \param product_id Dongle product ID.
+ * \return true or false.
+ */
bool LIBLOCAL
tux_hid_capture(int vendor_id, int product_id)
{
@@ -134,6 +147,9 @@
}
}
+/**
+ * \brief Release the access to the HID dongle.
+ */
void LIBLOCAL
tux_hid_release(void)
{
@@ -144,6 +160,12 @@
}
}
+/**
+ * \brief Write data to the HID dongle.
+ * \param size Data size.
+ * \param buffer Data to write.
+ * \return The write success.
+ */
bool LIBLOCAL
tux_hid_write(int size, const char *buffer)
{
@@ -177,6 +199,12 @@
}
}
+/**
+ * \brief Read data from the HID dongle.
+ * \param size Data size.
+ * \param buffer Data buffer.
+ * \return The read success.
+ */
bool LIBLOCAL
tux_hid_read(int size, char *buffer)
{
Modified: software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.h
===================================================================
--- software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.h
2008-12-02 09:29:22 UTC (rev 2976)
+++ software_suite_v2/tuxware/tuxdriver/trunk/src/tux_hid_win32.h
2008-12-02 09:54:58 UTC (rev 2977)
@@ -18,13 +18,23 @@
* 02111-1307, USA.
*/
+/**
+ * \file tux_hid_win32.h
+ * \brief Tux HID header.
+ * \author [EMAIL PROTECTED]
+ * \ingroup hid_interface
+ */
+
#ifdef WIN32
#ifndef _TUX_HID_H_
#define _TUX_HID_H_
+/** \brief HID USB timout */
#define HID_RW_TIMEOUT 1000
+/** \brief HID input report size */
#define REPORT_SIZE_IN 64
+/** \brief HID output report size */
#define REPORT_SIZE_OUT 64
extern bool tux_hid_capture(int vendor_id, int product_id);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn