Getbitoffset(), Peeknbits(), Getbitoffset() peeknbits() – Teledyne LeCroy Merlins Wand - CSL manual (CATC Scripting Language Manual) User Manual
Page 40
![background image](/manuals/353522/40/background.png)
34
CATC Scripting Language for Bluetooth Analyzers
CATC
Manual Ver. 1.21
GetBitOffset()
GetBitOffset()
Return value
integer
Comments
Returns the current bit offset that is used in
NextNBits
or
PeekNBits
.
Example
raw = 'FOFO';# 1111000011110000 binary
result1 = GetNBits ( raw, 2, 4 );
result2 = PeekNBits(5);
result3 = NextNBits(2);
Trace ( "Offset = ", GetBitOffset() );
The example generates this Trace output:
Offset = D
PeekNBits()
PeekNBits(
Return value
integer, list or raw.
Comments
Reads
bit_count
bits from the data source. The difference between
PeekNBits
and
NextNBits
is that
PeekNBits
does not advance the global
bit offset.
PeekNBits
can be used to make decisions about how to parse the next
fields without affecting subsequent calls to
NextNBits
. If
PeekNBits
is called
without a prior call to
GetNBits
, the result is undefined. Note that bits are indexed
starting at bit 0.
Example
raw = 'FOFO';# 1111000011110000 binary
result1 = GetNBits ( raw, 2, 4 );
result2 = PeekNBits(5);
Parameter
Meaning
Default Value
Comments
N/A
Parameter
Meaning
Default Value
Comments
bit_count integer