PRODUCTS
 


Main Page   Data Structures   File List   Data Fields   Globals  

TeleoEasyLinux.c File Reference

Sets up the Teleo SDK under Linux. More...

#include <stdio.h>
#include "TeleoEasy.h"
#include "TeleoInterface.h"
#include "TeleoDeviceManager.h"
#include <pthread.h>

Go to the source code of this file.

Defines

#define EVENT_TIME   10

Functions

void * doInput (void *data)
 Function provided to the input thread to call back into the channel when characters arrive.

void * doTimer (void *data)
 Function provided to the timer thread to call back into the channel at the appropriate intervals.

TeleoError output (TeleoChannel *tc, uint8 *c, uint8 count)
 Function provided to the timer thread to call back into the channel at the appropriate intervals.

TeleoError TeleoEasy_Init (cchar *interfaceName, TI_InterfaceType interfaceTypeId, TeleoDeviceManager **tdm)
 Initializes the system.

void TeleoEasy_End ()
TeleoError TeleoEasy_InterfaceAdd (cchar *interfaceName, TI_InterfaceType interfaceTypeId)
 Adds additional interfaces.

TeleoModuleManagerTeleoEasy_TeleoModuleManagerGet ()
 Returns the Module Manager in case any lower level calls need to be made.

void TeleoEasy_Start ()
 Starts the system.

void TeleoEasy_Continue ()
 Waits for the library to exit.

void TeleoEasy_Lock ()
 Locks access to the library.

void TeleoEasy_Unlock ()
 Unlocks access to the library.


Variables

TeleoDeviceManagerteleoDeviceManager
 Reference to the Module Manager.

TeleoModuleManagerteleoModuleManager
 Reference to the Module Manager.

TeleoChannelteleoChannel
 Reference to the Channel.

TeleoInterfaceteleoInterface
pthread_t teleoInputThread
pthread_t teleoTimerThread
pthread_mutex_t teleoThreadMutex
bool running


Detailed Description

Sets up the Teleo SDK under Linux.

Illustrates the connection of all the layers of the SDK for Linux.Used in several example apps.

Uses pthreads internally to achieve multithreaded IO.

Definition in file TeleoEasyLinux.c.


Define Documentation

#define EVENT_TIME   10
 

Definition at line 22 of file TeleoEasyLinux.c.


Function Documentation

void * doInput void *    data [static]
 

Function provided to the input thread to call back into the channel when characters arrive.

Definition at line 168 of file TeleoEasyLinux.c.

References TC_input(), TELEO_OK, TeleoEasy_Lock(), TeleoEasy_Unlock(), TI_get(), and uint8.

void * doTimer void *    data [static]
 

Function provided to the timer thread to call back into the channel at the appropriate intervals.

Definition at line 153 of file TeleoEasyLinux.c.

References TC_timerEvent(), TeleoEasy_Lock(), TeleoEasy_Unlock(), TI_SleepMs(), and TMM_timerModuleEvent().

TeleoError output TeleoChannel   tc,
uint8   c,
uint8    count
[static]
 

Function provided to the timer thread to call back into the channel at the appropriate intervals.

Low level callback function from the TeleoChannel

Definition at line 200 of file TeleoEasyLinux.c.

References TeleoError, and TI_put().

void TeleoEasy_Continue  
 

Waits for the library to exit.

Definition at line 146 of file TeleoEasyLinux.c.

Referenced by main(), TeleoEasy_destroy(), and TeleoEasy_End().

void TeleoEasy_End  
 

Definition at line 111 of file TeleoEasyLinux.c.

References running, TC_destroy(), TDM_destroy(), TeleoEasy_Continue(), TI_destroy(), and TMM_destroy().

TeleoError TeleoEasy_Init cchar   interfaceName,
TI_InterfaceType    interfaceTypeId,
TeleoDeviceManager **    tdm
 

Initializes the system.

Parameters:
interfaceName the device name - can be NULL for default
interfaceTypeId the interface type (i.e. TI_USB, TI_SERIAL, etc.)
tdm the Device Manager return value
Returns:
TELEO_OK (0) or appropriate error

Definition at line 61 of file TeleoEasyLinux.c.

TeleoError TeleoEasy_InterfaceAdd cchar   interfaceName,
TI_InterfaceType    interfaceTypeId
 

Adds additional interfaces.

Parameters:
interfaceName the device name - can be NULL for default
interfaceTypeId the interface type (i.e. TI_USB, TI_SERIAL, etc.)

Definition at line 123 of file TeleoEasyLinux.c.

void TeleoEasy_Lock  
 

Locks access to the library.

Definition at line 187 of file TeleoEasyLinux.c.

Referenced by doInput(), doTimer(), and main().

void TeleoEasy_Start  
 

Starts the system.

Definition at line 134 of file TeleoEasyLinux.c.

Referenced by main().

TeleoModuleManager* TeleoEasy_TeleoModuleManagerGet  
 

Returns the Module Manager in case any lower level calls need to be made.

Definition at line 129 of file TeleoEasyLinux.c.

void TeleoEasy_Unlock  
 

Unlocks access to the library.

Definition at line 192 of file TeleoEasyLinux.c.

Referenced by doInput(), doTimer(), and main().


Variable Documentation

bool running [static]
 

Definition at line 59 of file TeleoEasyLinux.c.

Referenced by TeleoEasy_End(), TeleoEasy_Init(), and TeleoEasy_Start().

TeleoChannel* teleoChannel [static]
 

Reference to the Channel.

Definition at line 52 of file TeleoEasyLinux.c.

TeleoDeviceManager* teleoDeviceManager [static]
 

Reference to the Module Manager.

Definition at line 48 of file TeleoEasyLinux.c.

Referenced by TeleoEasy_Init().

pthread_t teleoInputThread [static]
 

Definition at line 55 of file TeleoEasyLinux.c.

TeleoInterface* teleoInterface [static]
 

Definition at line 54 of file TeleoEasyLinux.c.

TeleoModuleManager* teleoModuleManager [static]
 

Reference to the Module Manager.

Definition at line 50 of file TeleoEasyLinux.c.

Referenced by TeleoEasy_TeleoModuleManagerGet().

pthread_mutex_t teleoThreadMutex [static]
 

Definition at line 57 of file TeleoEasyLinux.c.

pthread_t teleoTimerThread [static]
 

Definition at line 56 of file TeleoEasyLinux.c.

 

copyright © 2002, 2003 MakingThings LLC