
-- Try get rsm serials, otherwise use our own counter for testing.
local ok = pcall(require, 'luamods.rsm_serials')

local serials = {}

if ok then
    -- Use the RSM serial generator.
    serials.generate_new_serial = function ()
        return rsm_serials.generateNewSerial()
    end
else
    -- Create a testing serial generator.
    local serial = 0x00

    serials.generate_new_serial = function ()
        serial = serial + 1
        return '0x' .. string.format("%08x", serial)
    end
end

return serials
