Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from original #1

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
eec0255
Increasing the HTTP example
lixin7 Apr 8, 2018
2c275e8
Increasing the HTTP example
lixin7 Apr 8, 2018
59e3c5e
Increasing the HTTP example
lixin7 Apr 8, 2018
2b4336f
Increasing the HTTP example
lixin7 Apr 8, 2018
dec15a5
Increasing the HTTP example
lixin7 Apr 8, 2018
6ef6e39
Increasing the HTTP example
lixin7 Apr 8, 2018
225cb2b
Increasing the HTTP example
lixin7 Apr 8, 2018
302f779
Iot id and iot pwd position exchange.
lixin7 Apr 10, 2018
db85ffc
1
lixin7 May 3, 2018
0b29082
1
lixin7 May 3, 2018
8df0252
1
lixin7 May 3, 2018
42ef6b2
MQTT connection update.
lixin7 May 3, 2018
3b3f337
1
lixin7 May 3, 2018
d16c84e
MQTT connection update/2018-5-3
lixin7 May 3, 2018
9c5674a
Add icons and modify descriptions
lixin7 Jul 18, 2018
3be83a3
Add icons and modify descriptions
lixin7 Jul 18, 2018
2ba7af1
Add icons and modify descriptions
lixin7 Jul 18, 2018
95fabd1
Version update -v0.0.1
lixin7 Jul 19, 2018
ce81877
Version update -v0.0.1
lixin7 Jul 19, 2018
052c2da
Version update -v0.0.1
lixin7 Jul 19, 2018
96c45d0
Version update -v0.0.1
lixin7 Jul 20, 2018
db1974f
Version update -v0.0.1
lixin7 Jul 20, 2018
39ae737
Version update -v0.0.1
lixin7 Jul 20, 2018
a8489cd
Version update -v0.0.1
lixin7 Jul 20, 2018
d43e4fa
Version update -v0.0.1
lixin7 Jul 20, 2018
32120f1
Version update -v0.0.1
lixin7 Jul 20, 2018
a3a3da9
Version update -v0.0.1
lixin7 Jul 20, 2018
77a443d
Version update -v0.0.1
lixin7 Jul 20, 2018
1ed95ac
Version update -v0.0.1
lixin7 Jul 20, 2018
60e8b94
Version update -v0.0.1
lixin7 Jul 20, 2018
f839be7
Version update -v0.0.1
lixin7 Jul 20, 2018
e61a71a
Version update -v0.0.1
lixin7 Jul 20, 2018
e29b41a
Version update -v0.0.1
lixin7 Jul 20, 2018
a88fa9e
Version update -v0.0.1
lixin7 Jul 24, 2018
a5db301
Version update -v0.0.1
lixin7 Jul 26, 2018
fb9bcd7
Import from pxt-microbit
lixin7 Jul 27, 2018
5833abe
Version update -v0.0.1
lixin7 Jul 27, 2018
037462a
Modify the License
lixin7 Aug 23, 2018
4219a75
Add HTTP module V1.0
lixin7 Oct 22, 2018
8dae7d2
Add HTTP module V1.0
lixin7 Oct 22, 2018
06fa215
Add HTTP module V1.0
lixin7 Oct 23, 2018
2e9c995
Add HTTP module V1.0
lixin7 Oct 31, 2018
00b7d6f
Add HTTP module V1.0.0
lixin7 Oct 31, 2018
d51ee98
Add HTTP module V1.0.0
lixin7 Oct 31, 2018
1d890fa
bump release
onionstack Nov 2, 2018
4897280
1.0.1
onionstack Nov 2, 2018
9572c3d
test
onionstack Nov 8, 2018
75c1df2
test
onionstack Nov 8, 2018
6168d98
1.0.2
onionstack Nov 8, 2018
5b387eb
Optimized memory footprint
onionstack Nov 9, 2018
b2846aa
1.0.3
onionstack Nov 9, 2018
f2efbb6
old version
lixin7 Nov 15, 2018
4e0a494
old version
onionstack Nov 15, 2018
d4b7eb7
1.0.1
onionstack Nov 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Copyright (c) DFRobot Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
186 changes: 97 additions & 89 deletions Obloq.cpp
Original file line number Diff line number Diff line change
@@ -1,89 +1,97 @@
#include "pxt.h"
using namespace pxt;
namespace Obloq {

//%
int obloqgetRxBufferSize(){
return uBit.serial.getRxBufferSize();
}

//%
StringData* obloqreadString(int size){
int n = size;
if (n == 0) return ManagedString("").leakData();
return ManagedString(uBit.serial.read(n, MicroBitSerialMode::ASYNC)).leakData();
}

//%
void obloqSetTxBufferSize(int size){
if(size > 100) {
size = 100;
}
uBit.serial.setTxBufferSize(size);
}

//%
void obloqSetRxBufferSize(int size){
if(size > 100) {
size = 100;
}
uBit.serial.setRxBufferSize(size);
}

//%
int obloqRxBufferedSize(){
return uBit.serial.rxBufferedSize();
}

//%
void obloqEventAfter(int len){
uBit.serial.eventAfter(len, MicroBitSerialMode::ASYNC);
}

//%
void obloqEventOn(StringData* msg){
uBit.serial.eventOn(msg, MicroBitSerialMode::ASYNC);
}

//%
void obloqClearRxBuffer(){
uBit.serial.clearRxBuffer();
}

//%
void obloqClearTxBuffer(){
uBit.serial.clearTxBuffer();
}

//%
void forever_stubs(void *a) {
runAction0((Action)a);
}

//%
void obloqforevers(Action a) {
if (a != 0) {
incr(a);
create_fiber(forever_stubs, (void*)a);
}
}

//%
void obloqWriteString(StringData *text) {
if (!text) {
return;
}
uBit.serial.send(ManagedString(text));
}

//%
void obloqDisDisplay() {
uBit.display.disable();
}

//%
void obloqEnDisplay() {
uBit.display.enable();
}

}
#include "pxt.h"
using namespace pxt;
namespace Obloq {

//%
int obloqgetRxBufferSize(){
return uBit.serial.getRxBufferSize();
}

//%
StringData* obloqreadString(int size){
int n = size;
if (n == 0) return ManagedString("").leakData();
return ManagedString(uBit.serial.read(n, MicroBitSerialMode::ASYNC)).leakData();
}

//%
void obloqSetTxBufferSize(int size){
if(size > 100) {
size = 100;
}
uBit.serial.setTxBufferSize(size);
}

//%
void obloqSetRxBufferSize(int size){
if(size > 100) {
size = 100;
}
uBit.serial.setRxBufferSize(size);
}

//%
int obloqRxBufferedSize(){
return uBit.serial.rxBufferedSize();
}

//%
void obloqEventAfter(int len){
uBit.serial.eventAfter(len, MicroBitSerialMode::ASYNC);
}

//%
void obloqEventOn(StringData* msg){
uBit.serial.eventOn(msg, MicroBitSerialMode::ASYNC);
}

//%
void obloqClearRxBuffer(){
uBit.serial.clearRxBuffer();
}

//%
void obloqClearTxBuffer(){
uBit.serial.clearTxBuffer();
}

//%
void forever_stubs(void *a) {
runAction0((Action)a);
}

//%
void obloqforevers(Action a) {
if (a != 0) {
incr(a);
create_fiber(forever_stubs, (void*)a);
}
}

//%
void obloqWriteString(StringData *text) {
if (!text) {
return;
}
uBit.serial.send(ManagedString(text));
}

//%
void obloqDisDisplay() {
uBit.display.disable();
}

//%
void obloqEnDisplay() {
uBit.display.enable();
}

}

/*
"Obloq.Obloq_initHttp|block": "HTTP设置 | IP地址 %ip| 端口号 %port",
"Obloq.Obloq_httpGet|block": "HTTP(GET) | URL %url| 超时 %time",
"Obloq.Obloq_httpPost|block": "HTTP(POST) | URL %url| 内容 %content| 超时 %time",
"Obloq.Obloq_httpPut|block": "HTTP(PUT) | URL %url| 内容 %content| 超时 %time",
"Obloq.Obloq_httpDelete|block": "HTTP(DELETE) | URL %url| 内容 %content| 超时 %time",
*/
Loading