#include <pthread.h>
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) |
<File description>="">
Definition in file erConnect.h.
#define COMMAND_STRING_MAX 1024 |
Definition at line 41 of file erConnect.h.
enum connectCmd_e |
Definition at line 43 of file erConnect.h.
00044 { 00045 connectCmdNone, 00046 connectCmdStart, 00047 connectCmdStop 00048 } connectCmd_e;
enum connectScr_e |
connectScrUnchanged | |
connectScrDownloadHistory | |
connectScrMode | |
connectScrNews | |
connectScrBooks | |
connectScrDocs | |
connectScrNotes |
Definition at line 57 of file erConnect.h.
00058 { 00059 connectScrUnchanged, 00060 connectScrDownloadHistory, 00061 connectScrMode, 00062 connectScrNews, 00063 connectScrBooks, 00064 connectScrDocs, 00065 connectScrNotes, 00066 } connectScr_e;
enum connectState_e |
Definition at line 50 of file erConnect.h.
00051 { 00052 connectStateIdle = 0, 00053 connectStateConnected, 00054 connectStateDisconnected 00055 } connectState_e;
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 }
pid_t erConnectPid | ( | void | ) |