Changeset 233 in tmcsimulator for branches/FEPSimulator/DataPacker.cpp


Ignore:
Timestamp:
11/13/2017 06:07:07 PM (8 years ago)
Author:
jtorres
Message:

FEPSim: finalized comments, added to both header and source files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/DataPacker.cpp

    r202 r233  
    11#include "DataPacker.h" 
    22 
     3// declare static message var 
    34unsigned char * DataPacker::msg; 
    45 
     6/** 
     7 * Returns packed data message to be sent to ATMS Server in fep_reply via RPC 
     8 *  
     9 * @param station The station for which the message is to be made 
     10 * @return The packed data message 
     11 */ 
    512unsigned char * DataPacker::packData(STATION *station) { 
    613    int pos = 26; 
     
    4451} 
    4552 
     53/** 
     54 * Packs the dynamic (occ/vol) data into the message 
     55 *  
     56 * @param station the station being packed 
     57 * @param packNo number that specifies which lane types to compare 
     58 * @param pos position in the message (byte number) 
     59 * @return position (int) 
     60 */ 
    4661int DataPacker::dynamicDataPack(STATION *station, int packNo, int pos) { 
    4762     
     
    97112    return pos; 
    98113} 
    99  
     114/** 
     115 * Packs the static meta data into the msg 
     116 *  
     117 * @param station station being packed 
     118 * @return the msg 
     119 */ 
    100120unsigned char * DataPacker::staticDataPack(STATION *station) { 
    101121    int j; 
     
    208228} 
    209229 
     230/** 
     231 * Checks if there is data available at the specified lane 
     232 * @param flag 
     233 * @param num 
     234 * @return bool (is data available) 
     235 */ 
    210236bool DataPacker::DataAvail(char flag, int num) { 
    211237    int mag, fel; 
     
    238264} 
    239265 
    240 // checksum based on data from byte 1 (after 0DOA) to the second last byte (the  
     266/** 
     267 * Returns the sum of values from byte 1 (after 0x0D0A) to the second to last byte 
     268 *  
     269 * @param dataptr msg data pointer 
     270 * @param len length of message 
     271 * @return checksum value 
     272 */ 
    241273char DataPacker::chksum(unsigned char *dataptr, int len) { 
    242274    int i; 
     
    249281} 
    250282 
    251 // convert vol and occ data to a two-byte data packet 
     283/** 
     284 * Convert volume and occupancy data to a two-byte data packet 
     285 * @param vol 
     286 * @param occ 
     287 * @return the volume occupancy two byte data packet struct 
     288 */ 
    252289VOLOCC DataPacker::packVOLOCC(int vol, int occ) 
    253290{ 
Note: See TracChangeset for help on using the changeset viewer.