Table of Contents
stream_set_swap_bytes
Enables or disables swapping of bytes within data types.
stream_set_swap_bytes(stream, swap)
stream_set_swap_bytes(stream) % Turn on byte swapping.
Determines whether the functions that send and receive int16's, int32's, int64's, floats or doubles, or arrays of them, swap the bytes in the individual values. Byte swapping is only necessary when communicating between processors that use a different endianness.
For example, Intel processors are little endian (LSB first) while Motorola processors tend to be big endian (MSB first). By default, no byte swapping takes place. Whether byte swapping is necessary may be determined simply by sending 0x1234 as an int16 and seeing if it arrives as the same number or as 0x3421.
This operation is not valid on listening streams created using stream_listen.
stream
Stream handle returned by stream_connect or stream_accept.
swap
Set to true to swap bytes. Set to false to leave byte order as is. If this argument is not specified it defaults to true.
This function has no outputs.
stream_set_swap_bytes(stream, true); % Turn on byte swapping
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.