10 ,
const int subeventid
14 ,
const int trigger_enabled)
17 m_eventType = eventtype;
18 m_subeventid = subeventid;
19 number_of_words = n_words;
22 rfp = fopen(
"/dev/urandom",
"r");
53 if (etype != m_eventType )
66 sevt->
sub_id = m_subeventid;
70 int *d = (
int *) &sevt->
data;
75 for ( ia = 0; ia < number_of_words; ia++)
77 int l = fread ( &
data, 4, 1, rfp);
82 x /= ( 1024. * 1024.);
83 x *= ( high_range - low_range);
104 sevt->sub_id = m_subeventid;
106 sevt->sub_decoding =
ID4EVT;
107 sevt->reserved[0] = 0;
108 sevt->reserved[1] = 0;
112 int *d = (
int *) &sevt->data;
116 for ( ia = 0; ia < number_of_words; ia++)
118 int l = fread ( &data, 4, 1, rfp);
123 x /= ( 1024. * 1024.);
124 x *= ( high_range - low_range);
126 *d++ = x + low_range;
131 sevt->sub_padding = len%2;
133 sevt->sub_length += len;
134 return sevt->sub_length;
142 os <<
"Random Device Event Type: " << m_eventType <<
" Subevent id: " << m_subeventid
143 <<
" n_words: " << number_of_words
144 <<
" range: " << low_range <<
" - " << high_range;
148 os <<
" ** Trigger enabled";
157 if (etype != m_eventType)
return 0;
170 if (etype != m_eventType)
return 0;