Class MarauderReadSectorBitmap
-
- All Implemented Interfaces:
-
java.io.Serializable
public class MarauderReadSectorBitmap implements Serializable
This class should mirror the struct ble_marauder_sector_bitmap_t of Gollum BLE Example value: (0x) 0F-00-00-00-40-FE-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF Warning: sector bitmap is in little endian: byte 0: command byte 1: version tag byte 2: reserved byte 3: reserved byte 4: bitmap_length byte 5: bitmap for sectors 07 to 00: S07 S06 S05 S04 S03 S02 S01 S00 bit to 1: sector free, bit to 0: sector used byte 6: bitmap for sectors 15 to 08: S15 S14 S13 S12 S11 S10 S09 S08 bit to 1: sector free, bit to 0: sector used byte 7: bitmap for sectors 23 to 09: S23 S22 S21 S20 S19 S18 S17 S16 bit to 1: sector free, bit to 0: sector used ...
-
-
Field Summary
Fields Modifier and Type Field Description public byte
versionTag
public int
bitmap_length
public Array<byte>
bitmap
public boolean
isWellInitialized
-
Constructor Summary
Constructors Constructor Description MarauderReadSectorBitmap()
MarauderReadSectorBitmap(Array<byte> characteristicValue)
-
Method Summary
Modifier and Type Method Description boolean
isWellInitialized()
boolean
init(Array<byte> characteristicValue)
byte
getVersionTag()
void
setVersionTag(byte versionTag)
int
getBitmapLength()
void
setBitmapLength(int bitmap_length)
Array<byte>
getBitmap()
void
setBitmap(Array<byte> bitmap)
int
getNumSectors()
int
getNumFreeSectors()
int
getNumUsedSectors()
int
getNextSectorUsed(int fromSector)
Returns the next used sector that occurs on or after the specified starting sector. boolean
isSectorUsed(int sector)
boolean
isSectorFree(int sector)
boolean
isSectorBitmapValid()
boolean
equals(Object o)
String
toString()
String
toStringDetailled()
-
-
Constructor Detail
-
MarauderReadSectorBitmap
MarauderReadSectorBitmap()
-
MarauderReadSectorBitmap
MarauderReadSectorBitmap(Array<byte> characteristicValue)
- Parameters:
characteristicValue
- value of the characteristic, including the command byte
-
-
Method Detail
-
isWellInitialized
boolean isWellInitialized()
-
getVersionTag
byte getVersionTag()
-
setVersionTag
void setVersionTag(byte versionTag)
-
getBitmapLength
int getBitmapLength()
-
setBitmapLength
void setBitmapLength(int bitmap_length)
-
getNumSectors
int getNumSectors()
- Returns:
number of total sectors (used + free)
-
getNumFreeSectors
int getNumFreeSectors()
- Returns:
number of free sectors
-
getNumUsedSectors
int getNumUsedSectors()
- Returns:
number of used sectors
-
getNextSectorUsed
int getNextSectorUsed(int fromSector)
Returns the next used sector that occurs on or after the specified starting sector. If no such sector exists then -1 is returned.
- Returns:
the next used sector
-
isSectorUsed
boolean isSectorUsed(int sector)
- Returns:
true if sector is used
-
isSectorFree
boolean isSectorFree(int sector)
- Returns:
true if sector is free
-
isSectorBitmapValid
boolean isSectorBitmapValid()
- Returns:
true if sector bitmap Length has been set according to FW flavor and is validValid bitmap length are:- Marauder Basic: 32 bytes (256 sectors)- Marauder Standard: 64 bytes (512 sectors)- Marauder Ultimate: 128 bytes (1024 sectors)
* Invalid bitmap length is: 0xFF
-
toStringDetailled
String toStringDetailled()
-
-
-
-