libHartwer - Documentation
Data Structures | Enumerations | Functions

bcs_sm.h File Reference

Utilities for creating and acessing shared memory segments. More...

Go to the source code of this file.

Data Structures

struct  BCS_SM_valuestruct
 Provides easy access to the shared memory values if all values are needed. More...

Enumerations

enum  BCS_SM_datatypes
 

Used when querying the type of a memory segment.


enum  BCS_SM_values {
  BCS_SM_RESERVED = 10, BCS_SM_RPM, BCS_SM_POIL, BCS_SM_PFUEL,
  BCS_SM_SPEED, BCS_SM_BATTU, BCS_SM_LAMBDA, BCS_SM_ACCX,
  BCS_SM_ACCY, BCS_SM_ACCZ, BCS_SM_TOIL, BCS_SM_TENGINE,
  BCS_SM_TAIR, BCS_SM_GEAR, BCS_SM_CLUTCH, BCS_SM_TRACTION,
  BCS_SM_ANALOGUES, BCS_SM_NETDCUEXT, BCS_SM_STATEBYTES, BCS_SM_ETH
}
 

This enum is used to get access to the appropriate shared memory segment.

More...

Functions

void * BCS_SM_getShared (BCS_SM_values type)
 Use this method to connect to a shared memory segment.
BCS_SM_valuestructBCS_SM_getSharedAsWhole ()
 Returns the whole memory segment containing als BCS_SM values.
int BCS_SM_getSharedPos (BCS_SM_values type)
 Returns the relative position of the memory segment defined by type.
void * BCS_SM_getSharedRo (BCS_SM_values type)
 SPECIAL COMMAND: GET READ-ONLY ACCESS.
void * BCS_SM_getSharedSegment (UInt32 size, UInt32 id)
 Use this method to get access to a shared memory segment of a given size.
BCS_SM_datatypes BCS_SM_getSharedType (BCS_SM_values type)
 Returns the data type of a shared memory segment.
void BCS_SM_releaseShared (void *sharedMemory, BCS_SM_values type)
 Detaches a given pointer from a shared memory segment.
void BCS_SM_releaseSharedSegment (void *sharedMemory, UInt32 size, UInt32 id)
 Use this method to release access to a shared memory segment you requested before.

Detailed Description

Date:
14.03.2009
Author:
Marius Zwicker This file provides access and utilities to access and maintain shared memory segments

Enumeration Type Documentation

To understand the abreviations, look into MS3 Doku.

Enumerator:
BCS_SM_RESERVED 

reserved memory space

BCS_SM_RPM 

type: UInt32

BCS_SM_POIL 

type: float

BCS_SM_PFUEL 

type: float

BCS_SM_SPEED 

type: float

BCS_SM_BATTU 

type: float

BCS_SM_LAMBDA 

type: float

BCS_SM_ACCX 

type: float

BCS_SM_ACCY 

type: float

BCS_SM_ACCZ 

type: float

BCS_SM_TOIL 

type: Int32

BCS_SM_TENGINE 

type: Int32

BCS_SM_TAIR 

type: Int32

BCS_SM_GEAR 

type: UInt32

BCS_SM_CLUTCH 

type: UInt32

BCS_SM_TRACTION 

type: UInt32

BCS_SM_ANALOGUES 

type: array of UInt16, length at the moment: 9

BCS_SM_NETDCUEXT 

type: array of UInt8, length at the moment: 4

BCS_SM_STATEBYTES 

type: array of UInt8, length at the moment: 3

BCS_SM_ETH 

type: float


Function Documentation

void* BCS_SM_getShared ( BCS_SM_values  type)

If it doesn't exist yet, it will be created. See the BCS_SM_values enum docu for the returned memory type.

Parameters:
typeuse this to choose the memory segment via the FR9SM_values enum
BCS_SM_valuestruct* BCS_SM_getSharedAsWhole ( )

By using BCS_SM_getSharedPos and BCS_SM_getSharedType you can access the individual values or of course by using the normal struct access methods

void * BCS_SM_getSharedRo ( BCS_SM_values  type)

Use this method to connect to a shared memory segment. If it doesn't exist yet, it will be created. See the BCS_SM_values enum docu for the returned memory type.

Parameters:
typeuse this to choose the memory segment via the FR9SM_values enum
void* BCS_SM_getSharedSegment ( UInt32  size,
UInt32  id 
)
Parameters:
sizerequested size as needed (in byte)
idunique identifier - ATTENTION: make sure your requested id is bigger than the last BCS_SM_values entry!
BCS_SM_datatypes BCS_SM_getSharedType ( BCS_SM_values  type)

This can be used to determine the size or correct calculation function for a segment

void BCS_SM_releaseShared ( void *  sharedMemory,
BCS_SM_values  type 
)

If all pointer to a segment are detached, it will be removed.

Parameters:
sharedMemorypointer to a shared memory segment
typesame type that was used when calling BCS_SM_getShared()
void BCS_SM_releaseSharedSegment ( void *  sharedMemory,
UInt32  size,
UInt32  id 
)

In case nobody else wants access, the segment will be deleted.

Parameters:
sharedMemorypointer returned when calling getSharedSegment(..)
sizesame size as requested before
idthe same unique identifier as used before - ATTENTION: again make sure your requested id is bigger than the last BCS_SM_values entry!

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.