navit  0.5.3-trunk
Vehicle WinCE

The Vehicle to gain position data from WinCE. More...

Data Structures

struct  gps_sat
 
struct  vehicle_priv
 

Macros

#define SwitchToThread()   Sleep(0)
 
#define W2A(lpw)
 
#define A2W(lpa)
 

Typedefs

typedef int(WINAPI * PFN_BthSetMode) (DWORD pBthMode)
 
typedef int(WINAPI * PFN_BthGetMode) (DWORD *pBthMode)
 

Enumerations

enum  file_type {
  file_type_pipe = 1 , file_type_device , file_type_file , file_type_socket ,
  file_type_serial , file_type_pipe = 1 , file_type_device , file_type_file ,
  file_type_socket
}
 

Functions

static void vehicle_wince_disable_watch (struct vehicle_priv *priv)
 
static void vehicle_wince_enable_watch (struct vehicle_priv *priv)
 
static int vehicle_wince_parse (struct vehicle_priv *priv, char *buffer)
 
static int vehicle_wince_open (struct vehicle_priv *priv)
 
static void vehicle_wince_close (struct vehicle_priv *priv)
 
static void initBth (struct vehicle_priv *priv)
 
static int initDevice (struct vehicle_priv *priv)
 
static int read_win32 (struct vehicle_priv *priv, char *buffer, size_t size)
 
static DWORD WINAPI wince_reader_thread (LPVOID lParam)
 
static int vehicle_wince_available_ports (void)
 
static void vehicle_wince_fix_timeout_cb (struct vehicle_priv *priv)
 This is a callback function, called when the fix timeout is done. Set the position to invalid. More...
 
static void vehicle_wince_restart_fix_timeout (struct vehicle_priv *priv)
 Cancel previous fix timeout event and add a new one. More...
 
static void vehicle_wince_io (struct vehicle_priv *priv)
 
static void vehicle_wince_destroy (struct vehicle_priv *priv)
 Frees the wince_vehicle. More...
 
static int vehicle_wince_position_attr_get (struct vehicle_priv *priv, enum attr_type type, struct attr *attr)
 Retrieves a vehicle attribute. More...
 
static int vehicle_wince_sat_attr_get (void *priv_data, enum attr_type type, struct attr *attr)
 
static struct vehicle_privvehicle_wince_new (struct vehicle_methods *meth, struct callback_list *cbl, struct attr **attrs)
 Creates a new wince_vehicle. More...
 
void plugin_init (void)
 Registers the vehicle_wince plugin. More...
 

Variables

char * _convert = NULL
 
wchar_t * _wconvert = NULL
 
static int buffer_size = 1024
 
struct callback_listvehicle_priv::priv_cbl
 
int vehicle_priv::is_running
 
int vehicle_priv::thread_up
 
HANDLE vehicle_priv::m_hGPSDevice
 
HANDLE vehicle_priv::m_hGPSThread
 
DWORD vehicle_priv::m_dwGPSThread
 
char * vehicle_priv::read_buffer
 
int vehicle_priv::read_buffer_pos
 
int vehicle_priv::baudrate
 
HMODULE vehicle_priv::hBthDll
 
PFN_BthSetMode vehicle_priv::BthSetMode
 
int vehicle_priv::has_data
 
GMutex vehicle_priv::lock
 
static struct item_methods vehicle_wince_sat_methods
 
struct vehicle_methods vehicle_wince_methods
 

Detailed Description

The Vehicle to gain position data from WinCE.

Macro Definition Documentation

◆ A2W

#define A2W (   lpa)
Value:
(\
((LPCSTR)lpa == NULL) ? NULL : (\
_wconvert = alloca(strlen(lpa)*2+1), mbstowcs(_wconvert, lpa, strlen(lpa) * 2 + 1), _wconvert) )
wchar_t * _wconvert
Definition: vehicle_wince.c:60

◆ SwitchToThread

#define SwitchToThread ( )    Sleep(0)

◆ W2A

#define W2A (   lpw)
Value:
(\
((LPCSTR)lpw == NULL) ? NULL : (\
_convert = alloca(wcslen(lpw)+1), wcstombs(_convert, lpw, wcslen(lpw) + 1), _convert) )
char * _convert
Definition: vehicle_wince.c:59

Typedef Documentation

◆ PFN_BthGetMode

typedef int(WINAPI * PFN_BthGetMode) (DWORD *pBthMode)

◆ PFN_BthSetMode

typedef int(WINAPI * PFN_BthSetMode) (DWORD pBthMode)

Enumeration Type Documentation

◆ file_type

enum file_type
Enumerator
file_type_pipe 
file_type_device 
file_type_file 
file_type_socket 
file_type_serial 
file_type_pipe 
file_type_device 
file_type_file 
file_type_socket 

Function Documentation

◆ initBth()

static void initBth ( struct vehicle_priv priv)
static

◆ initDevice()

◆ plugin_init()

void plugin_init ( void  )

Registers the vehicle_wince plugin.

The plugin entry point.

References dbg, lvl_debug, and vehicle_wince_new().

◆ read_win32()

static int read_win32 ( struct vehicle_priv priv,
char *  buffer,
size_t  size 
)
static

◆ vehicle_wince_available_ports()

static int vehicle_wince_available_ports ( void  )
static

References dbg, L, lvl_debug, and W2A.

Referenced by vehicle_wince_open().

◆ vehicle_wince_close()

static void vehicle_wince_close ( struct vehicle_priv priv)
static

References dbg, and lvl_debug.

Referenced by vehicle_wince_destroy(), and vehicle_wince_io().

◆ vehicle_wince_destroy()

static void vehicle_wince_destroy ( struct vehicle_priv priv)
static

◆ vehicle_wince_disable_watch()

◆ vehicle_wince_enable_watch()

◆ vehicle_wince_fix_timeout_cb()

static void vehicle_wince_fix_timeout_cb ( struct vehicle_priv priv)
static

This is a callback function, called when the fix timeout is done. Set the position to invalid.

Parameters
privPointer on the private data of the plugin

References attr_position_valid_invalid, callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::ev_fix_timeout, and vehicle_priv::valid.

Referenced by vehicle_wince_new().

◆ vehicle_wince_io()

◆ vehicle_wince_new()

◆ vehicle_wince_open()

static int vehicle_wince_open ( struct vehicle_priv priv)
static

◆ vehicle_wince_parse()

◆ vehicle_wince_position_attr_get()

static int vehicle_wince_position_attr_get ( struct vehicle_priv priv,
enum attr_type  type,
struct attr attr 
)
static

◆ vehicle_wince_restart_fix_timeout()

static void vehicle_wince_restart_fix_timeout ( struct vehicle_priv priv)
static

Cancel previous fix timeout event and add a new one.

Parameters
privPointer on the private data of the plugin

References vehicle_priv::cb_fix_timeout, vehicle_priv::ev_fix_timeout, event_add_timeout(), and event_remove_timeout().

Referenced by vehicle_wince_parse().

◆ vehicle_wince_sat_attr_get()

static int vehicle_wince_sat_attr_get ( void *  priv_data,
enum attr_type  type,
struct attr attr 
)
static

◆ wince_reader_thread()

Variable Documentation

◆ _convert

char* _convert = NULL

◆ _wconvert

wchar_t* _wconvert = NULL

◆ baudrate

int vehicle_priv::baudrate

◆ BthSetMode

PFN_BthSetMode vehicle_priv::BthSetMode

Referenced by initBth(), and vehicle_wince_destroy().

◆ buffer_size

int buffer_size = 1024
static

◆ has_data

int vehicle_priv::has_data

Referenced by read_win32(), and wince_reader_thread().

◆ hBthDll

HMODULE vehicle_priv::hBthDll

Referenced by initBth(), and vehicle_wince_destroy().

◆ is_running

◆ lock

GMutex vehicle_priv::lock

◆ m_dwGPSThread

DWORD vehicle_priv::m_dwGPSThread

◆ m_hGPSDevice

HANDLE vehicle_priv::m_hGPSDevice

Referenced by initDevice(), and wince_reader_thread().

◆ m_hGPSThread

HANDLE vehicle_priv::m_hGPSThread

◆ priv_cbl

struct callback_list* vehicle_priv::priv_cbl

◆ read_buffer

char* vehicle_priv::read_buffer

◆ read_buffer_pos

int vehicle_priv::read_buffer_pos

Referenced by read_win32(), and wince_reader_thread().

◆ thread_up

int vehicle_priv::thread_up

◆ vehicle_wince_methods

struct vehicle_methods vehicle_wince_methods
Initial value:
= {
NULL,
}
static int vehicle_wince_position_attr_get(struct vehicle_priv *priv, enum attr_type type, struct attr *attr)
Retrieves a vehicle attribute.
Definition: vehicle_wince.c:781
static void vehicle_wince_destroy(struct vehicle_priv *priv)
Frees the wince_vehicle.
Definition: vehicle_wince.c:756

Referenced by vehicle_wince_new().

◆ vehicle_wince_sat_methods

struct item_methods vehicle_wince_sat_methods
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static int vehicle_wince_sat_attr_get(void *priv_data, enum attr_type type, struct attr *attr)
Definition: vehicle_wince.c:848

Referenced by vehicle_wince_new().