-
Notifications
You must be signed in to change notification settings - Fork 78
Finding SmartPort Devices
Thomas Cherryhomes edited this page Dec 26, 2022
·
2 revisions
With the SmartPort Slot and Dispatcher found, devices can be enumerated and found using STATUS code $00.
int8_t sp_find_fuji()
{
// const char fuji[9] = "THE_FUJI";
const char fuji[14] = "FUJINET_DISK_0";
const uint8_t fuji_len = sizeof(fuji);
int8_t err, num, i, j;
err = sp_status(0x00, 0x00); // get number of devices
if (err)
return -err;
num = sp_payload[0];
num++;
for (i = 1; i < num; i++)
{
//do
err = sp_status(i, 0x03); // get DIB
//while (err);
if (sp_payload[4] == fuji_len)
{
for (j = 0; j < fuji_len; j++)
if (fuji[j]!=sp_payload[5+j])
return 0;
sp_dest = i; // store the fuji unit #
return i;
}
}
return 0;
}
int8_t sp_find_network()
{
const char net[7] = "NETWORK";
const uint8_t net_len = sizeof(net);
int8_t err, num, i, j;
err = sp_status(0x00, 0x00); // get number of devices
if (err)
return -err;
num = sp_payload[0];
num+=2;
for (i = 1; i < num; i++)
{
err = sp_status(i, 0x03); // get DIB
if (sp_payload[4] == net_len)
{
for (j = 0; j < net_len; j++)
if (net[j]!=sp_payload[5+j])
return 0;
return i;
}
}
printf("NET NOT FOUND");
cgetc();
return 0;
}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