BayEOS-PHP
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
_XBeeFrameBase Class Reference
Inheritance diagram for _XBeeFrameBase:
XBeeFrame XBeeResponse

Public Member Functions

 setFrame ($frame)
 
 getFrame ()
 
 setFrameId ($frameId)
 
 getFrameId ()
 
 setApiId ($apiId)
 
 getApiId ()
 
 setCmdData ($cmdData)
 
 getCmdData ()
 
 setStartByte ($startByte)
 
 getStartByte ()
 
 setAddress16 ($address16)
 
 getAddress16 ()
 
 setAddress64 ($address64)
 
 getAddress64 ()
 
 setOptions ($options)
 
 getOptions ()
 
 setCmd ($cmd)
 
 getCmd ()
 
 setValue ($val)
 
 getValue ()
 

Data Fields

const DEFAULT_START_BYTE = 0x7e
 
const DEFAULT_FRAME_ID = 0x01
 
const REMOTE_API_ID = 0x17
 
const LOCAL_API_ID = 0x08
 
const QUEUED_API_ID = 0x09
 
const TX_API_ID = 0x10
 
const TX_EXPLICIT_API_ID = 0x11
 
 $frameId
 
 $apiId
 
 $cmdData
 
 $startByte
 
 $address16
 
 $address64
 
 $options
 
 $cmd
 
 $val
 

Protected Member Functions

 _XBeeFrameBase ()
 
 _assembleFrame ()
 
 _calcChecksum ($data)
 
 _getFramelength ($data)
 
 _hexstr ($hex)
 
 _strhex ($str)
 
 _packBytes ($data)
 
 _unpackBytes ($data)
 

Protected Attributes

 $frame
 

Detailed Description

Definition at line 11 of file XBeeFrame.php.

Member Function Documentation

_assembleFrame ( )
protected

Assembles frame after all values are set

Returns
void

Definition at line 33 of file XBeeFrame.php.

_calcChecksum (   $data)
protected

Calculates checksum for cmdData. Leave off start byte, length and checksum

Parameters
String$dataShould be a binary string
Returns
String $checksum Should be a binary string

Definition at line 49 of file XBeeFrame.php.

_getFramelength (   $data)
protected

Calculates lenth for cmdData. Leave off start byte, length and checksum

Parameters
String$dataShould be a binary string
Returns
String $length Should be a binary string

Definition at line 66 of file XBeeFrame.php.

_hexstr (   $hex)
protected

Transforms hex into a string

Parameters
String$hex
Returns
String $string Should be a binary string

Definition at line 79 of file XBeeFrame.php.

_packBytes (   $data)
protected

Packs a string into binary for sending

Parameters
String$data
Returns
String $data Should be a binary string

Definition at line 107 of file XBeeFrame.php.

_strhex (   $str)
protected

Transforms string into hex

Parameters
String$strShould be a binary string
Returns
String $hex Sould be a hex string

Definition at line 93 of file XBeeFrame.php.

_unpackBytes (   $data)
protected

Unpacks bytes into an array

Parameters
String$dataShould be a binary string
Returns
Array $data

Definition at line 117 of file XBeeFrame.php.

_XBeeFrameBase ( )
protected

Contructor for abstract class XbeeFrameBase.

Definition at line 23 of file XBeeFrame.php.

getAddress16 ( )

Gets the 16 bit address

Returns
String $address16

Definition at line 228 of file XBeeFrame.php.

getAddress64 ( )

Gets the 64 bit address

Parameters
String$address64

Definition at line 246 of file XBeeFrame.php.

getApiId ( )

Gets API ID

Returns
String $apiId

Definition at line 173 of file XBeeFrame.php.

getCmd ( )

Gets the command

Returns
String $cmd

Definition at line 282 of file XBeeFrame.php.

getCmdData ( )

Gets raw command data, without start byte etc

Returns
String $cmdData

Definition at line 192 of file XBeeFrame.php.

getFrame ( )

Gets raw frame data

Returns
String $FrameData

Definition at line 136 of file XBeeFrame.php.

getFrameId ( )

Gets frame ID according to XBee API

Returns
String $frameId

Definition at line 155 of file XBeeFrame.php.

getOptions ( )

Gets the options of the frame

Returns
String $options

Definition at line 264 of file XBeeFrame.php.

getStartByte ( )

Gets Start Byte according to XBee API, default is 7E

Returns
String $startByte

Definition at line 210 of file XBeeFrame.php.

getValue ( )

Gets value of value

Returns
String $val

Definition at line 300 of file XBeeFrame.php.

setAddress16 (   $address16)

Sets the 16 bit address

Parameters
String$address16

Definition at line 219 of file XBeeFrame.php.

setAddress64 (   $address64)

Sets the 64 bit address

Parameters
String$address64

Definition at line 237 of file XBeeFrame.php.

setApiId (   $apiId)

Sets ApiId according to XBee API

Parameters
String$apiId

Definition at line 164 of file XBeeFrame.php.

setCmd (   $cmd)

Sets the command

Parameters
String$cmd

Definition at line 273 of file XBeeFrame.php.

setCmdData (   $cmdData)

Sets raw command data, without start byte etc

Parameters
String$cmdData
Returns
void

Definition at line 183 of file XBeeFrame.php.

setFrame (   $frame)

Sets raw frame, including start byte etc

Parameters
String$frame
Returns
void

Definition at line 127 of file XBeeFrame.php.

setFrameId (   $frameId)

Sets FrameId according to XBee API

Parameters
String$frameId
Returns
void

Definition at line 146 of file XBeeFrame.php.

setOptions (   $options)

Sets the options of the frame

Parameters
String$options

Definition at line 255 of file XBeeFrame.php.

setStartByte (   $startByte)

Sets Start Byte according to XBee API, defaults to 7E

Parameters
String$startByte

Definition at line 201 of file XBeeFrame.php.

setValue (   $val)

Sets the value of a packet

Parameters
String$val

Definition at line 291 of file XBeeFrame.php.

Field Documentation

$address16

Definition at line 16 of file XBeeFrame.php.

$address64

Definition at line 16 of file XBeeFrame.php.

$apiId

Definition at line 16 of file XBeeFrame.php.

$cmd

Definition at line 16 of file XBeeFrame.php.

$cmdData

Definition at line 16 of file XBeeFrame.php.

$frame
protected

Definition at line 16 of file XBeeFrame.php.

$frameId

Definition at line 16 of file XBeeFrame.php.

$options

Definition at line 16 of file XBeeFrame.php.

$startByte

Definition at line 16 of file XBeeFrame.php.

$val

Definition at line 16 of file XBeeFrame.php.

const DEFAULT_FRAME_ID = 0x01

Definition at line 12 of file XBeeFrame.php.

const DEFAULT_START_BYTE = 0x7e

Definition at line 12 of file XBeeFrame.php.

const LOCAL_API_ID = 0x08

Definition at line 13 of file XBeeFrame.php.

const QUEUED_API_ID = 0x09

Definition at line 14 of file XBeeFrame.php.

const REMOTE_API_ID = 0x17

Definition at line 13 of file XBeeFrame.php.

const TX_API_ID = 0x10

Definition at line 14 of file XBeeFrame.php.

const TX_EXPLICIT_API_ID = 0x11

Definition at line 14 of file XBeeFrame.php.


The documentation for this class was generated from the following file: