Changeset 5581

Show
Ignore:
Timestamp:
10/30/07 08:06:19 (6 years ago)
Author:
jgaeddert
Message:

adding function to scramble control packet so that the number of zeros and ones are approximately even

Location:
experimental/components/CIREN_SM/trunk/CIREN_SM
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/CIREN_SM/trunk/CIREN_SM/CIREN_SM.cpp

    r5580 r5581  
    310310{ 
    311311    // initialize with blank values 
    312     for (unsigned int i=0; i<64; i++) 
    313         c[i] = 210;     // 1101 0010 
     312    memset(c, 0, 64); 
    314313 
    315314    c[0] = 211;         // inband/outband signal 
     
    323322        c[5+i] = SSR_NONE; 
    324323 
     324} 
     325 
     326void CIREN_SM_i::ScrambleControlPacket(unsigned char *c) 
     327{ 
     328    for (unsigned int i=0; i<64; i++) 
     329        c[i] ^= 0xD2;   // 1101 0010 
    325330} 
    326331 
  • experimental/components/CIREN_SM/trunk/CIREN_SM/CIREN_SM.h

    r5580 r5581  
    100100    void ProcessControl(); 
    101101 
     102    /// Ensures that the packet doesn't contain all zeros 
     103    void ScrambleControlPacket(unsigned char *c); 
     104 
    102105    /// Initialize control packet 
    103106    void InitializeControlPacket(unsigned char *c);