Skip to content

Commit a22cf7e

Browse files
author
hutorny
committed
v1.2
1 parent dadf4b9 commit a22cf7e

File tree

6 files changed

+187
-9
lines changed

6 files changed

+187
-9
lines changed

changelog.v.1.2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## µcuREST change log v.1.2
2+
3+
`FIX` build error for Photon Particle example<br>
4+
`ADD` README for Photon Particle examples<br>
5+
`ADD` Download script for Photon Particle examples<br>
6+

examples/photon_demo/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Building Photon examples
2+
3+
Obtain Particle SDK
4+
5+
`git clone https://github.com/kbowerma/particle`
6+
7+
Obtain and install a gcc-arm compiler (4.9 or higher)
8+
from [`ARM`](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
9+
or from [`launchpad.net`](https://launchpad.net/gcc-arm-embedded)
10+
(tested with 4.9 and 5.4)
11+
12+
Make sure new arm gcc is in the path<br>
13+
`export PATH=<path-to>/gcc-arm-none-eabi-4_9/bin:$PATH`
14+
15+
Change directory to Particle's SDK
16+
17+
`cd <path-to>/particle`
18+
19+
Place library sources and examples in the SKD's tree
20+
21+
* from prepackaged zip:<br>
22+
`wget https://github.com/hutorny/download/raw/master/Micurest_Particle.zip`<br>
23+
`unzip Micurest_Particle.zip`
24+
* from git repository (requires svn!):<br>
25+
`wget https://raw.githubusercontent.com/hutorny/micurest/master/examples/photon_rest/micurest4particle.mk`<br>
26+
`make -f micurest4particle.mk`
27+
28+
Build photon core<br>
29+
`make PLATFORM=photon`
30+
31+
Build the example application<br>
32+
`make PLATFORM=photon APP=micurest_snip CPPFLAGS="-std=gnu++14 -Os"`
33+
34+
or demo application<br>
35+
`make PLATFORM=photon APP=micurest_demo CPPFLAGS="-std=gnu++14 -Os"`
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
SRC = \
2+
LICENSE \
3+
access_log.ccs \
4+
access_log.hpp \
5+
ccs.hpp \
6+
chartypetable.cpp \
7+
chartypetable.inc \
8+
coap.hpp \
9+
cojson.ccs \
10+
cojson.cpp \
11+
cojson_float.hpp \
12+
cojson_helpers.hpp \
13+
cojson.hpp \
14+
cojson_libdep.cpp \
15+
configuration.h \
16+
enumnames.hpp \
17+
http_01.hpp \
18+
miculog.ccs \
19+
miculog.hpp \
20+
miculog_spark_usart_hal.ccs \
21+
miculog_spark_usart_hal.cpp \
22+
micurest.ccs \
23+
micurest.cpp \
24+
micurest.hpp \
25+
micurpc.cpp \
26+
micurpc.hpp \
27+
network.hpp \
28+
network_spark_socket.ccs \
29+
network_spark_socket.cpp \
30+
network_spark_socket.hpp \
31+
32+
TRUNK = https://github.com/hutorny/micurest/trunk
33+
TARGET_DIR = user/library/micurest/
34+
LIBFILES = $(addprefix $(TARGET_DIR),$(SRC))
35+
EXAMPLES = user/application/micurest_demo user/application/micurest_snip
36+
37+
all: $(LIBFILES) $(EXAMPLES)
38+
39+
$(TARGET_DIR):
40+
@mkdir -p $@
41+
42+
user/application/micurest_demo:
43+
@mkdir -p $@
44+
svn export --force -q $(TRUNK)/examples/photon_demo $@
45+
46+
user/application/micurest_snip:
47+
@mkdir -p $@
48+
svn export --force -q $(TRUNK)/examples/photon_rest $@
49+
50+
$(TARGET_DIR)LICENSE: | $(TARGET_DIR)
51+
svn export --force -q $(TRUNK)/$(notdir $@) $(TARGET_DIR)
52+
53+
$(TARGET_DIR)%: | $(TARGET_DIR)
54+
svn export --force -q $(TRUNK)/src/$(notdir $@) $(TARGET_DIR)

examples/photon_rest/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Building Photon examples
2+
3+
Obtain Particle SDK
4+
5+
`git clone https://github.com/kbowerma/particle`
6+
7+
Obtain and install a gcc-arm compiler (4.9 or higher)
8+
from [`ARM`](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
9+
or from [`launchpad.net`](https://launchpad.net/gcc-arm-embedded)
10+
(tested with 4.9 and 5.4)
11+
12+
Make sure new arm gcc is in the path<br>
13+
`export PATH=<path-to>/gcc-arm-none-eabi-4_9/bin:$PATH`
14+
15+
Change directory to Particle's SDK
16+
17+
`cd <path-to>/particle`
18+
19+
Place library sources and examples in the SKD's tree
20+
21+
* from prepackaged zip:<br>
22+
`wget https://github.com/hutorny/download/raw/master/Micurest_Particle.zip`<br>
23+
`unzip Micurest_Particle.zip`
24+
* from git repository (requires svn!):<br>
25+
`wget https://raw.githubusercontent.com/hutorny/micurest/master/examples/photon_rest/micurest4particle.mk`<br>
26+
`make -f micurest4particle.mk`
27+
28+
Build photon core<br>
29+
`make PLATFORM=photon`
30+
31+
Build the example application<br>
32+
`make PLATFORM=photon APP=micurest_snip CPPFLAGS="-std=gnu++14 -Os"`
33+
34+
or demo application<br>
35+
`make PLATFORM=photon APP=micurest_demo CPPFLAGS="-std=gnu++14 -Os"`
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
#pragma once
22
#include "micurest/micurest.ccs"
33
#include "micurest/miculog.ccs"
4-
#include "micurest/network_log.ccs"
4+
#include "micurest/access_log.ccs"
55
#include "micurest/network_spark_socket.ccs"
66
#include "micurest/miculog_spark_usart_hal.ccs"
77

88
namespace configuration {
99
namespace target { struct Photon; }
1010
struct Current : Is<target::Photon, build::Default> {};
11-
template<> struct Selector<micurest::network_spark_socket::tcp::tcp> : Current {};
11+
template<> struct Selector<micurest::network_spark_socket::tcp::server> : Current {};
1212
template<> struct Selector<micurest::network::access_log> : Current {};
1313
template<> struct Selector<miculog::details::default_appender> : Current {};
14-
15-
template<typename Build>
16-
struct Configuration<miculog::details::default_appender, target::Photon, Build> {
17-
static constexpr bool blocking = true;
18-
static constexpr short serial = 1;
19-
};
2014
}
2115

2216
namespace miculog {
2317
template<> struct ClassLogLevels<
24-
micurest::network_spark_socket::tcp::tcp,
18+
micurest::network_spark_socket::tcp::server,
2519
configuration::build::Default> :
2620
From<level::warn> {};
2721
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
SRC = \
2+
LICENSE \
3+
access_log.ccs \
4+
access_log.hpp \
5+
ccs.hpp \
6+
chartypetable.cpp \
7+
chartypetable.inc \
8+
coap.hpp \
9+
cojson.ccs \
10+
cojson.cpp \
11+
cojson_float.hpp \
12+
cojson_helpers.hpp \
13+
cojson.hpp \
14+
cojson_libdep.cpp \
15+
configuration.h \
16+
enumnames.hpp \
17+
http_01.hpp \
18+
miculog.ccs \
19+
miculog.hpp \
20+
miculog_spark_usart_hal.ccs \
21+
miculog_spark_usart_hal.cpp \
22+
micurest.ccs \
23+
micurest.cpp \
24+
micurest.hpp \
25+
micurpc.cpp \
26+
micurpc.hpp \
27+
network.hpp \
28+
network_spark_socket.ccs \
29+
network_spark_socket.cpp \
30+
network_spark_socket.hpp \
31+
32+
TRUNK = https://github.com/hutorny/micurest/trunk
33+
TARGET_DIR = user/library/micurest/
34+
LIBFILES = $(addprefix $(TARGET_DIR),$(SRC))
35+
EXAMPLES = user/application/micurest_demo user/application/micurest_snip
36+
37+
all: $(LIBFILES) $(EXAMPLES)
38+
39+
$(TARGET_DIR):
40+
@mkdir -p $@
41+
42+
user/application/micurest_demo:
43+
@mkdir -p $@
44+
svn export --force -q $(TRUNK)/examples/photon_demo $@
45+
46+
user/application/micurest_snip:
47+
@mkdir -p $@
48+
svn export --force -q $(TRUNK)/examples/photon_rest $@
49+
50+
$(TARGET_DIR)LICENSE: | $(TARGET_DIR)
51+
svn export --force -q $(TRUNK)/$(notdir $@) $(TARGET_DIR)
52+
53+
$(TARGET_DIR)%: | $(TARGET_DIR)
54+
svn export --force -q $(TRUNK)/src/$(notdir $@) $(TARGET_DIR)

0 commit comments

Comments
 (0)