Wiki Home >> SIO-Command-$CA-Base64-Decode-Length

SIO-Command-$CA-Base64-Decode-Length


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

Base64 Decode Length ($CA)

Description

This function is used to return the total size of the base64 encoded output. The resulting value is 32-bits (4 bytes) wide. Little-endian.

Firmware version required: 1.1 (2023.08.22) +

Parameters

DCBValue
DDEVIC$70
DUNIT$01
DCOMND$CA
DSTATS$40
DBUFa 4-byte buffer for the length
DTIMLO$03
DBYT4
DAUX10
DAUX20

Examples

CC65

unsigned char base64_decode_length(unsigned long *len)                                                                               
{                                                                                                                                    
  OS.dcb.ddevic   = BASE64_DEVICE;                                                                                                   
  OS.dcb.dunit    = 1;                                                                                                               
  OS.dcb.dcomnd   = 0xCA;                                                                                                            
  OS.dcb.dstats   = 0x40;                                                                                                            
  OS.dcb.dbuf     = len;                                                                                                             
  OS.dcb.dtimlo   = BASE64_TIMEOUT;                                                                                                  
  OS.dcb.dbyt     = sizeof(unsigned long);                                                                                           
  OS.dcb.daux     = 0;                                                                                                               
  siov();                                                                                                                            
                                                                                                                                     
  return OS.dcb.dstats; // Return SIO error or success.                                                                              
}                                                                                                                                    

Wiki content is mirrored from the FujiNet Github Wiki