Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
5ebff5d1
Commit
5ebff5d1
authored
Dec 09, 2016
by
Dmitry Frank
Committed by
Cesanta Bot
Dec 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename pic32_harmony -> pic32
PUBLISHED_FROM=00ca7b2adabde94a683ac4d33be1f2bdbb17772f
parent
731512a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
67 deletions
+64
-67
mongoose.c
mongoose.c
+53
-56
mongoose.h
mongoose.h
+11
-11
No files found.
mongoose.c
View file @
5ebff5d1
...
@@ -9306,7 +9306,7 @@ void mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
...
@@ -9306,7 +9306,7 @@ void mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
if (inet_ntop(sa->sa.sa_family, addr, start, capacity) == NULL) {
if (inet_ntop(sa->sa.sa_family, addr, start, capacity) == NULL) {
*buf = '\0';
*buf = '\0';
}
}
#elif defined(_WIN32) || MG_LWIP || (MG_NET_IF == MG_NET_IF_PIC32
_HARMONY
)
#elif defined(_WIN32) || MG_LWIP || (MG_NET_IF == MG_NET_IF_PIC32)
/* Only Windoze Vista (and newer) have inet_ntop() */
/* Only Windoze Vista (and newer) have inet_ntop() */
strncpy(buf, inet_ntoa(sa->sin.sin_addr), len);
strncpy(buf, inet_ntoa(sa->sin.sin_addr), len);
#else
#else
...
@@ -14706,15 +14706,15 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) {
...
@@ -14706,15 +14706,15 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) {
#endif
#endif
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line 1 "common/platforms/pic32
_harmony/pic32_harmony
_net_if.h"
#line 1 "common/platforms/pic32
/pic32
_net_if.h"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
* All rights reserved
*/
*/
#ifndef CS_COMMON_PLATFORMS_PIC32_
HARMONY_
NET_IF_H_
#ifndef CS_COMMON_PLATFORMS_PIC32_NET_IF_H_
#define CS_COMMON_PLATFORMS_PIC32_
HARMONY_
NET_IF_H_
#define CS_COMMON_PLATFORMS_PIC32_NET_IF_H_
/* Amalgamated: #include "mongoose/src/net_if.h" */
/* Amalgamated: #include "mongoose/src/net_if.h" */
...
@@ -14722,55 +14722,55 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) {
...
@@ -14722,55 +14722,55 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) {
extern "C" {
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#ifndef MG_ENABLE_NET_IF_PIC32
_HARMONY
#ifndef MG_ENABLE_NET_IF_PIC32
#define MG_ENABLE_NET_IF_PIC32
_HARMONY MG_NET_IF == MG_NET_IF_PIC32_HARMONY
#define MG_ENABLE_NET_IF_PIC32
MG_NET_IF == MG_NET_IF_PIC32
#endif
#endif
extern
struct
mg_iface_vtable
mg_pic32_
harmony_
iface_vtable
;
extern struct mg_iface_vtable mg_pic32_iface_vtable;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif
/* CS_COMMON_PLATFORMS_PIC32_
HARMONY_
NET_IF_H_ */
#endif /* CS_COMMON_PLATFORMS_PIC32_NET_IF_H_ */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line 1 "common/platforms/pic32
_harmony/pic32_harmony
_net_if.c"
#line 1 "common/platforms/pic32
/pic32
_net_if.c"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
* All rights reserved
*/
*/
#if MG_ENABLE_NET_IF_PIC32
_HARMONY
#if MG_ENABLE_NET_IF_PIC32
int
mg_pic32_
harmony_
if_create_conn
(
struct
mg_connection
*
nc
)
{
int mg_pic32_if_create_conn(struct mg_connection *nc) {
(void) nc;
(void) nc;
return 1;
return 1;
}
}
void
mg_pic32_
harmony_
if_recved
(
struct
mg_connection
*
nc
,
size_t
len
)
{
void mg_pic32_if_recved(struct mg_connection *nc, size_t len) {
(void) nc;
(void) nc;
(void) len;
(void) len;
}
}
void
mg_pic32_
harmony_
if_add_conn
(
struct
mg_connection
*
nc
)
{
void mg_pic32_if_add_conn(struct mg_connection *nc) {
(void) nc;
(void) nc;
}
}
void
mg_pic32_
harmony_
if_init
(
struct
mg_iface
*
iface
)
{
void mg_pic32_if_init(struct mg_iface *iface) {
(void) iface;
(void) iface;
(void) mg_get_errno(); /* Shutup compiler */
(void) mg_get_errno(); /* Shutup compiler */
}
}
void
mg_pic32_
harmony_
if_free
(
struct
mg_iface
*
iface
)
{
void mg_pic32_if_free(struct mg_iface *iface) {
(void) iface;
(void) iface;
}
}
void
mg_pic32_
harmony_
if_remove_conn
(
struct
mg_connection
*
nc
)
{
void mg_pic32_if_remove_conn(struct mg_connection *nc) {
(void) nc;
(void) nc;
}
}
void
mg_pic32_
harmony_
if_destroy_conn
(
struct
mg_connection
*
nc
)
{
void mg_pic32_if_destroy_conn(struct mg_connection *nc) {
if (nc->sock == INVALID_SOCKET) return;
if (nc->sock == INVALID_SOCKET) return;
/* For UDP, only close outgoing sockets or listeners. */
/* For UDP, only close outgoing sockets or listeners. */
if (!(nc->flags & MG_F_UDP)) {
if (!(nc->flags & MG_F_UDP)) {
...
@@ -14784,8 +14784,7 @@ void mg_pic32_harmony_if_destroy_conn(struct mg_connection *nc) {
...
@@ -14784,8 +14784,7 @@ void mg_pic32_harmony_if_destroy_conn(struct mg_connection *nc) {
nc->sock = INVALID_SOCKET;
nc->sock = INVALID_SOCKET;
}
}
int
mg_pic32_harmony_if_listen_udp
(
struct
mg_connection
*
nc
,
int mg_pic32_if_listen_udp(struct mg_connection *nc, union socket_address *sa) {
union
socket_address
*
sa
)
{
nc->sock = TCPIP_UDP_ServerOpen(
nc->sock = TCPIP_UDP_ServerOpen(
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
: IP_ADDRESS_TYPE_IPV6,
: IP_ADDRESS_TYPE_IPV6,
...
@@ -14797,18 +14796,17 @@ int mg_pic32_harmony_if_listen_udp(struct mg_connection *nc,
...
@@ -14797,18 +14796,17 @@ int mg_pic32_harmony_if_listen_udp(struct mg_connection *nc,
return 0;
return 0;
}
}
void
mg_pic32_
harmony_
if_udp_send
(
struct
mg_connection
*
nc
,
const
void
*
buf
,
void mg_pic32_if_udp_send(struct mg_connection *nc, const void *buf,
size_t
len
)
{
size_t len) {
mbuf_append(&nc->send_mbuf, buf, len);
mbuf_append(&nc->send_mbuf, buf, len);
}
}
void
mg_pic32_
harmony_
if_tcp_send
(
struct
mg_connection
*
nc
,
const
void
*
buf
,
void mg_pic32_if_tcp_send(struct mg_connection *nc, const void *buf,
size_t
len
)
{
size_t len) {
mbuf_append(&nc->send_mbuf, buf, len);
mbuf_append(&nc->send_mbuf, buf, len);
}
}
int
mg_pic32_harmony_if_listen_tcp
(
struct
mg_connection
*
nc
,
int mg_pic32_if_listen_tcp(struct mg_connection *nc, union socket_address *sa) {
union
socket_address
*
sa
)
{
nc->sock = TCPIP_TCP_ServerOpen(
nc->sock = TCPIP_TCP_ServerOpen(
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
: IP_ADDRESS_TYPE_IPV6,
: IP_ADDRESS_TYPE_IPV6,
...
@@ -14850,7 +14848,7 @@ static int mg_accept_conn(struct mg_connection *lc) {
...
@@ -14850,7 +14848,7 @@ static int mg_accept_conn(struct mg_connection *lc) {
mg_if_accept_tcp_cb(nc, (union socket_address *) &sa, sizeof(sa));
mg_if_accept_tcp_cb(nc, (union socket_address *) &sa, sizeof(sa));
return
mg_pic32_
harmony_
if_listen_tcp
(
lc
,
&
lc
->
sa
)
>=
0
;
return mg_pic32_if_listen_tcp(lc, &lc->sa) >= 0;
}
}
char *inet_ntoa(struct in_addr in) {
char *inet_ntoa(struct in_addr in) {
...
@@ -14940,7 +14938,7 @@ static void mg_handle_recv(struct mg_connection *nc) {
...
@@ -14940,7 +14938,7 @@ static void mg_handle_recv(struct mg_connection *nc) {
}
}
}
}
time_t
mg_pic32_
harmony_
if_poll
(
struct
mg_iface
*
iface
,
int
timeout_ms
)
{
time_t mg_pic32_if_poll(struct mg_iface *iface, int timeout_ms) {
struct mg_mgr *mgr = iface->mgr;
struct mg_mgr *mgr = iface->mgr;
double now = mg_time();
double now = mg_time();
struct mg_connection *nc, *tmp;
struct mg_connection *nc, *tmp;
...
@@ -14982,17 +14980,17 @@ time_t mg_pic32_harmony_if_poll(struct mg_iface *iface, int timeout_ms) {
...
@@ -14982,17 +14980,17 @@ time_t mg_pic32_harmony_if_poll(struct mg_iface *iface, int timeout_ms) {
return now;
return now;
}
}
void
mg_pic32_
harmony_
if_sock_set
(
struct
mg_connection
*
nc
,
sock_t
sock
)
{
void mg_pic32_if_sock_set(struct mg_connection *nc, sock_t sock) {
nc->sock = sock;
nc->sock = sock;
}
}
void
mg_pic32_
harmony_
if_get_conn_addr
(
struct
mg_connection
*
nc
,
int
remote
,
void mg_pic32_if_get_conn_addr(struct mg_connection *nc, int remote,
union
socket_address
*
sa
)
{
union socket_address *sa) {
/* TODO(alaskin): not implemented yet */
/* TODO(alaskin): not implemented yet */
}
}
void
mg_pic32_
harmony_
if_connect_tcp
(
struct
mg_connection
*
nc
,
void mg_pic32_if_connect_tcp(struct mg_connection *nc,
const
union
socket_address
*
sa
)
{
const union socket_address *sa) {
nc->sock = TCPIP_TCP_ClientOpen(
nc->sock = TCPIP_TCP_ClientOpen(
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
sa->sin.sin_family == AF_INET ? IP_ADDRESS_TYPE_IPV4
: IP_ADDRESS_TYPE_IPV6,
: IP_ADDRESS_TYPE_IPV6,
...
@@ -15000,37 +14998,36 @@ void mg_pic32_harmony_if_connect_tcp(struct mg_connection *nc,
...
@@ -15000,37 +14998,36 @@ void mg_pic32_harmony_if_connect_tcp(struct mg_connection *nc,
nc->err = (nc->sock == INVALID_SOCKET) ? -1 : 0;
nc->err = (nc->sock == INVALID_SOCKET) ? -1 : 0;
}
}
void
mg_pic32_
harmony_
if_connect_udp
(
struct
mg_connection
*
nc
)
{
void mg_pic32_if_connect_udp(struct mg_connection *nc) {
nc->sock = TCPIP_UDP_ClientOpen(IP_ADDRESS_TYPE_ANY, 0, NULL);
nc->sock = TCPIP_UDP_ClientOpen(IP_ADDRESS_TYPE_ANY, 0, NULL);
nc->err = (nc->sock == INVALID_SOCKET) ? -1 : 0;
nc->err = (nc->sock == INVALID_SOCKET) ? -1 : 0;
}
}
/* clang-format off */
/* clang-format off */
#define MG_PIC32_
HARMONY_
IFACE_VTABLE \
#define MG_PIC32_IFACE_VTABLE \
{
\
{ \
mg_pic32_
harmony_
if_init, \
mg_pic32_if_init, \
mg_pic32_
harmony_
if_free, \
mg_pic32_if_free, \
mg_pic32_
harmony_
if_add_conn, \
mg_pic32_if_add_conn, \
mg_pic32_
harmony_
if_remove_conn, \
mg_pic32_if_remove_conn, \
mg_pic32_
harmony_
if_poll, \
mg_pic32_if_poll, \
mg_pic32_
harmony_
if_listen_tcp, \
mg_pic32_if_listen_tcp, \
mg_pic32_
harmony_
if_listen_udp, \
mg_pic32_if_listen_udp, \
mg_pic32_
harmony_
if_connect_tcp, \
mg_pic32_if_connect_tcp, \
mg_pic32_
harmony_
if_connect_udp, \
mg_pic32_if_connect_udp, \
mg_pic32_
harmony_
if_tcp_send, \
mg_pic32_if_tcp_send, \
mg_pic32_
harmony_
if_udp_send, \
mg_pic32_if_udp_send, \
mg_pic32_
harmony_
if_recved, \
mg_pic32_if_recved, \
mg_pic32_
harmony_
if_create_conn, \
mg_pic32_if_create_conn, \
mg_pic32_
harmony_
if_destroy_conn, \
mg_pic32_if_destroy_conn, \
mg_pic32_
harmony_
if_sock_set, \
mg_pic32_if_sock_set, \
mg_pic32_
harmony_
if_get_conn_addr, \
mg_pic32_if_get_conn_addr, \
}
}
/* clang-format on */
/* clang-format on */
struct
mg_iface_vtable
mg_pic32_harmony_iface_vtable
=
struct mg_iface_vtable mg_pic32_iface_vtable = MG_PIC32_IFACE_VTABLE;
MG_PIC32_HARMONY_IFACE_VTABLE
;
#if MG_NET_IF == MG_NET_IF_PIC32
#if MG_NET_IF == MG_NET_IF_PIC32_HARMONY
struct mg_iface_vtable mg_default_iface_vtable = MG_PIC32_IFACE_VTABLE;
struct
mg_iface_vtable
mg_default_iface_vtable
=
MG_PIC32_HARMONY_IFACE_VTABLE
;
#endif
#endif
#endif
/* MG_ENABLE_NET_IF_PIC32
_HARMONY
*/
#endif /* MG_ENABLE_NET_IF_PIC32 */
mongoose.h
View file @
5ebff5d1
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#define CS_P_NXP_KINETIS 9
#define CS_P_NXP_KINETIS 9
#define CS_P_NRF51 12
#define CS_P_NRF51 12
#define CS_P_NRF52 10
#define CS_P_NRF52 10
#define CS_P_PIC32
_HARMONY
11
#define CS_P_PIC32 11
/* Next id: 15 */
/* Next id: 15 */
/* If not specified explicitly, we guess platform by defines. */
/* If not specified explicitly, we guess platform by defines. */
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
#elif defined(FRDM_K64F) || defined(FREEDOM)
#elif defined(FRDM_K64F) || defined(FREEDOM)
#define CS_PLATFORM CS_P_NXP_KINETIS
#define CS_PLATFORM CS_P_NXP_KINETIS
#elif defined(PIC32)
#elif defined(PIC32)
#define CS_PLATFORM CS_P_PIC32
_HARMONY
#define CS_PLATFORM CS_P_PIC32
#elif defined(ICACHE_FLASH)
#elif defined(ICACHE_FLASH)
#define CS_PLATFORM CS_P_ESP8266
#define CS_PLATFORM CS_P_ESP8266
#elif defined(TARGET_IS_TM4C129_RA0) || defined(TARGET_IS_TM4C129_RA1) || \
#elif defined(TARGET_IS_TM4C129_RA0) || defined(TARGET_IS_TM4C129_RA1) || \
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
#define MG_NET_IF_SOCKET 1
#define MG_NET_IF_SOCKET 1
#define MG_NET_IF_SIMPLELINK 2
#define MG_NET_IF_SIMPLELINK 2
#define MG_NET_IF_LWIP_LOW_LEVEL 3
#define MG_NET_IF_LWIP_LOW_LEVEL 3
#define MG_NET_IF_PIC32
_HARMONY
4
#define MG_NET_IF_PIC32 4
#define MG_SSL_IF_OPENSSL 1
#define MG_SSL_IF_OPENSSL 1
#define MG_SSL_IF_MBEDTLS 2
#define MG_SSL_IF_MBEDTLS 2
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
/* Amalgamated: #include "common/platforms/platform_wince.h" */
/* Amalgamated: #include "common/platforms/platform_wince.h" */
/* Amalgamated: #include "common/platforms/platform_nxp_lpc.h" */
/* Amalgamated: #include "common/platforms/platform_nxp_lpc.h" */
/* Amalgamated: #include "common/platforms/platform_nxp_kinetis.h" */
/* Amalgamated: #include "common/platforms/platform_nxp_kinetis.h" */
/* Amalgamated: #include "common/platforms/platform_pic32
_harmony
.h" */
/* Amalgamated: #include "common/platforms/platform_pic32.h" */
/* Common stuff */
/* Common stuff */
...
@@ -1424,19 +1424,19 @@ typedef struct stat cs_stat_t;
...
@@ -1424,19 +1424,19 @@ typedef struct stat cs_stat_t;
#endif
/* CS_PLATFORM == CS_P_NXP_KINETIS */
#endif
/* CS_PLATFORM == CS_P_NXP_KINETIS */
#endif
/* CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ */
#endif
/* CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_ */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line 1 "common/platforms/platform_pic32
_harmony
.h"
#line 1 "common/platforms/platform_pic32.h"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
* All rights reserved
*/
*/
#ifndef CS_COMMON_PLATFORMS_PLATFORM_PIC32_H
ARMONY_H
_
#ifndef CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_
#define CS_COMMON_PLATFORMS_PLATFORM_PIC32_H
ARMONY_H
_
#define CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_
#if CS_PLATFORM == CS_P_PIC32
_HARMONY
#if CS_PLATFORM == CS_P_PIC32
#define MG_NET_IF MG_NET_IF_PIC32
_HARMONY
#define MG_NET_IF MG_NET_IF_PIC32
#include <stdint.h>
#include <stdint.h>
#include <time.h>
#include <time.h>
...
@@ -1456,9 +1456,9 @@ typedef TCP_SOCKET sock_t;
...
@@ -1456,9 +1456,9 @@ typedef TCP_SOCKET sock_t;
char
*
inet_ntoa
(
struct
in_addr
in
);
char
*
inet_ntoa
(
struct
in_addr
in
);
#endif
/* CS_PLATFORM == CS_P_PIC32
_HARMONY
*/
#endif
/* CS_PLATFORM == CS_P_PIC32 */
#endif
/* CS_COMMON_PLATFORMS_PLATFORM_PIC32_H
ARMONY_H
_ */
#endif
/* CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_ */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line 1 "common/platforms/lwip/mg_lwip.h"
#line 1 "common/platforms/lwip/mg_lwip.h"
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment