API Reference v9.2.0

StreamBufferclass

Module: ZaberMotionAscii

Represents a stream buffer with this number on a device. A stream buffer is a place to store a queue of stream actions.

The following example illustrates how you can obtain an instance of this type:

import ZaberMotionAscii

let connection = try await Connection.openSerialPort(portName: "COM3")
let device = try connection.getDevice(deviceAddress: 1)
let streams = device.streams
let streamBuffer = try streams.getBuffer(streamBufferNumber: 1)
Related Guides:

Properties

p

bufferNumber

readonly
streamBuffer.bufferNumber
Int The number identifying the buffer on the device.
p

device

readonly
streamBuffer.device
Device The Device this buffer exists on.

Methods

m

erase()

asyncthrows
try await streamBuffer.erase()
Erase the contents of the buffer. This method fails if there is a stream writing to the buffer.
m

getContent()

asyncthrows
try await streamBuffer.getContent()
Get the buffer contents as an array of strings.
Return Value
[String] A string array containing all the stream commands stored in the buffer.