-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The seg fault from trying to use extract remains:
Program terminated with signal 11, Segmentation fault. #0 extract<std::vector<bool, std::allocator<bool> > > (in=..., bits=bits@entry=0xa3309ce0, bits_sz=bits_sz@entry=8) at ./op25_yank.h:109 109 x = (x << 1) | (in[bits[i]] ? 1 : 0); (gdb) bt #0 extract<std::vector<bool, std::allocator<bool> > > (in=..., bits=bits@entry=0xa3309ce0, bits_sz=bits_sz@entry=8) at ./op25_yank.h:109 #1 0xb2e0aa53 in ldu1::lcf (this=0xb498148) at ldu1.cc:138 #2 0xb2e08931 in ldu1::snapshot (this=0xb498148) at ldu1.cc:102 #3 0xb2e0f42b in snapshot_du_handler::handle (this=0xadc8b28, du=...) at snapshot_du_handler.cc:44
I can not figure out what I am doing wrong. I tried to copy how it this procedure is done in abstract_data_unit::frame_body(). I give the vector to extract() like this:
uint16_t ldu1::lcf() const { const size_t LCF_BITS[] = { 0, 1, 2, 3, 4, 5, 6 , 7 }; const size_t LCF_BITS_SZ = sizeof(LCF_BITS) / sizeof(LCF_BITS[0]); const uint16_t lcf = extract(get_vec(), LCF_BITS, LCF_BITS_SZ); return lcf;
}
const_bit_vector& ldu1::get_vec() const { return decoded_lcw_vec; }
and i know the vector is there becuase it prints to the screen before the program dies:
DU1 LCW Data-------------------------------------------- - ----------------------------------------------------------- Encoded LCW: LCF: 00000000 MFID: 00000000 TGID: 0000000000000001 Source ID: 001000100000011111111101
Hamming decode: LCF: 00000000 MFID: 00000000 TGID: 0000000000000001 Source ID: 001000100000011111111101
RS decode: LCF: 00000000 MFID: 00000000 TGID: 0000000000000001 Source ID: 001000100000011111111101
Decode LDU1 LCW Vector Complete:000000000000000001000000000000000000000000000001001000100000011111111101 - -----------------------------------------------------------
the vector is defined private in the .h file. Any help will be much appreciated.