Skip to content

Instantly share code, notes, and snippets.

@adkron
Created May 9, 2017 22:13
Show Gist options
  • Save adkron/391adc12cd0fdc1d972ce9ce90fa9cbb to your computer and use it in GitHub Desktop.
Save adkron/391adc12cd0fdc1d972ce9ce90fa9cbb to your computer and use it in GitHub Desktop.
defmodule Zwave.Command.EnterInclusion.Pattern do
@moduledoc false
defmacro pattern do
quote do
<<0x00, 0x4A, 0xC1, 0x01>>
end
end
end
defmodule Zwave.Command.EnterInclusion do
alias __MODULE__
require Zwave.Command.EnterInclusion.Pattern, as: Pattern
import Pattern
@moduledoc """
This command may be called by a primary controller application to
invoke the inclusion of new nodes in a Z-Wave network.
The default mode is
> ADD_NODE_ANY |
> ADD_NODE_OPTION_NORMAL_POWER |
> ADD_NODE_OPTION_NETWORK_WIDE
"""
defstruct [type: 0x00, command: 0x4A, mode: 0xC1, function_id: 0x01]
defimpl Zwave.Command.Serializable do
def serialize(%EnterInclusion{type: type, command: command, mode: mode, function_id: function_id}) do
<<type, command, mode, function_id>>
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment