From: <can...@li...> - 2007-12-14 16:46:00
|
Hi Eduard, Here you have the first version of the LSS protocol. I made some tests with the virtual driver (i.e in a PC) and it seems to work well. I also used a connection between an embedded board running canfestival and a PIC microcontroler module running the MICROCHIP stack (with my own modifications) and it works too. I haven't got any commercial module so I can't test it with a “real product”. FastScan is not implemented yet because you told me to send the patch as fast as possible. To my knowledge it is the only service that doesn't work ( I hope this is true). In any case, there are other issues left too: * I added a new nmt state (LSSTimingDelay). It is a state were the node can't send any message. I thought that this was the best choice to do this. The only problem I saw was that the master could ask the nmt state to the node and receive an unknown one (LSSTimingDelay) but the slave is not going to answer the request in that state so there isn't going to be any conflict. * The services “Change baud rate” and “Store parameters” will raise the proper callback. I have done it in this way because these issues (changing the baud rate and storing the parameters in a non-volatile memory) may be application dependent. If a slave doesn't support the change baud rate service or the store parameters service the callback must be left blank. * There are only two API for the user: configNetworkNode and configNetworkNodeCallback. The former is for the services that doesn't generate a response. The later works very similar to writeNetworkDictCallBack. Perhaps they are very explicit and would be a better idea to made one function per service type (switch, inquire,..). * For the warnings and errors I used the D number. * I modified the TestMasterSlave example. I'm not sure if it is clear enough. * I also modified the configure script. To activate the LSS services use –enable-lss. * When the Activate bit timing parameters service is requested, it's the master's responsibility to wait the proper amount of time (i.e the two switch delay periods) because this service doesn't have a response. A solution for this problem could be to raise an internal timer and generate a fake response when the time expires as if a real response has been received. I also attach a can4linux driver. I made it for the embedded board and seems to work fine. Please, don't hesitate to telling me your impresion. Regards. Jorge |