Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
08426e48
Commit
08426e48
authored
Jul 23, 2019
by
Terry Ellison
Committed by
Marcel Stör
Jun 09, 2020
Browse files
Rebased against current dev, tweaks for clean compile
parent
6d81dd6c
Changes
5
Show whitespace changes
Inline
Side-by-side
app/coap/endpoints.c
View file @
08426e48
...
...
@@ -162,8 +162,6 @@ end:
return
coap_make_response
(
scratch
,
outpkt
,
NULL
,
0
,
id_hi
,
id_lo
,
&
inpkt
->
tok
,
COAP_RSPCODE_NOT_FOUND
,
COAP_CONTENTTYPE_NONE
);
}
extern
int
lua_put_line
(
const
char
*
s
,
size_t
l
);
static
const
coap_endpoint_path_t
path_command
=
{
2
,
{
"v1"
,
"c"
}};
static
int
handle_post_command
(
const
coap_endpoint_t
*
ep
,
coap_rw_buffer_t
*
scratch
,
const
coap_packet_t
*
inpkt
,
coap_packet_t
*
outpkt
,
uint8_t
id_hi
,
uint8_t
id_lo
)
{
...
...
@@ -171,11 +169,11 @@ static int handle_post_command(const coap_endpoint_t *ep, coap_rw_buffer_t *scra
return
coap_make_response
(
scratch
,
outpkt
,
NULL
,
0
,
id_hi
,
id_lo
,
&
inpkt
->
tok
,
COAP_RSPCODE_BAD_REQUEST
,
COAP_CONTENTTYPE_TEXT_PLAIN
);
if
(
inpkt
->
payload
.
len
>
0
)
{
char
line
[
LUA_MAXINPUT
];
if
(
!
coap_buffer_to_string
(
line
,
LUA_MAXINPUT
,
&
inpkt
->
payload
)
&&
lua_put_line
(
line
,
strlen
(
line
)
))
{
NODE_DBG
(
"
\n
Result(if any):
\n
"
)
;
system_os_post
(
LUA_TASK_PRIO
,
LUA_PROCESS_LINE_SIG
,
0
);
char
line
[
LUA_MAXINPUT
+
1
];
if
(
!
coap_buffer_to_string
(
line
,
LUA_MAXINPUT
,
&
inpkt
->
payload
)
)
{
int
l
=
strlen
(
line
)
;
line
[
l
]
=
'\n'
;
lua_input_string
(
line
,
l
+
1
);
}
return
coap_make_response
(
scratch
,
outpkt
,
NULL
,
0
,
id_hi
,
id_lo
,
&
inpkt
->
tok
,
COAP_RSPCODE_CONTENT
,
COAP_CONTENTTYPE_TEXT_PLAIN
);
}
...
...
app/lua/lua.h
View file @
08426e48
...
...
@@ -277,7 +277,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
#define lua_isrotable(L,n) (lua_type(L, (n)) == LUA_TROTABLE)
#define lua_isanytable(L,n) (lua_istable(L,n) || lua_isrotable(L,n))
#define lua_islightuserdata(L,n) (lua_type(L, (n) == LUA_TLIGHTUSERDATA)
#define lua_islightuserdata(L,n) (lua_type(L, (n)
)
== LUA_TLIGHTUSERDATA)
#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
...
...
app/modules/http.c
View file @
08426e48
...
...
@@ -3,6 +3,7 @@
* vowstar@gmail.com
* 2015-12-29
*******************************************************************************/
#include <string.h>
#include <stdlib.h>
#include "module.h"
#include "lauxlib.h"
...
...
app/platform/u8x8_nodemcu_hal.c
View file @
08426e48
...
...
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include "platform.h"
#include "user_interface.h"
#define U8X8_USE_PINS
#define U8X8_WITH_USER_PTR
...
...
app/platform/ucg_nodemcu_hal.c
View file @
08426e48
...
...
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include "platform.h"
#include "user_interface.h"
#define USE_PIN_LIST
#include "ucg_nodemcu_hal.h"
...
...
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