Hello, I have an application written in c that I am attempting to run on my Arduino Rev 2's microproccessor. I have been cross-compiling using this buildroot (GitHub - arduino/lede-yun) and have successfully gotten most of my code running, however I seem to have an error when I attempt to utilize the mqueue library on the yun. Here is the example code.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <mqueue.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include "common.h"
int main(int argc, char **argv)
{
mqd_t mq;
struct mq_attr attr;
char buffer[MAX_SIZE + 1];
int must_stop = 0;
/* initialize the queue attributes */
attr.mq_flags = 0;
attr.mq_maxmsg = 10;
attr.mq_msgsize = MAX_SIZE;
attr.mq_curmsgs = 0;
/* create the message queue */
mq = mq_open(QUEUE_NAME, O_CREAT | O_RDONLY, 0644, &attr);
CHECK((mqd_t)-1 != mq);
do {
ssize_t bytes_read;
/* receive the message */
bytes_read = mq_receive(mq, buffer, MAX_SIZE, NULL);
CHECK(bytes_read >= 0);
buffer[bytes_read] = '\0';
if (! strncmp(buffer, MSG_STOP, strlen(MSG_STOP)))
{
must_stop = 1;
}
else
{
printf("Received: %s\n", buffer);
}
} while (!must_stop);
/* cleanup */
CHECK((mqd_t)-1 != mq_close(mq));
CHECK((mqd_t)-1 != mq_unlink(QUEUE_NAME));
return 0;
}
I can get it compiled just fine but once I scp it to the yun I get this error from mq_open()
main:33: (mqd_t)-1 != mq: Function not implemented
Is there a way to configure or patch this? I am concerned with getting a totally new image on the yun since I want to utilize the integrated serial connection between the Yun's AVR chip and the microprocessor so I can send data from the AVR side to the microprocessor OpenWrt is on.
Thanks in advance for any assistance.
I have also made an issue on the openwrt fork's github linked here Error using POSIX mqueue on Arduino Yun Rev 2 LEDEyun 17.11 · Issue #9 · arduino/lede-yun · GitHub