Thanks for the reply.
Can I send all LUA debug Message to USB port If Yes HOW?
(I am using Uart1 for LUA shell,UART2 to connect to PLC - serial device)
so i can not see the debug messgaes.
please see bellow debug message that I recive when I connect and disconnect from bearer - I disconnect PLC from Uart2 temporary.
If I am not mistaking this is the bearer close funcation in oatlua
function BEARER:close()
if debug.getfenv(self).state == “IP_CONNECTED” then
internal.bearer_stop(self)
wait(self,“STOPPED”)
end
internal.bearer_close(self)
end
And It Wait for STOPPED signal And I think I recived DISCONNECTED signal.
Is It right ?
Thanks
connection : gprs_connect = wip.bearer_client('GPRS', gprs_config)
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca10c])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca00c])}
[LUAW] SIGNAL shell.line
[LUAW] Waking up: { [thread 0x180eb2bc] ([table 0x180ca28c])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] RUN [thread 0x180e021c]
[LUAW] WAIT emitters = { shell }, events = { interrupt, background, eof, line, done } )
[GPRS]: open: -> DISCONNECTED
[GPRS]: start: -> CONNECTING
[LUAW] WAIT emitters = { GPRS }, events = { IP_CONNECTED, CONN_FAILED } )
[GPRS]: GPRS EVENT SETUP OK (cid=1): GPRS activate
[GPRS]: GPRS EVENT ACTIVATE OK (cid=1): FCM open
[GPRS]: FCM subscribe: 3
[GPRS]: FCM EVENT FLOW OPENNED: -> CONNECTED
[LUAW] SIGNAL GPRS.IP_CONNECTED
[LUAW] Waking up: { [thread 0x180e021c] ([table 0x180ca0cc])}
[LUAW] SIGNAL [thread 0x180e021c].die
[LUAW] SIGNAL shell.done
[LUAW] Waking up: { [thread 0x180eb2bc] ([table 0x180ca32c])}
[LUAW] Waking up: { }
[LUAW] WAIT emitters = { shell }, events = { interrupt, background, eof, line, done } )
after : gprs_connect:close()
-------------------------------------------
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca08c])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca00c])}
[LUAW] SIGNAL shell.line
[LUAW] Waking up: { [thread 0x180eb2bc] ([table 0x180ca2cc])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] RUN [thread 0x180e979c]
[LUAW] WAIT emitters = { shell }, events = { interrupt, background, eof, line, done } )
[GPRS]: stop: FCM close -> DISCONNECTING
[GPRS]: FCM unsubscribe (2)
[LUAW] WAIT emitters = { [userdata 0x180c67ec] }, events = { STOPPED } )
[GPRS]: FCM EVENT FLOW CLOSED: GPRS deactivate
[LUAW] SIGNAL at.CGEV
[GPRS]: GPRS EVENT: 2 (cid=1)
[GPRS]: GPRS EVENT DEACTIVATE OK/KO (cid=1): -> DISCONNECTED
[LUAW] SIGNAL GPRS.STOPPED
then I Press ctrl+C
and make again close : gprs_connect:close()
---------------------------------------------------------------------
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca10c])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] SIGNAL [channel TCPCLIENT 0x180e8b9c ready].read
[LUAW] Waking up: { [thread 0x180eba1c] ([table 0x180ca00c])}
[LUAW] SIGNAL shell.line
[LUAW] Waking up: { [thread 0x180eb2bc] ([table 0x180ca28c])}
[LUAW] WAIT emitters = { [channel TCPCLIENT 0x180e8b9c ready] }, events = { read, peer_close, error } )
[LUAW] RUN [thread 0x180e85dc]
[LUAW] WAIT emitters = { shell }, events = { interrupt, background, eof, line, done } )
[GPRS]: close: -> CLOSED
[LUAW] SIGNAL [thread 0x180e85dc].die
[LUAW] SIGNAL shell.done
[LUAW] Waking up: { [thread 0x180eb2bc] ([table 0x180cadac])}
[LUAW] Waking up: { }
[LUAW] WAIT emitters = { shell }, events = { interrupt, background, eof, line, done } )
after the second close the GPRS bearer is free.
thanks