Changeset 350 in pacpusframework for trunk


Ignore:
Timestamp:
10/15/15 14:40:14 (9 years ago)
Author:
nguyenhu
Message:

add Zoe types and shared memory for linux

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/PacpusTools/PosixShMem.h

    r162 r350  
    3434    virtual void *read();
    3535    /// @todo Documentation
     36    virtual void read(void * mem, int size);
     37    /// @todo Documentation
    3638    virtual void write(void *data, int size, unsigned long offset = 0);
    3739    /// @todo Documentation
  • trunk/include/Pacpus/kernel/DbiteFileTypes.h

    r324 r350  
    8282    , FLUENCE_ZE_REAR_WHEELSPEED
    8383    , FLUENCE_ZE_LOWSPEED
     84    , ZOE_STEERINGWHEEL        //begin copy from 0.1.x
     85    , ZOE_KINEMATICS
     86    , ZOE_GEARS
     87    , ZOE_FRONT_WHEELSPEED
     88    , ZOE_REAR_WHEELSPEED
     89    , ZOE_VEHICLESTATE
     90    , ZOE_INITION
     91    , PROVEL_MABXFEEDBACK
     92    , PROVEL_MABXDIAG
     93    , PROVEL_MABX100MS          //end copy from 0.1.x
    8494    , RADAR_TRW_AC20 = 3000
    8595    , SMS_RADAR = 4000          // by Arthur Miranda 2012-02-23 (PAMU Project)
  • trunk/src/PacpusTools/CMakeLists.txt

    r300 r350  
    3636    ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PeriodicWorker.h
    3737    ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/SharedMemory.h
     38    ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PosixShMem.h
    3839
    3940    #${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/pacpusStruct.h
     
    4849    #src/PacpusSerialPort.cpp
    4950    src/SharedMemory.cpp
     51    src/PosixShMem.cpp
    5052)
    5153
  • trunk/src/PacpusTools/src/PosixShMem.cpp

    r312 r350  
    104104
    105105//////////////////////////////////////////////////////////////////////////
    106 /// Use this method to get the data of the shared memory
     106/// Use this method to get a pointer to data of the shared memory
    107107void * PosixShMem::read()
    108108{
    109     return shMem_;
     109    void * shMem;
     110    lockMemory();
     111    shMem = shMem_;
     112    unlockMemory();
     113    return shMem;
     114}
     115
     116//////////////////////////////////////////////////////////////////////////
     117/// Use this method to get a pointer to data of the shared memory
     118void PosixShMem::read(void * mem, int size)
     119{
     120    lockMemory();
     121    memcpy(mem,shMem_,size);
     122    unlockMemory();
    110123}
    111124
Note: See TracChangeset for help on using the changeset viewer.