Sample Header Ad - 728x90

Writing additional kernel layer on UART driver

0 votes
1 answer
203 views
I want to take leverage the existing kernel API/module to create packet layer abstraction for user space application to transfer "packets" via UART interface. So, the intention is a kernel module that does the following 1) Uses different module to read UART bytes (I'm not sure what I should use, I can see "usbserial" available, but not sure if it can be extended that way) 2) After reading a certain number of bytes do some calculation on in, like crc, type etc. And then transfers the packet to the user space program 3) User space program can use poll mechanism to get notified, and then read the entire packet. How can I build such a thing? I'm having trouble connecting the pieces, and google/chatgpt is not helping. Any example that does something similar would be awesome, thanks! edit: As a packet I'm referring to an internal data structure, nothing to do with any networking protocol, it's literally. struct comms_packet { uint8_t length; uint8_t type; uint8_t data[PACKET_DATA_LEN]; uint8_t crc; };
Asked by konradk (1 rep)
Nov 6, 2024, 09:01 PM
Last activity: Nov 7, 2024, 05:16 PM