Page 1 of 1

#FujiNet for IEC Systems Status Report 2023-03-08

Posted: Wed Mar 08, 2023 4:31 pm
by tschak909
#FujiNet for IEC (Commodore) serial bus status - 2023-03-08:
Screenshot from 2023-03-08 10-17-59.png
Screenshot from 2023-03-08 10-17-59.png (348.25 KiB) Viewed 2718 times
I have been working with Jaime Johnston of the Meatloaf project, to convert the low-level bus arbitration and communication routines used there to work in the context of #FujiNet.

ATN handling needs more work, because sometimes command phases are missed.

But I am able to send commands and get responses from the #FujiNet, as seen here for retrieving network configuration:

The code that does this is below.

I will need some help with experienced KERNAL hackers to try and fashion an appropriate interface that can work well within BASIC's limitations (e.g. 255 byte strings max), anyone who can help, please reach out, because I want to make 100% sure that controlling the FujiNet is VERY easy from BASIC.

The example program here is in C, and asks for the adapter configuration as one raw block of information that can be expressed as a C struct, then displays it. All communication with the FujiNet happens via the KERNAL I/O routines, which makes it very easy to use.

c

Code: Select all

#include <cx16.h>
#include <cbm.h>
#include <stdio.h>

/**
 * The current network adapter configuration
 */
typedef struct
{
  char ssid[33];
  char hostname[64];
  unsigned char localIP[4];
  unsigned char gateway[4];
  unsigned char netmask[4];
  unsigned char dnsIP[4];
  unsigned char macAddress[6];
  unsigned char bssid[6];
  char fn_version[15];
} AdapterConfig;

AdapterConfig ac;

void main(void)
{ 
  cbm_open(15,15,15,"adapterconfig:raw"); 
  cbm_read(15,&ac,sizeof(AdapterConfig));
  cbm_close(15);
  
  printf("%11s %s\n","SSID:",ac.ssid);
  printf("%11s %s\n","HOSTNAME:",ac.hostname);
  printf("%11s %u.%u.%u.%u\n","IP:",ac.localIP[0],ac.localIP[1],ac.localIP[2],ac.localIP[3]);
  printf("%11s %u.%u.%u.%u\n","NETMASK:",ac.netmask[0],ac.netmask[1],ac.netmask[2],ac.netmask[3]);
  printf("%11s %u.%u.%u.%u\n","GATEWAY:",ac.gateway[0],ac.gateway[1],ac.gateway[2],ac.gateway[3]);
  printf("%11s %u.%u.%u.%u\n","DNS:",ac.dnsIP[0],ac.dnsIP[1],ac.dnsIP[2],ac.dnsIP[3]);
  printf("%11s %02X:%02X:%02X:%02X:%02X:%02X\n","MAC:",ac.macAddress[0],ac.macAddress[1],ac.macAddress[2],ac.macAddress[3],ac.macAddress[4],ac.macAddress[5]);
  printf("%11s %02X:%02X:%02X:%02X:%02X:%02X\n","BSSID:",ac.bssid[0],ac.bssid[1],ac.bssid[2],ac.bssid[3],ac.bssid[4],ac.bssid[5]);
  printf("%11s %s\n\n","FNVER:",ac.fn_version);
}

Re: #FujiNet for IEC Systems Status Report 2023-03-08

Posted: Wed Mar 08, 2023 8:59 pm
by TomXP411
Thank you for the update! I'm excited to see your progress.

Also, I have taken the liberty of fixing the code block (the forums use BBCODE, rather than markdown. the Code block is the </> button on the toolbar.)