-- This file is generated by tools/json2lua.js

local enum = require('ffxiv_enum')
local ffxiv_ipc_ensemble_ready_send = Proto("ffxiv_ipc_ensemble_ready_send", "FFXIV-IPC Ensemble Ready Send")

local ensemble_ready_send_fields = {
  bpm                = ProtoField.uint16("ffxiv_ipc_ensemble_ready_send.bpm", "BPM", base.DEC),
  meter              = ProtoField.uint8("ffxiv_ipc_ensemble_ready_send.meter", "meter", base.DEC),
  ensemble_assistant = ProtoField.uint8("ffxiv_ipc_ensemble_ready_send.ensemble_assistant", "Ensemble Assistant", base.DEC, enum.reverse.ensemble_assistant),
}

ffxiv_ipc_ensemble_ready_send.fields = ensemble_ready_send_fields

function ffxiv_ipc_ensemble_ready_send.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_ensemble_ready_send, tvbuf)
  pktinfo.cols.info:set("Ensemble Ready Send")

  local len = tvbuf:len()

  -- dissect the bpm field
  local bpm_tvbr = tvbuf:range(6, 1)
  local bpm_val  = bpm_tvbr:le_uint()
  tree:add_le(ensemble_ready_send_fields.bpm, bpm_tvbr, bpm_val)

  -- dissect the meter field
  local meter_tvbr = tvbuf:range(7, 1)
  local meter_val  = meter_tvbr:le_uint()
  tree:add_le(ensemble_ready_send_fields.meter, meter_tvbr, meter_val)

  -- dissect the ensemble_assistant field
  local ensemble_assistant_tvbr = tvbuf:range(8, 1)
  local ensemble_assistant_val  = ensemble_assistant_tvbr:le_uint()
  tree:add_le(ensemble_ready_send_fields.ensemble_assistant, ensemble_assistant_tvbr, ensemble_assistant_val)

  return len
end