how to send/receive struct with mailbox

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

how to send/receive struct with mailbox

Postby taufiqwidi » Tue Jul 16, 2019 8:00 am

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: how to send/receive struct with mailbox

Postby Giovanni » Tue Jul 16, 2019 8:15 am

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

Postby taufiqwidi » Tue Jul 16, 2019 11:15 am

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: how to send/receive struct with mailbox

Postby Giovanni » Tue Jul 16, 2019 12:25 pm

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

Postby taufiqwidi » Tue Jul 16, 2019 12:45 pm

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

Postby taufiqwidi » Wed Jul 17, 2019 7:08 am

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..


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 16 guests