Class: XBee::Frames::ExplicitAddressingCommand
- Inherits:
-
AddressedFrame
- Object
- Frame
- IdentifiedFrame
- AddressedFrame
- XBee::Frames::ExplicitAddressingCommand
- Defined in:
- lib/xbee/frames/explicit_addressing_command.rb
Overview
This frame is similar to Transmit Request (0x10), but it also requires you to specify the application- layer addressing fields: endpoints, cluster ID, and profile ID.
This frame causes the device to send payload data as an RF packet to a specific destination, using specific source and destination endpoints, cluster ID, and profile ID.
-
For broadcast transmissions, set the 64-bit destination address to 0x000000000000FFFF . Address the coordinator by either setting the 64-bit address to all 0x00s and the 16-bit address to 0xFFFE, or setting the 64-bit address to the coordinator’s 64-bit address and the 16-bit address to 0x0000.
-
For all other transmissions, setting the 16-bit address to the correct 16-bit address helps improve performance when transmitting to multiple destinations. If you do not know a 16-bit address, set this field to 0xFFFE (unknown). If successful, the Transmit Status frame (0x8B) indicates the discovered 16-bit address.
You can set the broadcast radius from 0 up to NH to 0xFF. If set to 0, the value of NH specifies the broadcast radius (recommended). This parameter is only used for broadcast transmissions.
You can read the maximum number of payload bytes with the NP command.
Constant Summary collapse
- OPTIONS =
{ 0x01 => :disable_retries, 0x08 => :multicast_addressing, 0x20 => :enable_aps_encryption, 0x40 => :extended_transmission_timeout, }.freeze
Instance Attribute Summary collapse
-
#broadcast_radius ⇒ Object
Returns the value of attribute broadcast_radius.
-
#cluster_id ⇒ Object
2 bytes.
-
#data ⇒ Object
Returns the value of attribute data.
-
#destination_endpoint ⇒ Object
Returns the value of attribute destination_endpoint.
-
#profile_id ⇒ Object
2 bytes.
-
#source_endpoint ⇒ Object
Returns the value of attribute source_endpoint.
-
#transmission_options ⇒ Object
Returns the value of attribute transmission_options.
Attributes inherited from AddressedFrame
Attributes inherited from IdentifiedFrame
Attributes inherited from Frame
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(packet: nil) ⇒ ExplicitAddressingCommand
constructor
A new instance of ExplicitAddressingCommand.
Methods inherited from Frame
api_id, from_packet, #to_packet
Constructor Details
#initialize(packet: nil) ⇒ ExplicitAddressingCommand
Returns a new instance of ExplicitAddressingCommand.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 47 def initialize(packet: nil) super if @parse_bytes @source_endpoint = @parse_bytes.shift @destination_endpoint = @parse_bytes.shift @cluster_id = @parse_bytes.shift 2 @profile_id = @parse_bytes.shift 2 @broadcast_radius = @parse_bytes.shift @transmission_options = @parse_bytes.shift @data = @parse_bytes @parse_bytes = [] end end |
Instance Attribute Details
#broadcast_radius ⇒ Object
Returns the value of attribute broadcast_radius.
33 34 35 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 33 def broadcast_radius @broadcast_radius end |
#cluster_id ⇒ Object
2 bytes
31 32 33 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 31 def cluster_id @cluster_id end |
#data ⇒ Object
Returns the value of attribute data.
35 36 37 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 35 def data @data end |
#destination_endpoint ⇒ Object
Returns the value of attribute destination_endpoint.
30 31 32 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 30 def destination_endpoint @destination_endpoint end |
#profile_id ⇒ Object
2 bytes
32 33 34 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 32 def profile_id @profile_id end |
#source_endpoint ⇒ Object
Returns the value of attribute source_endpoint.
29 30 31 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 29 def source_endpoint @source_endpoint end |
#transmission_options ⇒ Object
Returns the value of attribute transmission_options.
34 35 36 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 34 def @transmission_options end |
Instance Method Details
#bytes ⇒ Object
63 64 65 |
# File 'lib/xbee/frames/explicit_addressing_command.rb', line 63 def bytes super + [ || 0x00] + (data || []) end |