Coder Social home page Coder Social logo

majerle / lwpkt Goto Github PK

View Code? Open in Web Editor NEW
113.0 8.0 23.0 279 KB

Lightweight packet protocol structure for multi-device communication focused on RS-485

Home Page: https://majerle.eu/projects/lwpkt-lightweight-packet-protocol-manager

License: MIT License

C 83.41% CMake 3.49% Python 13.10%
packet protocol simple rs-485 devices multi-slaves master command data length

lwpkt's People

Contributors

dependabot[bot] avatar majerle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lwpkt's Issues

Multi-processor communication

Hi, your packet manager has good approach. Just the problem is start 0xAA and end 0x55 bytes. These start and end are not optional when compiling while other features are option.
The problem is that when it is intend to use from "lwpkt" in the multi-processor communication that support 9th bit of data Address byte, (something like ATMEGA chip of serial port) this address (destination) will help processor hardware to check input frame in multi-drop serial networks.
So it is recommended to do option the start and end bytes and also reverse the position of FROM with TO byte (right now FROM is first byte and TO in next in current packet structure) For use from "lwpkt" in the multi-processor communication the first byte of packet should be TO field.
What is your idea about this feature?

top-level CMakeLists.txt, project not buildable

The cmake variable "PROJECT_IS_TOP_LEVEL" is used in top-level CMakeLists.txt , which is available since cmake version 3.21 according to cmake.org, although the version 3.0.0 is required by the Project.

Possible missing preprocessor #if macro

I'm compiling the library, with cmd disabled, so in lwpkt_opts: #define LWPKT_CFG_USE_CMD 0.
When compiling, I get an error on line 611 of lwpkt.c, there is an "undeclared, first use in this functions" kind of error, it is referring to cmd, used inside the second if of the two about command, is a #if LWPKT_CFG_USE_CMD necessary for those two ifs?

STM32 based LwPKT Example

Hi Majrele,

I am planning to construct Multi Device Communication over UART (RS485) protocol. I found LwPKT interesting project to use it.
But i am unable to figure out the usage with STM32 UART Interrupt based function. Could you able to give some hints regarding it.

/* Start DMA /
if(HAL_UART_Receive_DMA(&huart2, (uint8_t
)pkt_tx_rb_data, 64) != HAL_OK)
{
Error_Handler();
}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
res = lwpkt_write(&pkt,

	#if LWPKT_CFG_USE_ADDR
						0x11,                       /* End address to whom to send */
	#endif /* LWPKT_CFG_USE_ADDR */

	#if LWPKT_CFG_USE_CMD
						0x85,                       /* Command type */
	#endif /* LWPKT_CFG_USE_CMD */
						data, strlen(data));        /* Length of data and actual data */

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.