Comments (3)
That's a Zigbee Green Power (ZGP) raw data indication frame
CMD_GP_DATA_INDICATION = 0x19
The frame is formatted identical to the ZGP specification (just a raw copy).
If it is helpful here is the C++ code how it is processed:
Note: Often the same frame is received 3 times this needs to be filtered by the application.
bool GpDataIndication::readFromStream(QDataStream &stream)
{
Q_D(GpDataIndication);
if (stream.atEnd()) { return false; }
stream >> d->nwkFrameControl;
// check frame type
quint8 frameType = d->nwkFrameControl & 0x03;
if ((frameType != GP_NwkDataFrame) &&
(frameType != GP_NwkMaintenanceFrame))
{
return false;
}
// check green power protocol version
if (((d->nwkFrameControl >> 2)& 0x03) != GP_NwkProtocolVersion)
{
return false;
}
// extended frame control
if (d->nwkFrameControl & GP_NwkFrameControlExtensionFlag)
{
if (stream.atEnd()) { return false; }
stream >> d->nwkExtFrameControl.byte;
}
else
{
d->nwkExtFrameControl.byte = 0;
}
// check supported application IDs
switch (d->nwkExtFrameControl.bits.applicationId)
{
case 0: // 0b000 (GP)
case 2: // 0b010 (GP)
case 1: // 0b001 (LPED)
break;
default:
return false;
}
// GPD SrcID field
if ((frameType == GP_NwkDataFrame) && (d->nwkExtFrameControl.bits.applicationId == 0))
{
if (stream.atEnd()) { return false; }
stream >> d->gpdSrcId;
}
else if ((frameType == GP_NwkMaintenanceFrame) && (d->nwkFrameControl & GP_NwkFrameControlExtensionFlag) && (d->nwkExtFrameControl.bits.applicationId == 0))
{
if (stream.atEnd()) { return false; }
stream >> d->gpdSrcId;
}
else
{
d->gpdSrcId = 0; // unspecified
}
// frame counter filed
// The presence and length of the Security frame counter field is dependent on the value of ApplicationID
// and SecurityLevel (see A.1.4.1.3).
d->frameCounter = 0;
if (d->nwkFrameControl & GP_NwkFrameControlExtensionFlag)
{
switch (d->nwkExtFrameControl.bits.applicationId)
{
case 0: // 0b000 (GP)
case 2: // 0b010 (GP)
{
switch (d->nwkExtFrameControl.bits.securityLevel)
{
case 0: // 0b00 No security
case 1: // 0b01 1LSB of frame counter and short (2B) MIC only
break;
case 2: // 0b10 Full (4B) frame counter and full (4B) MIC only
case 3: // 0b11 Encryption & full (4B) frame counter and full (4B) MIC
{
if (stream.atEnd()) { return false; }
stream >> d->frameCounter;
}
break;
default:
break;
}
}
break;
case 1: // 0b001 (LPED)
break;
default:
break;
}
}
d->gpdCommandPayload.clear();
switch (d->nwkExtFrameControl.bits.applicationId)
{
case 0: // 0b000 (GP)
case 2: // 0b010 (GP)
{
if (stream.atEnd()) { return false; }
stream >> d->gpdCommandId;
quint8 byte;
while (!stream.atEnd())
{
stream >> byte;
d->gpdCommandPayload.append(byte);
}
}
break;
default:
d->gpdCommandId = 0;
break;
}
return true;
}
from deconz-serial-protocol.
Thanks a lot Manuel. I really appreciate your work! I've been using the serial protocol for a couple of years and it has been working great for me. Time for me to read up on the ZGP specification that I've mostly managed to avoid so far! :-)
Do you want to keep the issue open? In case you want to update the documentation I mean.
from deconz-serial-protocol.
Yes lets keep it open until this is completed in the docs.
from deconz-serial-protocol.
Related Issues (20)
- No response from the conbee 2 HOT 3
- Frame counter not being set by both deCONZ and directly with serial protocol HOT 3
- How to enable the Conbee ZigBee Controller to enable joining as a controller. HOT 5
- Serial port settings for RaspBee.. HOT 2
- CRC calculation for Metadata (command 0x0D) is incorrect. HOT 1
- No reception of data HOT 5
- [SUGGESTION] Team up with "Zigbee for Domoticz" developers who is developing a zigpy based plugin for Domoticz HOT 41
- network_key read and write takes extra byte
- Reconfig as a repeater HOT 5
- Does deCONZ serial protocol for ConBee/RaspBee Zigbee Coordinator adapters not support joining/pairing via install code and qr code? HOT 33
- Query send data response incorrect frame length in docs
- Endpoint count limitation still 2? HOT 3
- Conbee2 to router (z2m) ? HOT 1
- [REQUEST] Energy detection scan with documented API in deconz serial protocol
- Receiving commands from Sunricher Zigbee directly with ConBee II HOT 4
- Unknown Command ID 0x1F HOT 2
- Fix/Add: device reset command HOT 1
- Conbee II not detected after host reboot
- DeviceState reports 0xA6, but what does the highest bit mean ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deconz-serial-protocol.