Skip to content

Commit

Permalink
Add ReadWhiteListSize HCI command
Browse files Browse the repository at this point in the history
  • Loading branch information
trarbr authored and jjcarstens committed Aug 9, 2021
1 parent 9dd64a4 commit 78943ba
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions lib/blue_heron/hci/commands/le_controller/read_white_list_size.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
defmodule BlueHeron.HCI.Command.LEController.ReadWhiteListSize do
use BlueHeron.HCI.Command.LEController, ocf: 0x000F

defparameters []

defimpl BlueHeron.HCI.Serializable do
def serialize(%{opcode: opcode}) do
<<opcode::binary, 0x00>>
end
end

@impl BlueHeron.HCI.Command
def deserialize(<<@opcode::binary, 0x00>>) do
new()
end

@impl BlueHeron.HCI.Command
def deserialize_return_parameters(<<status, white_list_size>>) do
%{
status: status,
white_list_size: white_list_size
}
end

@impl BlueHeron.HCI.Command
def serialize_return_parameters(%{status: status, white_list_size: white_list_size}) do
<<BlueHeron.ErrorCode.to_code!(status), white_list_size>>
end
end
2 changes: 1 addition & 1 deletion lib/blue_heron/hci/transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule BlueHeron.HCI.Transport do
<<0x5B, 0x0C, 0x01, 0x01>>,
<<0x02, 0x20, 0x00>>,
<<0x6D, 0x0C, 0x02, 0x01, 0x00>>,
<<0x0F, 0x20, 0x00>>,
%LEController.ReadWhiteListSize{},
%LEController.SetScanParameters{
le_scan_type: 0x01,
le_scan_interval: 0x0030,
Expand Down

0 comments on commit 78943ba

Please sign in to comment.