yakir12 / COBS.jl
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
test/runtests.jl has changed.

@@ -58,12 +58,7 @@
Loading
58 58
    return i2, i2 + msg[i2]
59 59
end
60 60
61 -
"""
62 -
    decode(payload)
63 -
64 -
Return the decoded `payload`.
65 -
"""
66 -
function decode(msg)
61 +
#=function decode(msg)
67 62
    y = Vector{UInt8}(undef, length(msg) - 2)
68 63
    i1 = 0x01
69 64
    i2 = i1 + msg[i1]
@@ -73,8 +68,57 @@
Loading
73 68
        i1, i2 = _f!(y, msg, i1, i2)
74 69
    end
75 70
    return y
71 +
end=#
72 +
73 +
"""
74 +
    decode(msg)
75 +
76 +
Return the decoded `msg`.
77 +
"""
78 +
function decode(_msg::AbstractVector)
79 +
    msg = copy(_msg)
80 +
    pl = UInt8[]
81 +
    n = popfirst!(msg)
82 +
    c = 0
83 +
    b = popfirst!(msg)
84 +
    while b ≠ 0
85 +
        c += 1
86 +
        if c < n
87 +
            push!(pl, b)
88 +
        else
89 +
            push!(pl, 0)
90 +
            n = b
91 +
            c = 0
92 +
        end
93 +
        b = popfirst!(msg)
94 +
    end
95 +
    return pl
76 96
end
77 97
78 98
99 +
"""
100 +
    decode(sp)
101 +
102 +
Decode a message directly from a specified serial port, `sp`. 
103 +
"""
104 +
function decode(sp)
105 +
    pl = UInt8[]
106 +
    n = read(sp, UInt8)
107 +
    c = 0
108 +
    b = read(sp, UInt8)
109 +
    while b ≠ 0
110 +
        c += 1
111 +
        if c < n
112 +
            push!(pl, b)
113 +
        else
114 +
            push!(pl, 0)
115 +
            n = b
116 +
            c = 0
117 +
        end
118 +
        b = read(sp, UInt8)
119 +
    end
120 +
    return pl
121 +
end
122 +
79 123
80 124
end # module
Files Coverage
src/COBS.jl 93.18%
Project Totals (1 files) 93.18%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading