Class: XBee::Frame::ExplicitAddressingCommand
- Defined in:
- lib/ruxbee/frame/explicit_addressing_command.rb
Overview
Explicit Addressing ZigBee Command Frame (0x11)
This frame allows ZigBee Application Layer fields to be specified for a data transmission. This frame is similar to Zigbee Transmit Request (0x10) but requires the ZigBee application layer addressing fields to be set.
This frame is also used for triggering Programmable XBee (S2B) module Over-the-Air firmware upgrade process.
Instance Attribute Summary collapse
-
#broadcast_radius ⇒ Object
Returns the value of attribute broadcast_radius.
-
#cluster_id ⇒ Object
Returns the value of attribute cluster_id.
-
#destination_address ⇒ Object
Returns the value of attribute destination_address.
-
#destination_endpoint ⇒ Object
Returns the value of attribute destination_endpoint.
-
#destination_network ⇒ Object
Returns the value of attribute destination_network.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#payload_pack_string ⇒ Object
Returns the value of attribute payload_pack_string.
-
#profile_id ⇒ Object
Returns the value of attribute profile_id.
-
#source_endpoint ⇒ Object
Returns the value of attribute source_endpoint.
-
#transmit_options ⇒ Object
Returns the value of attribute transmit_options.
Attributes inherited from Base
Instance Method Summary collapse
- #api_identifier ⇒ Object
- #cmd_data ⇒ Object
- #cmd_data=(data_string) ⇒ Object
-
#initialize(frame_id = nil, destination_address = 0x000000000000ffff, destination_network = 0x0000fffe, source_endpoint = nil, destination_endpoint = nil, cluster_id = nil, profile_id = nil, broadcast_radius = 0x00, transmit_options = 0x00, payload = nil, payload_pack_string = "a*") ⇒ ExplicitAddressingCommand
constructor
A new instance of ExplicitAddressingCommand.
Methods inherited from Base
Constructor Details
#initialize(frame_id = nil, destination_address = 0x000000000000ffff, destination_network = 0x0000fffe, source_endpoint = nil, destination_endpoint = nil, cluster_id = nil, profile_id = nil, broadcast_radius = 0x00, transmit_options = 0x00, payload = nil, payload_pack_string = "a*") ⇒ ExplicitAddressingCommand
Returns a new instance of ExplicitAddressingCommand.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 18 def initialize(frame_id = nil, destination_address = 0x000000000000ffff, destination_network = 0x0000fffe, source_endpoint = nil, destination_endpoint = nil, cluster_id = nil, profile_id = nil, broadcast_radius = 0x00, = 0x00, payload = nil, payload_pack_string = "a*") self.frame_id = frame_id self.destination_address = destination_address self.destination_network = destination_network self.source_endpoint = source_endpoint self.destination_endpoint = destination_endpoint self.cluster_id = cluster_id self.profile_id = profile_id self.broadcast_radius = broadcast_radius self. = self.payload = payload self.payload_pack_string = payload_pack_string end |
Instance Attribute Details
#broadcast_radius ⇒ Object
Returns the value of attribute broadcast_radius.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def broadcast_radius @broadcast_radius end |
#cluster_id ⇒ Object
Returns the value of attribute cluster_id.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def cluster_id @cluster_id end |
#destination_address ⇒ Object
Returns the value of attribute destination_address.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def destination_address @destination_address end |
#destination_endpoint ⇒ Object
Returns the value of attribute destination_endpoint.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def destination_endpoint @destination_endpoint end |
#destination_network ⇒ Object
Returns the value of attribute destination_network.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def destination_network @destination_network end |
#payload ⇒ Object
Returns the value of attribute payload.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def payload @payload end |
#payload_pack_string ⇒ Object
Returns the value of attribute payload_pack_string.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def payload_pack_string @payload_pack_string end |
#profile_id ⇒ Object
Returns the value of attribute profile_id.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def profile_id @profile_id end |
#source_endpoint ⇒ Object
Returns the value of attribute source_endpoint.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def source_endpoint @source_endpoint end |
#transmit_options ⇒ Object
Returns the value of attribute transmit_options.
16 17 18 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 16 def @transmit_options end |
Instance Method Details
#api_identifier ⇒ Object
14 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 14 def api_identifier ; 0x11 ; end |
#cmd_data ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 39 def cmd_data # We need to pack the 64-bit destination_address in two 32-bit parts. dest_high = (self.destination_address >> 32) & 0xFFFFFFFF dest_low = self.destination_address & 0xFFFFFFFF if payload.nil? # By default we send a null-byte payload \0 [self.frame_id, dest_high, dest_low, self.destination_network, self.source_endpoint, self.destination_endpoint, self.cluster_id, self.profile_id, self.broadcast_radius, self., self.payload].pack("CNNnCCnnCCx") else [self.frame_id, dest_high, dest_low, self.destination_network, self.source_endpoint, self.destination_endpoint, self.cluster_id, self.profile_id, self.broadcast_radius, self., self.payload].pack("CNNnCCnnCC#{payload_pack_string}") end end |
#cmd_data=(data_string) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/ruxbee/frame/explicit_addressing_command.rb', line 32 def cmd_data=(data_string) # We need to read in the 64-bit destination_address in two 32-bit parts. dest_high = dest_low = 0 self.frame_id, dest_high, dest_low, self.destination_network, self.source_endpoint, self.destination_endpoint, self.cluster_id, self.profile_id, self.broadcast_radius, self., self.payload = data_string.unpack("CNNnCCnnCC#{payload_pack_string}") self.destination_address = dest_high << 32 | dest_low end |