harald v0.1.1 Harald.ManufacturerData.Apple View Source
Serialization module for Apple.
iBeacon
Reference: https://en.wikipedia.org/wiki/IBeacon#Packet_Structure_Byte_Map
Link to this section Summary
Functions
iex> deserialize(<<2, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 2, 3>>)
{:ok, {"iBeacon", %{major: 1, minor: 2, tx_power: 3, uuid: 4}}}
Indicates iBeacon data
Length of the data following the length byte
iex> serialize({"iBeacon", %{major: 1, minor: 2, tx_power: 3, uuid: 4}})
{:ok, <<2, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 2, 3>>}
Link to this section Functions
Link to this function
deserialize(bin) View Source
iex> deserialize(<<2, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 2, 3>>)
{:ok, {"iBeacon", %{major: 1, minor: 2, tx_power: 3, uuid: 4}}}
Link to this function
ibeacon_identifier() View Source
Indicates iBeacon data.
Link to this function
ibeacon_length() View Source
Length of the data following the length byte.
Link to this function
serialize(arg1) View Source
iex> serialize({"iBeacon", %{major: 1, minor: 2, tx_power: 3, uuid: 4}})
{:ok, <<2, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 2, 3>>}
iex> serialize({"iBeacon", %{major: 1, minor: 2, tx_power: 3}})
:error
iex> serialize(:orange)
:error