mbserver 0.5.0
mbserver Namespace Reference

Classes

class  _MemoryBlock
class  _MemoryBlockBits
class  _MemoryBlockRegs
class  _MbDevice

Functions

bytearray swapbyteorder (bytearray data)

Detailed Description

@package docstring
Documentation for this module.

More details.

Function Documentation

◆ swapbyteorder()

bytearray mbserver.swapbyteorder ( bytearray data)
Swap adjacent bytes in a bytearray.

Swaps pairs (0↔1, 2↔3, 4↔5, ...) and leaves the last
byte unchanged if the length is odd.

Args:
    data  Bytearray to modify in place.

Returns:
    Same `bytearray` object with bytes swapped.

Note:
    Since v0.4.2