|
plptools
|
Remote procedure call services via PLP. More...
#include <rpcs.h>


Classes | |
| struct | machineInfo_t |
| This struct holds the data returned by rpcs::getMachineInfo. More... | |
Public Member Functions | |
| 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::errs > | getStatus () |
| Retrieves the current status of the connection. More... | |
| Enum< rfsv::errs > | getNCPversion (int &major, int &minor) |
| Retrieves the version of the NCP protocol on the remote side. More... | |
| Enum< rfsv::errs > | execProgram (const char *program, const char *args) |
| Starts execution of a program on the remote machine. More... | |
| Enum< rfsv::errs > | stopProgram (const char *program) |
| Requests termination of a program running on the remote machine. More... | |
| Enum< rfsv::errs > | queryProgram (const char *) |
| Enum< rfsv::errs > | formatOpen (const char drive, int &handle, int &count) |
| Starts formatting a drive. More... | |
| Enum< rfsv::errs > | formatRead (int handle) |
| Continues a running format. More... | |
| Enum< rfsv::errs > | getUniqueID (const char *, long &) |
| virtual Enum< rfsv::errs > | getOwnerInfo (bufferArray &owner)=0 |
| Retrieve owner information of the remote machine. More... | |
| Enum< rfsv::errs > | getMachineType (Enum< machs > &type) |
| Retrieves the type of machine on the remote side as defined in machs. More... | |
| Enum< rfsv::errs > | fuser (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::errs > | quitServer (void) |
| Requests the remote server to terminate. More... | |
| Enum< rfsv::errs > | queryPrograms (processList &ret) |
| Retrieves a list of all running Programs. More... | |
| virtual Enum< rfsv::errs > | getCmdLine (const char *process, std::string &ret)=0 |
| Retrieves the command line of a running process. More... | |
| virtual Enum< rfsv::errs > | getMachineInfo (machineInfo &machineInfo) |
| Retrieve general Information about the connected machine. More... | |
| virtual Enum< rfsv::errs > | closeHandle (uint32_t handle) |
| Release an rpcs handle. More... | |
| virtual Enum< rfsv::errs > | regOpenIter (uint32_t, char *, uint16_t &) |
| virtual Enum< rfsv::errs > | regReadIter (uint16_t) |
| virtual Enum< rfsv::errs > | regWrite (void) |
| virtual Enum< rfsv::errs > | regRead (void) |
| virtual Enum< rfsv::errs > | regDelete (void) |
| virtual Enum< rfsv::errs > | setTime (time_t time) |
| virtual Enum< rfsv::errs > | configRead (uint32_t size, bufferStore &data) |
| Read from Series 5 scratch RAM. More... | |
| virtual Enum< rfsv::errs > | configWrite (bufferStore data) |
| Write to Series 5 scratch RAM. More... | |
| virtual Enum< rfsv::errs > | queryOpen (void) |
| virtual Enum< rfsv::errs > | queryRead (void) |
Protected Types | |
| 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 Member Functions | |
| virtual Enum< rfsv::errs > | configOpen (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::errs > | getResponse (bufferStore &data, bool statusIsFirstByte) |
| const char * | getConnectName () |
Protected Attributes | |
| TCPSocket * | skt |
| The socket, used for communication with ncpd. More... | |
| Enum< rfsv::errs > | status |
| The current status of the connection. More... | |
| int | mtCacheS5mx |
| Flag: getMachineType and getMachineInfo have been called and the machine is an S5mx. More... | |
Remote procedure call services via PLP.
rpcs provides an interface for communicating with the Psion's remote procedure call service. The generic facilities for both, EPOC and SIBO are implemented here, while the facilities, unique to each of those variants are implemented in rpcs32 or rpcs16 respectively. These normally are instantiated by using rpcsfactory .
| typedef struct rpcs::machineInfo_t rpcs::machineInfo |
This struct holds the data returned by rpcs::getMachineInfo.
| enum rpcs::batterystates |
|
protected |
The possible commands.
| enum rpcs::languages |
The known interface languages.
| enum rpcs::machs |
|
inlinevirtual |
Release an rpcs handle.
This function works with EPOC only. Using it with SIBO machines, returns always an error code E_PSI_NOT_SIBO. It releases a handle, obtained by a previous call to rpcs::configOpen .
| handle | The handle to close. |
|
inlineprotectedvirtual |
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.
| handle | The handle to be used in rpcs::configRead , rpcs::configWrite and rpcs::closeHandle is returned here. |
| size | The number of bytes you want to use. |
Reimplemented in rpcs32.
|
inlinevirtual |
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.
| size | The amount of data to be read. |
| data | The content of the scratch RAM is returned here. |
Reimplemented in rpcs32.
|
inlinevirtual |
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.
| data | The data to be written to the scratch RAM. |
Reimplemented in rpcs32.
| Enum< rfsv::errs > rpcs::execProgram | ( | const char * | program, |
| const char * | args | ||
| ) |
Starts execution of a program on the remote machine.
This function is working with both SIBO and EPOC devices.
| program | The full path of the executable on the remote machine |
| args | The arguments for this program, separated by space. |
This is a hack for the jotter app on mx5 pro. (and probably others) Jotter seems to read its arguments one char past normal apps. Without this hack, The Drive-Character gets lost. Other apps don't seem to be hurt by the additional blank.
| Enum< rfsv::errs > rpcs::formatOpen | ( | const char | drive, |
| int & | handle, | ||
| int & | count | ||
| ) |
Starts formatting a drive.
This function is working with both SIBO and EPOC devices. After calling formatOpen, formatRead should be called n times with the returned handle where n is the value of the returned parameter count.
| drive | The drive character to format (e.g: 'C', 'D' etc). |
| handle | The handle for calling formatRead is returned here. |
| count | The number of required calls to formatRead is returned here. |
| Enum< rfsv::errs > rpcs::formatRead | ( | int | handle | ) |
| Enum< rfsv::errs > rpcs::fuser | ( | const char * | name, |
| char * | buf, | ||
| int | maxlen | ||
| ) |
Retrieves the name of a process, having a given file opened on the remote side.
This function is working with both SIBO and EPOC devices
| name | The full path of a file to be checked for being used by a program. |
| buf | A buffer which gets filled with the program's name. |
| maxlen | The maximum capacity of the buffer. |
|
pure 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.
| process | Name of process. Format: processname.$pid |
| ret | The program name and arguments are returned here. |
|
inlinevirtual |
| Enum< rfsv::errs > rpcs::getMachineType | ( | Enum< machs > & | type | ) |
Retrieves the type of machine on the remote side as defined in machs.
This function is working with both SIBO and EPOC devices
| type | The code describing the type of machine on the remote side is stored here on return. |
| Enum< rfsv::errs > rpcs::getNCPversion | ( | int & | major, |
| int & | minor | ||
| ) |
Retrieves the version of the NCP protocol on the remote side.
This function is working with both SIBO and EPOC devices.
| major | The major part of the NCP version. Valid only if returned with no error. |
| minor | The minor part of the NCP version. Valid only if returned with no error. |
|
pure virtual |
Retrieve owner information of the remote machine.
This function is working with both SIBO and EPOC devices.
| owner | A bufferArray, containing the lines of the owner info upon return. |
|
protected |
| Enum< rfsv::errs > rpcs::getStatus | ( | void | ) |
| Enum< rfsv::errs > rpcs::getUniqueID | ( | const char * | device, |
| long & | id | ||
| ) |
|
inlinevirtual |
| Enum< rfsv::errs > rpcs::queryProgram | ( | const char * | program | ) |
| Enum< rfsv::errs > rpcs::queryPrograms | ( | processList & | ret | ) |
|
inlinevirtual |
| Enum< rfsv::errs > rpcs::quitServer | ( | void | ) |
| void rpcs::reconnect | ( | void | ) |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
| void rpcs::reset | ( | void | ) |
|
protected |
Sends a command to the remote side.
If communication fails, a reconnect is triggered and a second attempt to transmit the request is attempted. If that second attempt fails, the function returns an error and sets rpcs::status to E_PSI_FILE_DISC.
| cc | The command to execute on the remote side. |
| data | Additional data for this command. |
|
inlinevirtual |
| Enum< rfsv::errs > rpcs::stopProgram | ( | const char * | program | ) |
|
protected |
|
protected |
|
protected |