Skip to content

Commit

Permalink
v0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefengedu authored Jun 20, 2019
1 parent 70e2f92 commit 5609f35
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if (esp01.connectToWiFiRouter("myRouterSSID", "password")) {
basic.showIcon(IconNames.No)
}
esp01.setupAPServer("myAPSSID", "password")
esp01.serveWebHTML(true)
while(true)
{
httpResult = esp01.getAPWebRequest()
Expand Down
9 changes: 2 additions & 7 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace esp01 {
let myMethods: string[] = ["GET", "POST", "PUT", "HEAD", "DELETE", "PATCH", "OPTIONS", "CONNECT", "TRACE"]
let sendSerialTimeout: number = 1000
let serial_str: string = ""
let client_ID: string = ""
let client_ID: string = "192.168.4.2"
let LED_status: number = 0x0

// for wifi connection
Expand Down Expand Up @@ -234,12 +234,7 @@ namespace esp01 {
//% blockId="esp01_serve_webhtml" block="serve Web HTML, success page: %getSuccess"
export function serveWebHTML(getSuccess: boolean = true): void {
// output HTML
let HTML_str: string = ""
if (getSuccess) {
HTML_str = getHTML(true) // normal HTML
} else {
HTML_str = getHTML(false) // HTML with error message
}
let HTML_str: string = getHTML(getSuccess)
// send HTML to user
sendATCommand("AT+CIPSEND=" + client_ID + "," + (HTML_str.length + 2))
sendATCommand(HTML_str, 1000)
Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esp01",
"version": "0.0.7",
"version": "0.0.8",
"description": "esp01 for micro:bit",
"license": "MIT",
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if (esp01.connectToWiFiRouter("myRouterSSID", "password")) {
basic.showIcon(IconNames.No)
}
esp01.setupAPServer("myAPSSID", "password")
esp01.serveWebHTML(true)
while(true)
{
httpResult = esp01.getAPWebRequest()
Expand Down

0 comments on commit 5609f35

Please sign in to comment.