ARMweb update

Questions about the BASICtools and MakeItC
Post Reply
Posts: 1037
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA

ARMweb update

Post by basicchip »

The ARMweb has been set up as a server. For years we've been asked to add the client side, and for the longest time we just thought that would be too involved. But really we weren't seeing the simple side of that request. What most wanted was the ability for the ARMweb to do a GET or POST to a web server, and use that to process remote data, and for most what the server returns was really of no consequence. So enough of you finally beat through our heads that we should add a simple GET/POST which is now part of the firmware. In BASIC you can access it through --

Code: Select all

' HTTP example will wait up to 5 seconds for a SYNC then wait up to 5 seconds for a response
' During this time your basic program will not respond

DIM A$(256)

' Build a request string, could also be a POST, could also include CGI
A$ = sprintf("GET /%c%c%c%c",13,10,13,10)

'Example read a local page server
HTTP ((192<<24)+(168<<16)+(1<<8)+4, A$)

' Another way to builod the string
'HTTP ((192<<24)+(168<<16)+(1<<8)+4, "GET /" + chr(13) + chr(10) + chr(13) + chr(10) )

'up to 256 bytes of response are returned in the CGI buffer
'headers are stripped so only page text is returned

'sit and listen up to 5 seconds for any incoming HTTP response
WHILE A$(0) = 0 and TIMER-START < 5000000
  A$ = CGIIN

PRINT " read "; LEN(A$); " bytes"
printf("%s", A$)
For now the first 256 bytes returned by the server are available in the CGIIN buffer.

To use this update the ARMweb with the attached firmware
ARMweb firmware 7.57
(330.07 KiB) Downloaded 434 times

Post Reply