# `Grizzly.FirmwareUpdateHandler`
[🔗](https://github.com/smartrent/grizzly/blob/v9.1.4/lib/grizzly/firmware_update_handler.ex#L1)

Behaviour for handling incoming commands during the firmware update process

When you initialize a firmware update process you can pass the `:handler` option
to the function which can either be the a `pid` (defaults to caller pid) or a
module that implements this behaviour.

The report this callback function will most want to handle is:

- `Grizzly.ZWave.Commands.FirmwareUpdateMDRequestReport` It indicates whether the firmware update was initiated successfully.
- `Grizzly.ZWave.Commands.FirmwareUpdateMDStatusReport` It is sent by the target device once the firmware update completes, successfully or in failure.

The callback might also want to be aware of:

- `Grizzly.ZWave.Commands.FirmwareUpdateMDGet` It is sent by the target device when it wants more firmware image fragments
- `Grizzly.ZWave.Commands.FirmwareMDReport` It might be sent by the target device during the upgrade to modify the maximum fragment size.
- `Grizzly.ZWave.Commands.FirmwareUpdateActivationReport` It is sent by the target device in response to an activation request and gives the activation status.

# `handle_command`

```elixir
@callback handle_command(
  Grizzly.ZWave.Command.t(),
  keyword()
) :: :ok
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
