Metadata-Version: 2.1
Name: ucanlintools
Version: 0.0.5
Summary: Local Interconnect Network (LIN) support for python
Home-page: https://github.com/uCAN-LIN/LinUSBConverter
Author: ucan
Author-email: ucandevices@mail.com
License: MIT
Project-URL: Documentation, https://ucandevices.github.io/
Project-URL: Source Code, https://github.com/uCAN-LIN/LinUSBConverter/tree/master/python_lib
Description: # LIN Python lib
        
        Library is under development API will change
        
        ## Features
        
        - LIN frame transmission / reception
        - LDF signals encoding / decoding (only signal and frames currently working, schedule table parsing not implemented, max signal size is 1 byte)
        - Works on windows, linux, mac. Supported hardware , [uCAN LIN USB CONVERTER](https://ucandevices.github.io/ulc.html)
        
        ## Installation
        
        ```python
        pip install ucanlintools
        ```
        
        ## Example usage
        
        To load ldf
        
        ```python
        from ucanlintools.LDF_parser import parseLDF
        ldf = parseLDF("D:\\ldfe.ldf") 
        message = ldf.get_message_by_name('FRAME_A')
        print(message.signals)
        ```
        
        To decode/ encode frame
        
        ```python
        aaa = message.encode({'SIGNAL_A': 1})
        bbb = b'\x00\x00\x00\x00\x00\x00'
        message.decode(bbb)
        ```
        
        To setup LIN USB Converter
        
        ```python
        
        lin = ucanlintools.LUC('COM7')
        lin.set_frame_rx_handler(rx_any)
        lin.set_new_frame_rx_handler(rx_new_data)
        
        lin.openAsMaster()
        
        lin.addReceptionFrameToTable(52,8)
        lin.addReceptionFrameToTable(54,8)
        lin.enable()
        
        ```
        
        Example data reception handler
        
        ```python
        
        def rx_new_data(f):
                global message
                print (hex(f.id) + ": " +(f.data.hex()))
                if (message.id == f.id):
                        message.decode(f.data)
                        print(message.diff_str())
        ```
        
        ## For more info see
        
        https://ucandevices.github.io
Keywords: LIN,LDF,LUC,uCAN,parser
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
