# can_ascii

ASCII encapsulation of CAN messages

Author | William Welch Copyright © 2009, all rights reserved.
Adapted-by |
Compiler | 2.4m

Description

    ASCII-to-CAN and CAN-to-ASCII routines. The intent is to be compatible with
       the SLCAN API. These routines may be used, for example, to implement a RS232 to CAN adapter

Sources

    Socket-CAN, in particular the SLCAN API. http://developer.berlios.de/projects/socketcan/
             also, the LAWICEL CAN-USB adapter.

Dependencies

No dependency found

## Summary

### Global variables/contants

### Procedures

### Functions

- `can_to_ascii(dword in can_id, byte in can_data[8], byte in data_len, byte out ascii_buf[32]) return byte`
- `ascii_to_can(byte in ascii_buf[32], dword out can_id, byte out can_data[8], byte out data_len) return bit`

Private

- `_ascii2bin(byte in c) return byte`

## API details

### Global variables/contants

### Procedures

### Functions

- `can_to_ascii(dword in can_id, byte in can_data[8], byte in data_len, byte out ascii_buf[32]) return byte`

      convert CAN message to socket-CAN SLCAN API
      FIXME: poor method.

- `ascii_to_can(byte in ascii_buf[32], dword out can_id, byte out can_data[8], byte out data_len) return bit`

      convert ASCII message to CAN message, as per socket-CAN SLCAN API
      FIXME: poor method.

Private

- `_ascii2bin(byte in c) return byte`

  No documentation found

## Related samples

Here are the list of samples which use this library:

18f2585 | 18f2585_can_serial_adapter.jal
18f2585 | 18f2585_canid4_monitor.jal
18f2585 | 18f2585_can_serial_hw.jal
18f2585 | 18f2585_canid4_serial_adapter.jal
18f4585 | 18f4585_canid4_monitor.jal