function getHexString(buf)
    if (buf == nil) then 
        return 'nil' 
    end
    local rs = ''
    for byte=1, #buf, 16 do
        local chunk = buf:sub(byte, byte+15)
        --chunk:gsub('.', function (c) print(string.format('%02X ',string.byte(c))) end)
        chunk:gsub('.', function (c) rs = rs .. (string.format('%02X ',string.byte(c))) end)
        end
    return rs
end


-- This function print the representation of the returned data by can.reaFilters
function printFilters(filters)
    print('Status:' .. string.format('%s', filters["Status"]))
    print('Single_11:' .. string.format('%08X', filters["Single_11"]))
    print('Start_11:' .. string.format('%08X', filters["Start_11"]))
    print('End_11:' .. string.format('%08X', filters["End_11"]))
    print('Single_29:' .. string.format('%08X', filters["Single_29"]))
    print('Start_29:' .. string.format('%08X', filters["Start_29"]))
    print('End_29:' .. string.format('%08X', filters["End_29"]))
    --ui.sleep(3 * 1000)
end
