File: constants.h

package info (click to toggle)
r-cran-rinside 0.2.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: cpp: 3,310; ansic: 117; xml: 57; ruby: 34; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright (c) 2014 Christian Authmann
 */

#pragma once


#define ris_socket_address "example_server.sock"

const uint32_t RIS_MAGIC_NUMBER = 0xF00BA5;
const char RIS_CMD_SETVALUE = 1;
const char RIS_CMD_GETVALUE = 2;
const char RIS_CMD_SETCALLBACK = 3;
const char RIS_CMD_RUN = 4;
const char RIS_CMD_GETCONSOLE = 5;
const char RIS_CMD_INITPLOT = 6;
const char RIS_CMD_GETPLOT = 7;
const char RIS_CMD_EXIT = 8;


const char RIS_REPLY_OK = 101;
const char RIS_REPLY_CALLBACK = 102;
const char RIS_REPLY_VALUE = 103;
const char RIS_REPLY_ERROR = 104;


/*
 * The Socket protocol is as follows:
 *
 * The Client initiates the connection by sending the "magic number"
 *
 * Then the Client sends a CMD, followed by the required parameters.
 * The server sends a REPLY, followed by a value, an error or any other
 * relevant payload.
 *
 * For the exact parameters of each command, see rinsideserver.cpp
 *
 * Communication is continued until the client terminates the connection. The server
 * should only terminate the connection when encountering an unrecoverable error.
 */