BlueAndi / vscp-framework

Very Simple Control Protocol (VSCP) Level 1 Framework
Other
12 stars 8 forks source link

DM with Zone/Subzone=0xFF #33

Closed troky closed 4 years ago

troky commented 4 years ago

Documentation says that if event is for zone/subzone 0xFF it should apply for all zones/subzones.

Question is: should DM ignore VSCP_DM_FLAG_MATCH_ZONE/VSCP_DM_FLAG_MATCH_SUB_ZONE flags and accept event if zone/subzone is set to 0xFF or that should be done by user?

Something like: https://github.com/BlueAndi/vscp-framework/blob/c2227b9b23b08ddba517bef273aed5aec05ce859/vscp/vscp_dm.c#L410 to look like:

if (0 != (row.flags & VSCP_DM_FLAG_MATCH_ZONE) && (msg->data[zoneIndex] != 0xFF))

... and the same for subzone check.

BlueAndi commented 4 years ago

Thats a good point. I remember that years ago I stumbled over this too and checked the vscp-firmware and vscp sources, but there was no exception implemented for 0xFF. So I followed them.

The specification on the DM says:

The zone and use sub-zone bits can be activated to have a check on the zone/sub-zone information of an event. That is the zone/sub-zone of the machine must match the one of the event to trigger the DM row. Bits 0/1 are the ninth bit of the filter/mask not enable bits.

Anyway I think you are right. I will update the sources.