Re: plc4j in osgi env

2020-08-26 Thread Łukasz Dywicki
In case if you're looking for working 0.6 build take a look this part of our project: https://github.com/ConnectorIO/connectorio-addons/tree/master/features/plc4x This was indented to be moved back to plc4x but eventually other contributors did osgification before I could. While below feature set

Re: [DISCUSS] Possible changes to discriminator field handling

2020-08-26 Thread Christofer Dutz
I don't really think so ... I also think there are mspec discriminated types without any discriminator field ... If this doesn't work, that's a bug that should be fixed. And I just found an example ... in the S7 mspec the type of parameter also decides the type of payload (1-to-1 match) [dis

Re: [DISCUSS] Possible changes to discriminator field handling

2020-08-26 Thread Łukasz Dywicki
Yes it works cause the error and function bits are declared as discriminators. Try making response bit first in type switch. Then its gonna fail. This is because you need to explicitly declare a first discriminator field. It is not a big deal, however when we have header and payload parts one is ra

Re: Protocol encapsulation

2020-08-26 Thread Łukasz Dywicki
Hey folks, replies inline. Am 26.08.20, 04:38 schrieb "Otto Fowler" : > > I would rather have multiple, clean drivers than one that is so > complicated myself. > Maybe if there was a way to structure the mspec’s such that you could > re-use or re-combine them ( ie have multiple m

Re: [DISCUSS] Possible changes to discriminator field handling

2020-08-26 Thread Christofer Dutz
Here the part in the modbus.mspec I was talking about: [discriminatedType 'ModbusPDU' [bit 'response'] [discriminator bit 'error'] [discriminator uint 7 'function'] [typeSwitch 'error','function','response' ['true' ModbusPDUError [si

Re: [DISCUSS] Possible changes to discriminator field handling

2020-08-26 Thread Christofer Dutz
Hi Lukasz, It would be pretty simple to extend the code generation to make the virtual fields available in the parser ... I just didn't do it as I then didn't see the need. Should be extremely simple to implement. (Sort of just a copy+paste of the pojo template) You can use type-arguments in t

Re: Protocol encapsulation

2020-08-26 Thread Christofer Dutz
I think this fits well into the problem I was having with ADS. Right now the ADS driver will only support TCP, even if most of the stuff is in place for serial. The reason is that in order to use the serial transport a different base-type and transport-level-logic is needed than for TCP. What