I plan to bring the mongoose library to the PIC32 platform and specifically to the Harmony TCP/IP stack. I want to summarize what i plan to do and where i need some support.
Microchip provides a software framework called Harmony where they do have a TCP/IP stack which contains a BSD like socket API. Additionally they do have a filesystem where they provide some level of POSIX compatibility.
For the sake of simplicity i will do the filesystem support at a later stage and concentrate on the TCP/IP stack first.
My first approach would be to define the
MG_LOCALS which includes a
mg_locals.h file where i can include libraries and define enabling/disabling flags and provide entrypoints to the custom code parts. Also i do set
#define CS_PLATFORM 0. In a later stage this would likely go into the
mongoose.c/h files by defining a
MG_PIC32 symbol and using preprocessor commands.
The follwing contents are placed in the
#include <sys/time.h> #include <sys/fcntl.h> #include <sys/errno.h> #include <time.h> #include <stdio.h>
The docs on the Harmony TCP/IP BSD API state that all calls to the API are non-blocking. There are a few undefined symbols and functions which i think have a close relation and are missing because of the non-blocking behaviour:
#define SO_ERROR // Select is used to effectively poll the sockets, but as we have a low number maybe no using it is not too bad select() // fcntl is only used once to make a socket non-blocking: fcntl(sock, F_SETFL, flags | O_NONBLOCK); fcntl()
How would one approach this? I think the task would be to exclude all calls to these functions and just assume that all calls are non blocking. Any thoughts on this?
Other missing functions
I need to see what to do with this function, i do not know yet if it is only a convenience function or if it is necessary to work:
The following functions should not be to hard: