Wiki Home >> SIO-Command-$CC-Base64-Decode-Input

SIO-Command-$CC-Base64-Decode-Input


This is a command for Device $70 - The FujiNet Device itself (see SIO-Commands-for-Device-ID-$70).

Base64 Decode Input ($CC)

Description

Puts data in the FujiNet's BASE64 input buffer for decoding by Base64 Decode Compute, which should be the function called after this command has input all the data to decode. This command can be called as many times as needed to input data at up to 65535 bytes at a time.

Because DAUX is used to tell the FujiNet how many bytes to expect, both DBUF and DAUX must be set to the same value.

Firmware version required: 1.1 (2023.08.22) +

Parameters

DCBValue
DDEVIC$70
DUNIT$01
DCOMND$CC
DSTATS$80
DBUFA buffer as big as specified by DBYT/DAUX
DTIMLO$03
DBYTnumber of bytes to input
DAUX1number of bytes to input (LO)
DAUX2number of bytes to input (HI)

Examples

CC65

unsigned char base64_decode_input(char* buf, unsigned short len)                                                                     
{                                                                                                                                    
  OS.dcb.ddevic   = BASE64_DEVICE;                                                                                                   
  OS.dcb.dunit    = 1;                                                                                                               
  OS.dcb.dcomnd   = 0xCC;                                                                                                            
  OS.dcb.dstats   = 0x80;                                                                                                            
  OS.dcb.dbuf     = buf;                                                                                                             
  OS.dcb.dtimlo   = BASE64_TIMEOUT;                                                                                                  
  OS.dcb.dbyt     = len;                                                                                                             
  OS.dcb.daux     = len;                                                                                                             
  siov();                                                                                                                            
                                                                                                                                     
  return OS.dcb.dstats; // Return SIO error or success.                                                                              
}                                                                                                                                    

Wiki content is mirrored from the FujiNet Github Wiki