({{, (RefLink[DeviceStreams, paclet:ref/DeviceStreams])[device] 
gives a list of all open streams associated with a device.}, {, (RefLink[DeviceStreams, paclet:ref/DeviceStreams])[device,patt]
gives a list of streams whose names match the string pattern patt.}, {, (RefLink[DeviceStreams, paclet:ref/DeviceStreams])[device,{(Subscript[patt, 1]),(Subscript[patt, 2]),…}]
gives a list of streams whose names match any of the (Subscript[patt, i]).}})

OpenersNotesSection(Spacer1)Details

A device can be specified either by a (RefLink[DeviceObject, paclet:ref/DeviceObject]) or by a string representing a device class.

Streams are automatically opened when a device is opened and are closed when it is closed.

(RefLink[DeviceStreams, paclet:ref/DeviceStreams]) can return (RefLink[InputStream, paclet:ref/InputStream]) or (RefLink[OutputStream, paclet:ref/OutputStream]) objects.

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Open a demo device and list its open streams:

dev=DeviceOpen["StreamsDemo",{"in","out"}]

DeviceStreams[dev]

Look up streams by pattern:

DeviceStreams[dev,"in*"]

Look up streams by a list of patterns:

DeviceStreams[dev,{"i*","*t"}]

DeviceClose[dev]

Read a list of bytes from an input stream associated with a device:

dev=DeviceOpen["StreamsDemo","input string"];

str=DeviceStreams[dev]

ReadList[First[str]]

Close the device:

DeviceClose[dev]

OpenersExampleSection2(Spacer1)Properties & Relations  (1)

Input and output streams associated with a device are included in (RefLink[Streams, paclet:ref/Streams]):

dev=DeviceOpen["StreamsDemo",{"in","out"}];

SubsetQ[Streams[],DeviceStreams[dev]]

(RefLink[DeviceClose, paclet:ref/DeviceClose]) closes any streams to and from the device:

Streams[]

DeviceClose["StreamsDemo"]

Streams[]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DeviceOpen, paclet:ref/DeviceOpen])  ▪  (RefLink[DeviceClose, paclet:ref/DeviceClose])  ▪  (RefLink[DeviceRead, paclet:ref/DeviceRead])  ▪  (RefLink[DeviceWrite, paclet:ref/DeviceWrite])  ▪  (RefLink[DeviceReadBuffer, paclet:ref/DeviceReadBuffer])  ▪  (RefLink[DeviceWriteBuffer, paclet:ref/DeviceWriteBuffer])  ▪  (RefLink[DeviceExecuteAsynchronous, paclet:ref/DeviceExecuteAsynchronous])  ▪  (RefLink[Streams, paclet:ref/Streams])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Developing Device Drivers, paclet:tutorial/DevelopingDeviceDrivers])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Using Connected Devices, paclet:guide/UsingConnectedDevices])}, {▪(RefLinkPlain[Raspberry Pi, paclet:guide/RaspberryPi])}})}})