Skip to content

Commit

Permalink
feat(protocol/c-bus): added more types, fixed some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Feb 28, 2022
1 parent a29d692 commit 562f665
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
[simple byte address]
]
[type Alpha
[simple byte character]
]
[type NetworkRoute
[simple RouteType routeType ]
[array BridgeAddress additionalBridgeAddresses count 'routeType.additionalBridges']
Expand Down Expand Up @@ -94,7 +98,7 @@
]
[simple CALData calData ]
[optional Checksum checksum ] // TODO: checksum is optional but mspec checksum isn't
[optional byte alpha ]
[optional Alpha alpha ]
[const byte cr '0xD' ] // 0xD == "<cr>"
]
Expand All @@ -106,15 +110,15 @@
[reserved byte '0x00' ]
[simple StatusRequest statusRequest ]
[optional Checksum checksum ] // TODO: checksum is optional but mspec checksum isn't
[optional byte alpha ]
[optional Alpha alpha ]
[const byte cr '0xD' ] // 0xD == "<cr>"
]
['*' CBusPointToMultiPointCommandNormal
[simple Application application ]
[reserved byte '0x00' ]
[simple SALData salData ]
[optional Checksum checksum ] // TODO: checksum is optional but mspec checksum isn't
[optional byte alpha ]
[optional Alpha alpha ]
[const byte cr '0xD' ] // 0xD == "<cr>"
]
]
Expand All @@ -130,15 +134,15 @@
[reserved byte '0x00' ]
[simple StatusRequest statusRequest ]
[optional Checksum checksum ] // TODO: checksum is optional but mspec checksum isn't
[optional byte alpha ]
[optional Alpha alpha ]
[const byte cr '0xD' ] // 0xD == "<cr>"
]
['*' CBusCommandPointToPointToMultiPointNormal
[simple Application application ]
[reserved byte '0x00' ]
[simple SALData salData ]
[optional Checksum checksum ] // TODO: checksum is optional but mspec checksum isn't
[optional byte alpha ]
[optional Alpha alpha ]
[const byte cr '0xD' ] // 0xD == "<cr>"
]
]
Expand Down Expand Up @@ -217,7 +221,7 @@
[simple CALData calData]
[checksum checksum]
[const byte cr '0x0D' ] // 0xD == "<cr>"
[const byte cr '0x0A' ] // 0xA == "<lf>"
[const byte lf '0x0A' ] // 0xA == "<lf>"
]
[type BridgeCount
Expand Down Expand Up @@ -257,19 +261,34 @@
[optional SALData salData ]
[checksum checksum]
[const byte cr '0x0D' ] // 0xD == "<cr>"
[const byte cr '0x0A' ] // 0xA == "<lf>"
[const byte lf '0x0A' ] // 0xA == "<lf>"
]
[type Confirmation
// TODO: implement me
[simple Alpha alpha]
[dicriminator byte type]
[typeSwitch 'type'
['.' ConfirmationSuccessful]
['#' NotTransmittedToManyReTransmissions]
['$' NotTransmittedCorruption]
['%' NotTransmittedSyncLoss]
[''' NotTransmittedTooLong]
]
]
[type PowerUp
// TODO: implement me
// TODO: skip potential garbage as first reserved might be wrong
[const byte something1 '+']
[const byte something2 '+']
[const byte cr '0x0D' ] // 0xD == "<cr>"
[const byte lf '0x0A' ] // 0xA == "<lf>"
]
[type ParameterChange
// TODO: implement me
[const byte something1 '=']
[const byte something2 '=']
[const byte cr '0x0D' ] // 0xD == "<cr>"
[const byte lf '0x0A' ] // 0xA == "<lf>"
]

[type ExclamationMark
Expand Down

0 comments on commit 562f665

Please sign in to comment.