ClearOne Writing StreamNet User Manual

Page 50

Advertising
background image

Writing StreamNet Device Drivers

C-4

All specifications subject to change without notification. All rights reserved. Copyright © 2007 NetStreams

Main +1 512.977-9393 / fax +1 512.977.9398 / Toll Free Technical Support +1 866-353-3496

3600 W. Parmer Lane, Suite 100; Austin, TX 78727 /

www.netstreams.com.

local

response = g_serial:read()

if

(response ~=

nil

)

then

if

(response:find(

"MAINACON"

))

then

getSubNode(

"1"

):setStatus(

"indicatorState"

,

"1"

)

getSubNode(

"2"

):setStatus(

"indicatorState"

,

"0"

)

elseif

(response:find(

"MAINACOFF"

))

then

getSubNode(

"1"

):setStatus(

"indicatorState"

,

"0"

)

getSubNode(

"2"

):setStatus(

"indicatorState"

,

"1"

)

end

if

(response:find(

"SWITCHEDON"

))

then

getSubNode(

"3"

):setStatus(

"indicatorState"

,

"1"

)

elseif

(response:find(

"SWITCHEDOFF"

))

then

getSubNode(

"3"

):setStatus(

"indicatorState"

,

"0"

)

end

if

(response:find(

"HICURRENTON"

))

then

getSubNode(

"4"

):setStatus(

"indicatorState"

,

"1"

)

elseif

(response:find(

"HICURRENTOFF"

))

then

getSubNode(

"4"

):setStatus(

"indicatorState"

,

"0"

)

end

end

-- check for responses again in a second

Advertising