-
Notifications
You must be signed in to change notification settings - Fork 78
FEP 001
This document defines a standard approach for using URLs in client applications on the Atari 8-bit platform, leveraging the FujiNet device for network communication. It describes the structure of a URL, encoding and decoding mechanisms, and how a client application can interact with FujiNet to retrieve data from RESTful APIs.
With FujiNet providing a powerful network interface for retro computing platforms, client applications must efficiently interact with remote resources. The goal of this FEP is to establish a structured methodology for constructing, parsing, encoding, and decoding URLs, ensuring seamless communication between client applications and FujiNet's ESP32-based protocol adapter.
A URL (Uniform Resource Locator) consists of multiple components as defined by RFC 3986:
scheme://[user:password@]host[:port]/path[?query][#fragment]
-
Scheme: Specifies the protocol (e.g.,
http,https,ftp). -
Userinfo (Optional): Credentials for authentication (
user:password). - Host: Domain name or IP address of the resource.
-
Port (Optional): TCP port number (default:
80for HTTP,443for HTTPS). - Path: The specific resource location on the host.
-
Query (Optional): Key-value parameters (
?key=value&key2=value2). -
Fragment (Optional): Internal resource reference (
#section).
http://example.com/resourcehttps://user:[email protected]:443/data?format=json#section
The FujiNet firmware running on the ESP32 will handle URL parsing and translation. The Atari 8-bit client application will:
- Define a URL string in ATASCII format.
- Send the URL to FujiNet over SIO.
- FujiNet will:
- Convert ATASCII to ASCII.
- Parse the URL and extract components.
- Encode an HTTP request.
- Send the request over TCP/IP.
- Receive and decode the HTTP response.
- The parsed response is returned as key-value pairs to the client.
To illustrate URL parsing, consider the following example URL:
https://user:[email protected]:8080/data/info?query=test#section1
Breaking it down into components:
| Component | Value |
|---|---|
| Scheme | https |
| Userinfo | user:pass |
| Host | api.example.com |
| Port | 8080 |
| Path | /data/info |
| Query | query=test |
| Fragment | section1 |
After parsing, FujiNet prepares the URL for encoding by replacing special characters with their respective percent-encoded values.
https%3A%2F%2Fuser%3Apass%40api.example.com%3A8080%2Fdata%2Finfo%3Fquery%3Dtest%23section1
This encoded URL can then be used in network requests, ensuring proper handling of special characters.
Certain characters must be encoded for proper transmission. FujiNet’s URL encoder will replace special characters with % followed by the hexadecimal ASCII code.
| Character | Encoded Form |
|---|---|
| Space | %20 |
# |
%23 |
? |
%3F |
& |
%26 |
/ |
%2F |
FujiNet will decode incoming URLs by replacing percent-encoded characters with their original representations before processing the request.
A simple FujiNet-aware client program for the Atari 8-bit computer:
#include <stdio.h>
#include <string.h>
define URL "http://api.example.com/data?item=42"
typedef struct {
char key[32];
char value[128];
} KeyValue;
int main() {
printf("Sending request to FujiNet...\n");
// Send URL over SIO
send_url_to_fujinet(URL);
// Receive response
KeyValue response[10];
int count = receive_response_from_fujinet(response);
// Display key-value pairs
for (int i = 0; i < count; i++) {
printf("%s: %s\n", response[i].key, response[i].value);
}
return 0;
}By offloading URL handling and network requests to FujiNet, we enable efficient client applications with minimal overhead on Atari 8-bit systems. This FEP establishes a structured methodology for URL usage, ensuring compatibility and ease of development for FujiNet-enabled applications.
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