Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

canapi.c File Reference

#include "..\interfaces\interfaces.h"
#include "..\includes\defines.h"
#include "..\includes\canapi.h"
#include <string.h>
#include <stdio.h>
#include <windows.h>

Go to the source code of this file.

Functions

int _get_offsets ()
int seterror (char *buffer, int toset)
int isinvalid (int handle)
int can_can2raw (can_frame *frame, unsigned char *raw)
 This functions is used to convert a formatted can_frame to a raw bitpacked CAN 2.0 B frame.
int can_raw2can (unsigned char *raw, can_frame *frame)
 This functions is used to convert a raw bitpacked CAN 2.0 B frame to a formatted can_frame.
int can_setchanneloptions (int handle, int option, int status)
 This functions is used to manually set an option on an underlying adapter.
int can_getchanneloptions (int handle, int option, int *status)
 This functions is used to manually get an option from an underlying adapter.
int can_probebus (can_list list, char *errbuf)
 The function is used to probe the bus for CAN cards.
int can_openchannel (char *device, char *errbuf)
 This functions is used to open a CAN channel for reading and writing.
int can_readchannel (int handle, can_frame *frame)
 This functions is used to read a can_frame from a channel.
int can_writechannel (int handle, can_frame *frame)
 This functions is used to write a can_frame to a channel.
int can_closechannel (int handle)
 This functions is used to close a channel opened with can_openchannel.
int can_getlasterror (int handle, char *errbuf)
 This functions is used to get the character string of the last error associated with a handle.
int can_getlastassoc (int handle, as_ts *timestamp)
 This functions is used to get the last IRIG time sync association.
int __stdcall DllMain (HANDLE hmodule, DWORD dwReason, PVOID pvReserved)
int can_getfield (can_frame *frame, int type, int *ret)
 This functions is used to extract fields for use in the Analyzer.

Variables

int _offsets [B__MAX]
int if_channel_count
int _bit_width [B__MAX]
_s_interfaceinterfaces
_if_channel channel [CAN_MAXCHANNELS]
unsigned char * _errors [S__MAX]
unsigned char * _errframe [10]
int if_board_count
FILE * tracefile
int api_channel_count = 0
int b_can_bitsizes []


Function Documentation

int _get_offsets  ) 
 

Definition at line 47 of file canapi.c.

References _bit_width, _offsets, and B__MAX.

Referenced by can_can2raw().

int __stdcall DllMain HANDLE  hmodule,
DWORD  dwReason,
PVOID  pvReserved
 

Definition at line 264 of file canapi.c.

References tracefile.

int isinvalid int  handle  ) 
 

Definition at line 68 of file canapi.c.

References _if_channel::error, if_channel_count, _if_channel::isopen, and S_ERR_INV_HANDLE.

Referenced by can_closechannel(), can_getchanneloptions(), can_getlastassoc(), can_getlasterror(), can_readchannel(), can_setchanneloptions(), and can_writechannel().

int seterror char *  buffer,
int  toset
 

Definition at line 63 of file canapi.c.

References _errors.

Referenced by can_openchannel(), and can_probebus().


Variable Documentation

int _bit_width[B__MAX]
 

Definition at line 76 of file defines.c.

Referenced by _get_offsets(), and can_can2raw().

unsigned char* _errframe[10]
 

Definition at line 63 of file defines.c.

Referenced by can_getlasterror().

unsigned char* _errors[S__MAX]
 

Definition at line 34 of file defines.c.

Referenced by can_getlasterror(), and seterror().

int _offsets[B__MAX]
 

Definition at line 91 of file defines.c.

Referenced by _get_offsets(), and can_can2raw().

int api_channel_count = 0
 

Definition at line 45 of file canapi.c.

int b_can_bitsizes[]
 

Initial value:

{       1,      
        8,      
        12,     
        8       
}

Definition at line 285 of file canapi.c.

Referenced by can_getfield().

struct _if_channel channel[CAN_MAXCHANNELS]
 

Definition at line 93 of file defines.c.

int if_board_count
 

Definition at line 96 of file defines.c.

int if_channel_count
 

Definition at line 95 of file defines.c.

struct _s_interface* interfaces
 

Definition at line 50 of file interfaces.c.

FILE* tracefile
 

Definition at line 44 of file canapi.c.

Referenced by DllMain(), and dumpevent().


Generated on Wed Feb 22 13:31:28 2006 for CANapi by  doxygen 1.4.4