plptools
Loading...
Searching...
No Matches
rpcs32 Class Reference

This is the implementation of the rpcs protocol for Psion series 5 (EPOC) variant. More...

#include <rpcs32.h>

Inheritance diagram for rpcs32:
Collaboration diagram for rpcs32:

Public Member Functions

Enum< rfsv::errsgetCmdLine (const char *, std::string &)
 Retrieves the command line of a running process. More...
 
Enum< rfsv::errsgetMachineInfo (machineInfo &)
 Retrieve general Information about the connected machine. More...
 
Enum< rfsv::errsgetOwnerInfo (bufferArray &owner)
 Retrieve owner information of the remote machine. More...
 
Enum< rfsv::errsconfigRead (uint32_t, bufferStore &)
 Read from Series 5 scratch RAM. More...
 
Enum< rfsv::errsconfigWrite (bufferStore)
 Write to Series 5 scratch RAM. More...
 
Enum< rfsv::errscloseHandle (uint16_t)
 
Enum< rfsv::errsregOpenIter (uint32_t uid, char *match, uint16_t &handle)
 
Enum< rfsv::errsregReadIter (uint16_t handle)
 
Enum< rfsv::errssetTime (time_t time)
 
- Public Member Functions inherited from rpcs
virtual ~rpcs ()
 Virtual destructor. More...
 
void reset ()
 Initializes a connection to the remote machine. More...
 
void reconnect ()
 Attempts to re-establish a remote connection by first closing the socket, then connecting again to the ncpd daemon and finally calling reset. More...
 
Enum< rfsv::errsgetStatus ()
 Retrieves the current status of the connection. More...
 
Enum< rfsv::errsgetNCPversion (int &major, int &minor)
 Retrieves the version of the NCP protocol on the remote side. More...
 
Enum< rfsv::errsexecProgram (const char *program, const char *args)
 Starts execution of a program on the remote machine. More...
 
Enum< rfsv::errsstopProgram (const char *program)
 Requests termination of a program running on the remote machine. More...
 
Enum< rfsv::errsqueryProgram (const char *)
 
Enum< rfsv::errsformatOpen (const char drive, int &handle, int &count)
 Starts formatting a drive. More...
 
Enum< rfsv::errsformatRead (int handle)
 Continues a running format. More...
 
Enum< rfsv::errsgetUniqueID (const char *, long &)
 
virtual Enum< rfsv::errsgetOwnerInfo (bufferArray &owner)=0
 Retrieve owner information of the remote machine. More...
 
Enum< rfsv::errsgetMachineType (Enum< machs > &type)
 Retrieves the type of machine on the remote side as defined in machs. More...
 
Enum< rfsv::errsfuser (const char *name, char *buf, int maxlen)
 Retrieves the name of a process, having a given file opened on the remote side. More...
 
Enum< rfsv::errsquitServer (void)
 Requests the remote server to terminate. More...
 
Enum< rfsv::errsqueryPrograms (processList &ret)
 Retrieves a list of all running Programs. More...
 
virtual Enum< rfsv::errsgetCmdLine (const char *process, std::string &ret)=0
 Retrieves the command line of a running process. More...
 
virtual Enum< rfsv::errsgetMachineInfo (machineInfo &machineInfo)
 Retrieve general Information about the connected machine. More...
 
virtual Enum< rfsv::errscloseHandle (uint32_t handle)
 Release an rpcs handle. More...
 
virtual Enum< rfsv::errsregOpenIter (uint32_t, char *, uint16_t &)
 
virtual Enum< rfsv::errsregReadIter (uint16_t)
 
virtual Enum< rfsv::errsregWrite (void)
 
virtual Enum< rfsv::errsregRead (void)
 
virtual Enum< rfsv::errsregDelete (void)
 
virtual Enum< rfsv::errssetTime (time_t time)
 
virtual Enum< rfsv::errsconfigRead (uint32_t size, bufferStore &data)
 Read from Series 5 scratch RAM. More...
 
virtual Enum< rfsv::errsconfigWrite (bufferStore data)
 Write to Series 5 scratch RAM. More...
 
virtual Enum< rfsv::errsqueryOpen (void)
 
virtual Enum< rfsv::errsqueryRead (void)
 

Protected Member Functions

Enum< rfsv::errsconfigOpen (uint16_t &, uint32_t)
 Prepare scratch RAM in Series 5 for read/write. More...
 
- Protected Member Functions inherited from rpcs
virtual Enum< rfsv::errsconfigOpen (uint16_t &handle, uint32_t size)
 Prepare scratch RAM in Series 5 for read/write. More...
 
bool sendCommand (enum commands cc, bufferStore &data)
 Sends a command to the remote side. More...
 
Enum< rfsv::errsgetResponse (bufferStore &data, bool statusIsFirstByte)
 
const char * getConnectName ()
 

Private Member Functions

 rpcs32 (TCPSocket *)
 

Friends

class rpcsfactory
 

Additional Inherited Members

- Public Types inherited from rpcs
enum  machs {
  PSI_MACH_UNKNOWN = 0 , PSI_MACH_PC = 1 , PSI_MACH_MC = 2 , PSI_MACH_HC = 3 ,
  PSI_MACH_S3 = 4 , PSI_MACH_S3A = 5 , PSI_MACH_WORKABOUT = 6 , PSI_MACH_SIENA = 7 ,
  PSI_MACH_S3C = 8 , PSI_MACH_S5 = 32 , PSI_MACH_WINC = 33
}
 The known machine types. More...
 
enum  languages {
  PSI_LANG_TEST = 0 , PSI_LANG_en_GB = 1 , PSI_LANG_fr_FR = 2 , PSI_LANG_de_DE = 3 ,
  PSI_LANG_es_ES = 4 , PSI_LANG_it_IT = 5 , PSI_LANG_sv_SE = 6 , PSI_LANG_da_DK = 7 ,
  PSI_LANG_no_NO = 8 , PSI_LANG_fi_FI = 9 , PSI_LANG_en_US = 10 , PSI_LANG_fr_CH = 11 ,
  PSI_LANG_de_CH = 12 , PSI_LANG_pt_PT = 13 , PSI_LANG_tr_TR = 14 , PSI_LANG_is_IS = 15 ,
  PSI_LANG_ru_RU = 16 , PSI_LANG_hu_HU = 17 , PSI_LANG_nl_NL = 18 , PSI_LANG_nl_BE = 19 ,
  PSI_LANG_en_AU = 20 , PSI_LANG_fr_BE = 21 , PSI_LANG_de_AT = 22 , PSI_LANG_en_NZ = 23 ,
  PSI_LANG_fr_CA = 24 , PSI_LANG_cs_CZ = 25 , PSI_LANG_sk_SK = 26 , PSI_LANG_pl_PL = 27 ,
  PSI_LANG_sl_SI = 28
}
 The known interface languages. More...
 
enum  batterystates { PSI_BATT_DEAD = 0 , PSI_BATT_VERYLOW = 1 , PSI_BATT_LOW = 2 , PSI_BATT_GOOD = 3 }
 The known battery states. More...
 
typedef struct rpcs::machineInfo_t machineInfo
 This struct holds the data returned by rpcs::getMachineInfo. More...
 
- Protected Types inherited from rpcs
enum  commands {
  QUERY_NCP = 0x00 , EXEC_PROG = 0x01 , QUERY_DRIVE = 0x02 , STOP_PROG = 0x03 ,
  QUERY_PROG = 0x04 , FORMAT_OPEN = 0x05 , FORMAT_READ = 0x06 , GET_UNIQUEID = 0x07 ,
  GET_OWNERINFO = 0x08 , GET_MACHINETYPE = 0x09 , GET_CMDLINE = 0x0a , FUSER = 0x0b ,
  GET_MACHINE_INFO = 0x64 , CLOSE_HANDLE = 0x65 , REG_OPEN_ITER = 0x66 , REG_READ_ITER = 0x67 ,
  REG_WRITE = 0x68 , REG_READ = 0x69 , REG_DELETE = 0x6a , SET_TIME = 0x6b ,
  CONFIG_OPEN = 0x6c , CONFIG_READ = 0x6d , CONFIG_WRITE = 0x6e , QUERY_OPEN = 0x6f ,
  QUERY_READ = 0x70 , QUIT_SERVER = 0xff
}
 The possible commands. More...
 
- Protected Attributes inherited from rpcs
TCPSocketskt
 The socket, used for communication with ncpd. More...
 
Enum< rfsv::errsstatus
 The current status of the connection. More...
 
int mtCacheS5mx
 Flag: getMachineType and getMachineInfo have been called and the machine is an S5mx. More...
 

Detailed Description

This is the implementation of the rpcs protocol for Psion series 5 (EPOC) variant.

You normally never create objects of this class directly. Thus the constructor is private. Use rpcsfactory for creating an instance of rpcs . For a complete documentation, see rpcs .

Definition at line 36 of file rpcs32.h.

Constructor & Destructor Documentation

◆ rpcs32()

rpcs32::rpcs32 ( TCPSocket _skt)
private

Definition at line 35 of file rpcs32.cc.

Member Function Documentation

◆ closeHandle()

Enum< rfsv::errs > rpcs32::closeHandle ( uint16_t  handle)

Definition at line 289 of file rpcs32.cc.

◆ configOpen()

Enum< rfsv::errs > rpcs32::configOpen ( uint16_t &  handle,
uint32_t  size 
)
protectedvirtual

Prepare scratch RAM in Series 5 for read/write.

This function works with EPOC only. Using it with SIBO machines, returns always an error code E_PSI_NOT_SIBO. It prepares a scratch area on the EPOC machine for a following use from within rpcs::configRead or rpcs::configWrite . These functions call rpcs::closeHandle on exit. The contents of the scratch area is stored in RAM of the Series 5, therefore it gets lost when the Series 5 is switched off.

Parameters
handleThe handle to be used in rpcs::configRead , rpcs::configWrite and rpcs::closeHandle is returned here.
sizeThe number of bytes you want to use.
Returns
A psion error code. 0 = Ok.

Reimplemented from rpcs.

Definition at line 222 of file rpcs32.cc.

◆ configRead()

Enum< rfsv::errs > rpcs32::configRead ( uint32_t  size,
bufferStore data 
)
virtual

Read from Series 5 scratch RAM.

This function works with EPOC only. Using it with SIBO machines, returns always an error code E_PSI_NOT_SIBO. It reads raw data from the scratch RAM of the Series 5.

Parameters
sizeThe amount of data to be read.
dataThe content of the scratch RAM is returned here.
Returns
A psion error code. 0 = Ok.

Reimplemented from rpcs.

Definition at line 237 of file rpcs32.cc.

◆ configWrite()

Enum< rfsv::errs > rpcs32::configWrite ( bufferStore  data)
virtual

Write to Series 5 scratch RAM.

This function works with EPOC only. Using it with SIBO machines, returns always an error code E_PSI_NOT_SIBO. It writes raw data to the scatch RAM of the Series 5.

Parameters
dataThe data to be written to the scratch RAM.
Returns
A psion error code. 0 = Ok.

Reimplemented from rpcs.

Definition at line 263 of file rpcs32.cc.

◆ getCmdLine()

Enum< rfsv::errs > rpcs32::getCmdLine ( const char *  process,
std::string &  ret 
)
virtual

Retrieves the command line of a running process.

This function works with both SIBO and EPOC. Note: rpcs::queryPrograms calls this method internally and sets the args member of PsiProcess , so you usually don't have to call this method yourself.

Parameters
processName of process. Format: processname.$pid
retThe program name and arguments are returned here.
Returns
Psion error code. 0 = Ok.

Implements rpcs.

Definition at line 42 of file rpcs32.cc.

◆ getMachineInfo()

Enum< rfsv::errs > rpcs32::getMachineInfo ( machineInfo machineInfo)
virtual

Retrieve general Information about the connected machine.

This function works with EPOC only. Using it with SIBO machines, returns always an error code E_PSI_NOT_SIBO.

Parameters
machineInfoThe struct holding all information on return.
Returns
Psion error code. 0 = Ok.

Reimplemented from rpcs.

Definition at line 56 of file rpcs32.cc.

◆ getOwnerInfo()

Enum< rfsv::errs > rpcs32::getOwnerInfo ( bufferArray owner)
virtual

Retrieve owner information of the remote machine.

This function is working with both SIBO and EPOC devices.

Parameters
ownerA bufferArray, containing the lines of the owner info upon return.
Returns
A psion error code. 0 = Ok.

Implements rpcs.

Definition at line 128 of file rpcs32.cc.

◆ regOpenIter()

Enum< rfsv::errs > rpcs32::regOpenIter ( uint32_t  uid,
char *  match,
uint16_t &  handle 
)
virtual

Reimplemented from rpcs.

Definition at line 157 of file rpcs32.cc.

◆ regReadIter()

Enum< rfsv::errs > rpcs32::regReadIter ( uint16_t  handle)
virtual

Reimplemented from rpcs.

Definition at line 176 of file rpcs32.cc.

◆ setTime()

Enum< rfsv::errs > rpcs32::setTime ( time_t  time)
virtual

Reimplemented from rpcs.

Definition at line 193 of file rpcs32.cc.

Friends And Related Function Documentation

◆ rpcsfactory

friend class rpcsfactory
friend

Definition at line 37 of file rpcs32.h.


The documentation for this class was generated from the following files: