VW_MAX_MESSAGE_LEN

38 views
Skip to first unread message

Fishboi

unread,
Apr 26, 2023, 11:24:35 AM4/26/23
to virtualwire
What specifically does this mean? I was looking at the lines of:  uint8_t buf[VW_MAX_MESSAGE_LEN];  
   uint8_t buflen = VW_MAX_MESSAGE_LEN;  and was wondering if someone can give a step by step explanation of what each part means. I want to adapt this for something else and want to know how, and if I can. Thank you!

James Hamilton

unread,
Apr 26, 2023, 11:40:36 AM4/26/23
to virtualwire
Those lines set up the buffer that will contain the message to be sent. The buffer is of length VW_MAX_MESSAGE_LEN, which is defined in the VirtualWire.h header (80 bytes). The first line creates the buffer as a byte array of the appropriate size, and the next line saves that size info a variable for future reference in the code.

If you want to change the max message size, you would have to edit the VirtualWire.h header and make sure the VirtualWire.cpp library gets recompiled.

Just to let you know, the VirtualWire library has been deprecated. You might look at the RadioHead library, which is the updated version of VirtualWire.

Cheers,

~James

Fishboi

unread,
Apr 26, 2023, 12:22:49 PM4/26/23
to virtualwire
Thank you so much!
Reply all
Reply to author
Forward
0 new messages