45 stringRep.
add(
RPCS::PSI_MACH_S3A,
N_("Series 3
a, 3c or 3mx"));
46 stringRep.
add(
RPCS::PSI_MACH_WORKABOUT,
N_("Workabout"));
55 stringRep.
add(
RPCS::PSI_BATT_VERYLOW,
N_("Very Low"));
70 stringRep.
add(
RPCS::PSI_LANG_no_NO,
N_("Norwegian"));
72 stringRep.
add(
RPCS::PSI_LANG_en_US,
N_("American"));
73 stringRep.
add(
RPCS::PSI_LANG_fr_CH,
N_("Swiss French"));
74 stringRep.
add(
RPCS::PSI_LANG_de_CH,
N_("Swiss German"));
75 stringRep.
add(
RPCS::PSI_LANG_pt_PT,
N_("Portugese"));
77 stringRep.
add(
RPCS::PSI_LANG_is_IS,
N_("Icelandic"));
79 stringRep.
add(
RPCS::PSI_LANG_hu_HU,
N_("Hungarian"));
81 stringRep.
add(
RPCS::PSI_LANG_nl_BE,
N_("Belgian Flemish"));
82 stringRep.
add(
RPCS::PSI_LANG_en_AU,
N_("Australian"));
83 stringRep.
add(
RPCS::PSI_LANG_fr_BE,
N_("Belgish French"));
84 stringRep.
add(
RPCS::PSI_LANG_de_AT,
N_("Austrian"));
85 stringRep.
add(
RPCS::PSI_LANG_en_NZ,
N_("New Zealand English"));
86 stringRep.
add(
RPCS::PSI_LANG_fr_CA,
N_("Canadian French"));
90 stringRep.
add(
RPCS::PSI_LANG_sl_SI,
N_("Slovenian"));
94 return ncp_client::connect<RPCS, RPCS16, RPCS32>(host, port,
false,
error);
115 if (
socket_->getBufferStore(
a) == 1) {
116 if (!strcmp(
a.getString(0),
"Ok")) {
145 result =
socket_->sendBufferStore(
a);
148 result =
socket_->sendBufferStore(
a);
158 if (
socket_->getBufferStore(data) == 1) {
159 if (statusIsFirstByte) {
191 if (
a.getLen() != 2) {
194 major =
a.getByte(0);
195 minor =
a.getByte(1);
202 a.addStringT(program);
203 int l = strlen(program);
204 for (
int i = 127; i > l; i--) {
214 a.addByte(strlen(args)+1);
228 a.addStringT(program);
238 a.addStringT(program);
249 bool anySuccess =
false;
258 drives =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
299 a.discardFirstBytes(sl);
300 if ((p = strstr((
char *)s,
".$"))) {
302 sscanf(p,
"%d", &pid);
308 sl = strlen(
a.getString(0)) + 1;
310 a.discardFirstBytes(sl);
315 if (anySuccess && !ret.empty()) {
316 for (processList::iterator i = ret.begin(); i != ret.end(); i++) {
319 i->setArgs(cmdline +
" " + i->getArgs());
330 a.addByte(toupper(drive));
339 if (
a.getLen() != 4) {
342 handle =
a.getWord(0);
343 count =
a.getWord(2);
368 if (
a.getLen() != 4) {
385 if (
a.getLen() != 2) {
388 type = (
enum machs)
a.getWord(0);
410 strncpy(buf,
a.getString(0), maxlen - 1);
411 while ((p = strchr(buf, 6))) {
#define ENUM_DEFINITION_END(EnumName)
#define ENUM_DEFINITION_BEGIN(EnumName, initWith)
Helper macro to construct an enumeration wrapper Enum<E> for a specific enum type.
A generic container for an array of bytes.
const char * getString(long pos=0) const
Retrieves the characters at index pos.
unsigned long getLen() const
Retrieves the length of a BufferStore.
unsigned char getByte(long pos=0) const
Retrieves the byte at index pos.
void discardFirstBytes(int len=0)
Removes bytes from the start of the buffer.
void init()
Initializes the BufferStore.
Wrapper class featuring range-checking and string representation of enumerated values.
A class, describing a Process on the Psion.
errs
The known error codes.
Remote procedure call services via PLP.
Enum< RFSV::errs > queryPrograms(processList &ret)
Retrieves a list of all running Programs.
virtual Enum< RFSV::errs > getCmdLine(const char *process, std::string &ret)=0
Retrieves the command line of a running process.
Enum< RFSV::errs > quitServer(void)
Requests the remote server to terminate.
Enum< RFSV::errs > getUniqueID(const char *, long &)
const char * getConnectName()
Enum< RFSV::errs > formatRead(int handle)
Continues a running format.
virtual Enum< RFSV::errs > getMachineInfo(machineInfo &machineInfo)
Retrieve general Information about the connected machine.
void reconnect()
Attempts to re-establish a remote connection by first closing the socket, then connecting again to th...
virtual ~RPCS()
Virtual destructor.
Enum< RFSV::errs > stopProgram(const char *program)
Requests termination of a program running on the remote machine.
Enum< RFSV::errs > getNCPversion(int &major, int &minor)
Retrieves the version of the NCP protocol on the remote side.
Enum< RFSV::errs > getMachineType(Enum< machs > &type)
Retrieves the type of machine on the remote side as defined in machs.
std::unique_ptr< TCPSocket > socket_
The socket, used for communication with ncpd.
machs
The known machine types.
Enum< RFSV::errs > queryProgram(const char *)
Enum< RFSV::errs > execProgram(const char *program, const char *args)
Starts execution of a program on the remote machine.
Enum< RFSV::errs > getStatus()
Retrieves the current status of the connection.
int mtCacheS5mx
Flag: getMachineType and getMachineInfo have been called and the machine is an S5mx.
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.
Enum< RFSV::errs > status
The current status of the connection.
bool sendCommand(enum commands cc, BufferStore &data)
Sends a command to the remote side.
void reset()
Initializes a connection to the remote machine.
Enum< RFSV::errs > getResponse(BufferStore &data, bool statusIsFirstByte)
commands
The possible commands.
Enum< RFSV::errs > formatOpen(const char drive, int &handle, int &count)
Starts formatting a drive.
ConnectionError
Errors that can occur when connecting to a PLP server.
stringRep add(RPCS::PSI_MACH_UNKNOWN, N_("Unknown device"))
std::vector< PsiProcess > processList
static void error(int line)
This struct holds the data returned by RPCS::getMachineInfo.
Description of a Psion-Device.