contentLister/inc/erConnect.h File Reference

contentLister - connect finite state machine and process launcher More...

#include <pthread.h>

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  connectStruct_t

Defines

#define COMMAND_STRING_MAX   1024

Enumerations

enum  connectCmd_e { connectCmdNone, connectCmdStart, connectCmdStop }
enum  connectState_e { connectStateIdle = 0, connectStateConnected, connectStateDisconnected }
enum  connectScr_e {
  connectScrUnchanged, connectScrDownloadHistory, connectScrMode, connectScrNews,
  connectScrBooks, connectScrDocs, connectScrNotes
}

Functions

void erConnectInit (connectStruct_t *connect)
pid_t erConnectPid (void)


Detailed Description

contentLister - connect finite state machine and process launcher

<File description>="">

Definition in file erConnect.h.


Define Documentation

#define COMMAND_STRING_MAX   1024

Definition at line 41 of file erConnect.h.


Enumeration Type Documentation

Enumerator:
connectCmdNone 
connectCmdStart 
connectCmdStop 

Definition at line 43 of file erConnect.h.

00044 {
00045     connectCmdNone,
00046     connectCmdStart,
00047     connectCmdStop
00048 } connectCmd_e;

Enumerator:
connectScrUnchanged 
connectScrDownloadHistory 
connectScrMode 
connectScrNews 
connectScrBooks 
connectScrDocs 
connectScrNotes 

Definition at line 57 of file erConnect.h.

Enumerator:
connectStateIdle 
connectStateConnected 
connectStateDisconnected 

Definition at line 50 of file erConnect.h.


Function Documentation

void erConnectInit ( connectStruct_t connect  ) 

Definition at line 70 of file erConnect.c.

00071 {
00072     connect->command              = connectCmdNone;
00073     connect->state                = connectStateIdle;
00074     connect->screen               = connectScrDownloadHistory;
00075     connect->background           = FALSE;
00076     connect->connect_from_pincode = FALSE;
00077     connect->connect_after_reboot = FALSE;
00078     connect->szCommand[0]         = '\0';
00079 
00080     if (pthread_mutex_init(&(connect->mutex), NULL) )
00081     {
00082         CL_ERRORPRINTF("Could not initialize connect mutex");
00083         perror("Could not initialize mutex");
00084     }
00085     else
00086     {
00087         CL_ERRORPRINTF("Lock the connect mutex");
00088         pthread_mutex_lock( &(connect->mutex) );
00089     }
00090 
00091     // Start the download thread
00092     pthread_t thread_id;
00093     if (pthread_create(&thread_id, NULL, connectThread, (void *) connect) != 0)
00094     {
00095         CL_CTPRINTF("%s %s: ", __FILE__, __FUNCTION__);
00096         perror("Could not create thread\n");
00097     }
00098 
00099     timed_ids_init();
00100 }

Here is the call graph for this function:

pid_t erConnectPid ( void   ) 

Definition at line 102 of file erConnect.c.

00103 {
00104     return g_connect_pid;
00105 }


Generated on Sun Dec 14 17:12:49 2008 by  doxygen 1.5.6