Public Types | Public Member Functions | Private Attributes

# X10Packet Class Reference

Stores one X10 packet. More...

`#include <x10packet.h>`

Collaboration diagram for X10Packet:
[legend]

List of all members.

## Public Types
enum | X10Function { fcAllUnitsOff = 0, fcAllLightsOn = 1, fcAllLightsOff = 6, fcOn = 2, fcOff = 3, fcDim = 4, fcBright = 5, fcHailRequest = 8, fcHailAck = 9, fcPresetDim1 = 10, fcPresetDim2 = 11, fcExCode = 7, fcExData = 12, fcStatOn = 13, fcStatOff = 14, fcStatRequest = 15 }
## Public Member Functions
| X10Packet ()
| Constructor of X10Packet, an initialization of the object.
bool | setHousecode (quint8 housecode)
| Sets the housecode.
bool | setDevicecode (quint8 devicecode)
| Sets the devicecode.
bool | setFunction (X10Function function)
| Sets the command.
bool | setDimAmount (quint8 dim)
| Sets the number of dim steps.
quint8 | housecode ()
quint8 | dimAmount ()
QByteArray | frameData ()
| Generates the raw packet data.
quint8 | checksum ()
| Calculates a checksum of the packet.
## Private Attributes
quint8 | mDimAmount
bool | mFa
bool | mEs
quint8 | mHousecode
quint8 | mData
quint8 | mChecksum
bool | mModified

## Detailed Description

Stores one X10 packet.

Definition at line 37 of file x10packet.h.

## Member Enumeration Documentation

enum X10Packet::X10Function

Enumerator:

  fcAllUnitsOff |
  fcAllLightsOn |
  fcAllLightsOff |
  fcOn |
  fcOff |
  fcDim |
  fcBright |
  fcHailRequest |
  fcHailAck |
  fcPresetDim1 |
  fcPresetDim2 |
  fcExCode |
  fcExData |
  fcStatOn |
  fcStatOff |
  fcStatRequest |

Definition at line 40 of file x10packet.h.

## Constructor & Destructor Documentation

X10Packet::X10Packet | ( |  | ) |

Constructor of X10Packet, an initialization of the object.

Definition at line 27 of file x10packet.cpp.

References mChecksum, mData, mDimAmount, mEs, mFa, mHousecode, and mModified.

## Member Function Documentation

quint8 X10Packet::checksum | ( |  | ) |

Calculates a checksum of the packet.

Returns:
  Checksum of the packet

Definition at line 138 of file x10packet.cpp.

References frameData(), mChecksum, and mModified.

Here is the call graph for this function:

quint8 X10Packet::dimAmount | ( |  | ) | `[inline]`

Definition at line 59 of file x10packet.h.

References mDimAmount.

QByteArray X10Packet::frameData | ( |  | ) |

Generates the raw packet data.

Returns:
  Generated packet data

Definition at line 118 of file x10packet.cpp.

References mData, mDimAmount, mEs, mFa, and mHousecode.

Referenced by checksum().

Here is the caller graph for this function:

quint8 X10Packet::housecode | ( |  | ) | `[inline]`

Definition at line 58 of file x10packet.h.

References mHousecode.

bool X10Packet::setDevicecode | ( | quint8 | devicecode | ) |

Sets the devicecode.

Parameters:

  | devicecode | Devicecode

Returns:
  true if the devicecode has been set successfully

Definition at line 63 of file x10packet.cpp.

References mData, mEs, mFa, mModified, and x10enc.

bool X10Packet::setDimAmount | ( | quint8 | dim | ) |

Sets the number of dim steps.

Parameters:

  | dim | Number of dim steps

Returns:
  true if the number of dim steps has been set successfully

Definition at line 106 of file x10packet.cpp.

References mDimAmount, and mModified.

bool X10Packet::setFunction | ( | X10Function | function | ) |

Sets the command.

Parameters:

  | function | Command

Returns:
  true if the command has been set successfully

Definition at line 83 of file x10packet.cpp.

References fcAllLightsOff, fcAllLightsOn, fcAllUnitsOff, fcBright, fcDim, fcOff, fcOn, mData, mEs, mFa, and mModified.

bool X10Packet::setHousecode | ( | quint8 | housecode | ) |

Sets the housecode.

Parameters:

  | housecode | Housecode

Returns:
  true if the housecode has been set successfully

Definition at line 45 of file x10packet.cpp.

References mHousecode, mModified, and x10enc.

## Member Data Documentation

quint8 X10Packet::mChecksum`[private]`

Definition at line 69 of file x10packet.h.

Referenced by checksum(), and X10Packet().

quint8 X10Packet::mData`[private]`

Definition at line 68 of file x10packet.h.

Referenced by frameData(), setDevicecode(), setFunction(), and X10Packet().

quint8 X10Packet::mDimAmount`[private]`

Definition at line 65 of file x10packet.h.

Referenced by dimAmount(), frameData(), setDimAmount(), and X10Packet().

bool X10Packet::mEs`[private]`

Definition at line 66 of file x10packet.h.

Referenced by frameData(), setDevicecode(), setFunction(), and X10Packet().

bool X10Packet::mFa`[private]`

Definition at line 66 of file x10packet.h.

Referenced by frameData(), setDevicecode(), setFunction(), and X10Packet().

quint8 X10Packet::mHousecode`[private]`

Definition at line 67 of file x10packet.h.

Referenced by frameData(), housecode(), setHousecode(), and X10Packet().

bool X10Packet::mModified`[private]`

Definition at line 70 of file x10packet.h.

Referenced by checksum(), setDevicecode(), setDimAmount(), setFunction(), setHousecode(), and X10Packet().

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

- shx10/x10packet.h
- shx10/x10packet.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends