-
Notifications
You must be signed in to change notification settings - Fork 69
HTTP Set Channel Mode
This is a command for Devices $71-$78 - The N: Device (see SIO-Commands-for-Device-IDs-$71-to-$78).
Changes the channel mode on an HTTP connection. This is used so that you can change the behavior of the GET, PUT, and STATUS commands to retrieve and send different types of information required for a complete HTTP transaction, such as headers, and POST data.
There are four modes which can be selected, depending on the value of AUX2:
AUX2 | Description |
---|---|
0 | BODY |
1 | COLLECT HEADERS |
2 | GET HEADERS |
3 | SET HEADERS |
4 | SET POST DATA |
Use this mode to retrieve the BODY of an HTTP document in READ. This causes the HTTP transaction to occur.
With this mode:
- STATUS returns the number of bytes still to be read in the HTTP BODY.
- READ will return the specified number of bytes from the HTTP BODY. This causes the HTTTP transaction to occur.
- WRITE will write the specified number of bytes to the BODY (PUT mode only)
Use this mode as the first step in retrieving headers from an HTTP response. Each header requested is written one line at a time, terminated by an ATASCII EOL ($9B). The FujiNet will retrieve exactly the headers written in this mode, in the order in which they are written.
With this mode:
- STATUS does not return anything meaningful, as it is a write only mode.
- READ returns a WRITE MODE ONLY error, as it is a write only mode
- WRITE will write the specified number of bytes to the COLLECT HEADERS routine. It is expected that each header be written, one at a time, terminated by a $9B. Do not write multiple ATASCII EOL terminated lines in one WRITE.
Causes the FujiNet to retrieve the HTTP headers, and send each one, one line at a time, over the channel. This causes the HTTP transaction to occur.
With this mode:
- STATUS returns the number of bytes for the next header value, including the ATASCII EOL.
- READ returns the number of bytes requested of the next header value. This causes the HTTP transaction to occur. It is expected that this match the value from STATUS.
- WRITE will return a READ ONLY ERROR, as this is a read-only mode.
This mode changes channel behavior so that each WRITE sends a header key, and value in HTTP format, to be sent along with the HTTP transaction.
Key: Value<EOL>
- Key is the name of the header
- Value is the value to assign to the header key.
e.g.
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
Important
The single white space after Key: is mandatory.
With this mode:
- STATUS does not return meaningful data, as it is a write-only mode.
- READ returns a WRITE ONLY error, as this is a write-only mode.
- WRITE will write the specified # of bytes as a header. The header must be in the format above. With one space after the Key:
This mode, when used with POST, will cause any WRITE to the channel to be collected as data to be sent when the HTTP transaction is performed. Doing a READ in GET Header or BODY will cause the HTTP transaction to occur, and any POST data to be sent.
With this mode:
- STATUS does not return meaningful data, as it is a write-only mode.
- READ returns a WRITE ONLY error, as this is a write-only mode.
- WRITE will write the specified # of bytes as post data.
DCB | Value |
---|---|
DDEVIC | $71 |
DUNIT | $01 - $04 |
DCOMND | $4D 'M' |
DSTATS | $00 |
DBUF | NULL |
DTIMLO | $0F |
DBYT | 0 |
DAUX1 | N: AUX1 Values |
DAUX2 | New Channel mode |
/**
* Set HTTP Channel mode.
*/
void sio_http_channel_mode(unsigned char new_mode)
{
OS.vprced=ih;
PIA.pactl |= 1;
// Establish connection
OS.dcb.ddevic=0x71;
OS.dcb.dunit=1;
OS.dcb.dcomnd='M';
OS.dcb.dstats=0x00;
OS.dcb.dbuf=NULL;
OS.dcb.dtimlo=0x0f;
OS.dcb.dbyt=0;
OS.dcb.daux2=new_mode;
siov();
}
Put other related command links here.
Copyright 2024 Contributors to the FujiNetWIFI project.
Join us on Discord: https://discord.gg/7MfFTvD
- Home
- What is FujiNet?
- The Definition of Done
- Board bring up for FujiNet Platform.IO code
- The Complete Linux CLI Guide
- The Complete macOS CLI Guide
- Development Env for Apps
- FujiNet-Development-Guidelines
- System Quickstarts
- FujiNet Flasher
- Setting up a TNFS Server
- FujiNet Configuration File: fnconfig.ini
- AppKey Registry - SIO Command $DC Open App Key
- CP-M Support
- BBS
- Official Hardware Versions
- Prototype Board Revisions
- FujiNet Development Guidelines
- Atari Programming
- Apple Programming
- C64 Programming
- ADAM Programming
- Testing Plan
- Hacker List
- FujiNet VirtualMachine