[fluksod] set msg.received.{l,u} to nil when equal to empty string

This commit is contained in:
Bart Van Der Meerssche 2011-01-25 10:09:55 +01:00
parent fc1f955b51
commit c2c2dd051b
1 changed files with 2 additions and 0 deletions

View File

@ -126,6 +126,8 @@ function rx(msg, cdev)
end
msg.received.l, msg.received.u = msg.received.raw:match('^l(%w*)%.?u(%w*)%.?$')
if msg.received.l == '' then msg.received.l = nil end
if msg.received.u == '' then msg.received.u = nil end
if msg.received.l then
msg.received.crc = msg.received.l:sub(-2, -1)