Commit c324aa20 authored by Mattias Fält's avatar Mattias Fält

Exports

parent 769ee42b
export AnalogInput10V
export AnalogInput10V, AnalogOutput10V
mutable struct AnalogInput10V <: AbstractDevice
i::Int32
......
......@@ -30,19 +30,19 @@ end
function send(bbstream::BeagleBoneStream)
ncmds = length(bbstream.sendbuffer)
serialize(bbstream.stream, (true, ncmds, bbstream.sendbuffer))
serialize(bbstream.stream, (true, Int32(ncmds), bbstream.sendbuffer...))
empty!(bbstream.sendbuffer)
return
end
function read(comedistream::BeagleBoneStream)
ncmds = length(bbstream.readbuffer)
serialize(bbstream.stream, (false, ncmds, bbstream.sendbuffer))
serialize(bbstream.stream, (false, Int32(ncmds), bbstream.readbuffer...))
#TODO wait for answer
vals = nothing
empty!(bbstream.sendbuffer)
empty!(bbstream.readbuffer)
return vals
end
#
#
# function send(stream::BeagleBoneStream)
# cmds = Tuple[]
# for dev in stream.devices
......@@ -82,14 +82,13 @@ end
function send(bbstream::BeagleBoneStream, cmd)
allcmds = (true, Int32(1), cmd)
println("Sending single command: $allcmds")
serialize(stream, allcmds)
serialize(bbstream.stream, allcmds)
return
end
function read(bbstream::BeagleBoneStream, cmd)
cmd, stream = safe_getreadcommand(dev)
allcmds = (false, Int32(1), cmd)
println("Sending single command: $allcmds")
serialize(stream, allcmds)
serialize(bbstream.stream, allcmds)
#TODO get, wait for and return response
return
end
......
......@@ -34,3 +34,4 @@ include("BeagleBoneStream.jl")
#Include the device definitions
include("SysLED.jl")
include("10V.jl")
export LabStream
abstract type LabStream end
function close(stream::LabStream)
......
......@@ -3,7 +3,7 @@ export SysLED
mutable struct SysLED <: AbstractDevice
i::Int32
stream::LabStream
SysLED(i::Int32) = new(i, false, false)
SysLED(i::Int32) = new(i)
end
SysLED(i::Int64) = SysLED(convert(Int32, i))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment