how to send/receive struct with mailbox

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Post Reply
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

how to send/receive struct with mailbox

Post by taufiqwidi »

hello,

how to send/receive struct with mailbox? i know this question have been asked before but it was like 3 years ago. i have follow this code in the forum that 3 years old (http://www.chibios.com/forum/viewtopic.php?t=3270). but the receiving thread doesnt receive correct data from struct (like it is not point to the right struct or memory pool). i get notifier C++ library made by someone in this forum (https://github.com/trsaunders/Chibios-Notifications) (but it was like 7 years old) and it seems not to work anymore. answers are very apperciated cause i cant get mailbox to work (receiving the message actually).

thank you,
taufiqwidi
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: how to send/receive struct with mailbox

Post by Giovanni »

Hi,

See "Object FIFOs" in OSLIB, it does that for you.

Giovanni
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

Re: how to send/receive struct with mailbox

Post by taufiqwidi »

Giovanni wrote:Hi,

See "Object FIFOs" in OSLIB, it does that for you.

Giovanni

hello,

thanks giovanni for your answer. am i use this object fifo with malibox? i cannot find any wikis about object fifo so far. (if i am not mistaken). and i have no clue about it.

thank you,
taufiqwidi
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: how to send/receive struct with mailbox

Post by Giovanni »

Object FIFO is a combo of a mailbox and a memory pool.

On the sender side:
1) You TAKE an object from the pool.
2) You SEND an object through the mailbox.

On the receiver side:
3) You RECEIVE an object from the mailbox.
4) You RETURN the object to the pool.

Giovanni
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

Re: how to send/receive struct with mailbox

Post by taufiqwidi »

okay i see. thanks Giovanni for your answer. i will try that.

taufiqwidi
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

Re: how to send/receive struct with mailbox

Post by taufiqwidi »

hello,
sorry Giovanni if i bothering you again and maybe this is the dumb question. is there any examples of "Object FIFO" usage? because i cant find any example..
thank you..
Post Reply