X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoders%2Fmodbus%2Fpd.py;h=81aaf2a3117d18719b0d5649113d61cc70bad6bb;hb=79f5cbcfe332be55fb08d31618c086ee9282eb3d;hp=cc4272168c28f4a60d633c1554f4340cb1d9071c;hpb=dcf1b50dfe8c66f7a5579856d86e328e02ff986d;p=libsigrokdecode.git diff --git a/decoders/modbus/pd.py b/decoders/modbus/pd.py index cc42721..81aaf2a 100644 --- a/decoders/modbus/pd.py +++ b/decoders/modbus/pd.py @@ -822,26 +822,26 @@ class Decoder(srd.Decoder): outputs = ['modbus'] tags = ['Embedded/industrial'] annotations = ( - ('sc-server-id', ''), - ('sc-function', ''), - ('sc-crc', ''), - ('sc-address', ''), - ('sc-data', ''), - ('sc-length', ''), - ('sc-error', ''), - ('cs-server-id', ''), - ('cs-function', ''), - ('cs-crc', ''), - ('cs-address', ''), - ('cs-data', ''), - ('cs-length', ''), - ('cs-error', ''), - ('error-indication', ''), + ('sc-server-id', 'SC server ID'), + ('sc-function', 'SC function'), + ('sc-crc', 'SC CRC'), + ('sc-address', 'SC address'), + ('sc-data', 'SC data'), + ('sc-length', 'SC length'), + ('sc-error', 'SC error'), + ('cs-server-id', 'CS server ID'), + ('cs-function', 'CS function'), + ('cs-crc', 'CS CRC'), + ('cs-address', 'CS address'), + ('cs-data', 'CS data'), + ('cs-length', 'CS length'), + ('cs-error', 'CS error'), + ('error-indication', 'Error indication'), ) annotation_rows = ( ('sc', 'Server->client', (0, 1, 2, 3, 4, 5, 6)), ('cs', 'Client->server', (7, 8, 9, 10, 11, 12, 13)), - ('error-indicator', 'Errors in frame', (14,)), + ('error-indicators', 'Errors in frame', (14,)), ) options = ( {'id': 'scchannel', 'desc': 'Server -> client channel', @@ -929,6 +929,10 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): ptype, rxtx, pdata = data + # Ignore unknown/unsupported ptypes. + if ptype not in ('STARTBIT', 'DATA', 'STOPBIT'): + return + # Decide what ADU(s) we need this packet to go to. # Note that it's possible to go to both ADUs. if rxtx_channels[rxtx] == self.options['scchannel']: