RetroNET TCP Server

The RetroNET NABU-LIB z88dk C Library for creating games and software.
Post Reply
User avatar
DJ Sures
Posts: 347
Joined: Tue Mar 28, 2023 8:36 pm
Location: nabu.ca
Contact:

RetroNET TCP Server

Post by DJ Sures »

NABULIB 2023.03.30.00 has been updated. Specifically, RetroNET-FileStore.c and RetroNET-FileStore.h.

This works with the latest Internet Adapter (2023.03.30.00). The feature must be enabled in the settings window under RetroNET. Once the TCP RetroNET Server is enabled, it will accept Telnet or any TCP connection.

Example application for CPM: https://github.com/DJSures/NABU-LIB/tre ... P%20Server

The new commands are...

Code: Select all

// **************************************************************************************************************
//
// TCP SERVER
//
// **************************************************************************************************************

// **************************************************************************
// Get the number of clients connected to the IA TCP Server
// **************************************************************************
uint8_t rn_TCPServerClientCnt();


// **************************************************************************
// Get the length of readable data on the TCP Server connection.
// **************************************************************************
uint8_t rn_TCPServerAvailable();

// **************************************************************************
// Read data from the specified tcp server connection
// 
// - buffer is a pointer to a buffer that the data will be written to.
// - bufferOffset is the offset within the buffer where the data will be written. Use 0 if you're
//   writing to the beginning of the buffer, for example.
// - readLength is the amount of data that you will be reading.
// 
// Returns: the number of bytes read
// **************************************************************************
uint8_t rn_TCPServerRead(uint8_t* buffer, uint16_t bufferOffset, uint8_t readLength);

// **************************************************************************
// Write data to all clients that are connected to the TCP Server..
// 
// - dataOffset is the offset of the data that will be written
// - dataLen is the length of data that will be written 
// - data is a pointer to the data
//
// **************************************************************************
void rn_TCPServerWrite(uint16_t dataOffset, uint8_t dataLen, uint8_t* data);
Post Reply