Skip to content

Commit 941bf1f

Browse files
Add ALF interface proposal
1 parent cb6de90 commit 941bf1f

File tree

1 file changed

+69
-60
lines changed
  • src/CommandLineUtilities/AliceLowlevelFrontend

1 file changed

+69
-60
lines changed

src/CommandLineUtilities/AliceLowlevelFrontend/README.md

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,96 +3,70 @@ DIM server for DCS control of the cards
33

44

55
# Usage
6-
`DIM_DNS_NODE=mydimdns roc-alf-server --serial=11225`
6+
`DIM_DNS_NODE=mydimdns roc-alf-server`
7+
ALF will automatically scan the system for cards.
78

89

910
# Services
1011

1112
Service names are organized by card serial number:
12-
`ALF/SERIAL_[serial number]/[service name]`
13+
`ALF/SERIAL_[serial number]/LINK_[link]/[service name]`
1314

1415
## RPC calls
1516
Some of the services are RPC calls.
16-
* RPC calls take a string argument and return a string.
17-
* When the argument must contain multiple values, they must be comma-separated.
18-
* The return string will contain an 8-byte prefix indicating success or failure "success:" or "failure:",
17+
* RPC calls take a string containing one or more arguments, and return a string.
18+
* When the RPC has multiple arguments, they must be newline-separated ('\n').
19+
* The return string will contain an 8 character prefix indicating success or failure "success\n" or "failure\n",
1920
optionally followed by a return value or error message.
20-
* Numbers and addresses are all in base-16. A '0x' prefix for numbers is accepted, but unnecessary for the parameters.
21+
* Addresses are all in base-16. A '0x' prefix for numbers is accepted, but unnecessary for the parameters.
2122
The '0x' prefix is omitted for return values.
2223

23-
For example: a register write call could have the argument string "0x504,0x4" meaning write value 0x42 to address 0x4.
24+
For example: a register write call could have the argument string "0x504\n0x4" meaning write value 0x42 to address 0x4.
2425
The return string could be "success:" or "failure:Address out of range".
2526

26-
## Service description
27-
28-
#### Publish registers
29-
Starts a service under a DNS name, that publishes the contents of the given register addresses at the specified
30-
interval.
31-
Values are published as array of 32 bit unsigned integers.
32-
* Service type: RPC call
33-
* Service name: PUBLISH_START
34-
* Parameters: DNS name to publish at, comma-separated register addresses, interval in seconds
35-
* Return: empty
36-
37-
#### Publish SCA
38-
Starts a service under a DNS name, that executes and publishes the results of the given SCA write sequence at the
39-
specified interval. Values are published as array of 32 bit unsigned integers.
40-
If an error occurred, the corresponding result will be set to 0xffffffff and the rest of the sequence is aborted.
41-
* Service type: RPC call
42-
* Service name: PUBLISH_SCA_START
43-
* Parameters: DNS name to publish at, comma-separated register addresses, interval in seconds
44-
* Return: empty
45-
46-
#### Publish stop
47-
Stops a publishing service (either regular or SCA) registered under the given DNS name.
48-
* Service type: RPC call
49-
* Service name: PUBLISH_STOP
50-
* Parameters: DNS name
51-
* Return: empty
52-
53-
#### Register read
27+
#### REGISTER_READ
5428
* Service type: RPC call
55-
* Service name: REGISTER_READ
56-
* Parameters: register address
29+
* Parameters:
30+
* Register address
5731
* Return: register value
5832

59-
#### Register write
33+
#### REGISTER_WRITE
6034
* Service type: RPC call
61-
* Service name: REGISTER_WRITE
62-
* Parameters: register address, register value
35+
* Parameters:
36+
* Register address
37+
* Register value
6338
* Return: empty
6439

65-
#### SCA read
40+
#### SCA_READ
6641
A basic read from the SCA
6742
* Service type: RPC call
68-
* Service name: SCA_READ
6943
* Parameters: empty
70-
* Return: SCA command, SCA data
44+
* Return: SCA command and SCA data (comma-separated)
7145

72-
#### SCA write
46+
#### SCA_WRITE
7347
A basic write to the SCA
7448
* Service type: RPC call
7549
* Service name: SCA_WRITE
76-
* Parameters: SCA command, SCA data
50+
* Parameters:
51+
* SCA command and SCA data (comma-separated)
7752
* Return: empty
7853

79-
#### SCA write sequence
80-
Write a sequence of values to the SCA
54+
#### SCA_SEQUENCE
55+
Write and read a sequence to the SCA
8156
* Service type: RPC call
82-
* Service name: SCA_WRITE_SEQUENCE
83-
* Parameters: A sequence of pairs of SCA command and data. The pairs are separated by newline, the command and data by
84-
comma:
57+
* Parameters:
58+
* A sequence of pairs of SCA command and data. The pairs are separated by newline, the command and data by comma:
8559
~~~
86-
"[command 0],[data 0]\n[command 1],[data 1]\n[etc.]"
60+
"[command 0],[data 0]\n[command 1],[data 1]\n[etc.]"
8761
~~~
8862
For example:
8963
~~~
90-
"10,11\n20,21\n30,31"
64+
"10,a1\n20,b1\n30,c1"
9165
~~~
9266
Comment lines are allowed, they must start with a `#`. For example:
9367
~~~
9468
"# Hello!\n11,22\n33,44\n# Bye!"
95-
~~~
69+
~~~
9670
* Return: A sequence of SCA read return values corresponding to the commands from the input sequence:
9771
~~~
9872
"[value 0]\n[value 1]\n[etc.]"
@@ -102,26 +76,61 @@ Write a sequence of values to the SCA
10276
"42\n123\n555"
10377
~~~
10478
If an SCA error occurred, the sequence of return values will go up to that point, plus the error message
105-
If another type of error occurred (such as a formatting error), it will return a failure string.
106-
79+
If another type of error occurred (such as a formatting error), it will return a failure string.
10780
10881
#### SCA GPIO read
10982
Read the GPIO pins
11083
* Service type: RPC call
11184
* Service name: SCA_GPIO_READ
112-
* Parameters:
85+
* Parameters: empty
11386
* Return: SCA data
11487
11588
#### SCA GPIO write
11689
Set enabled the selected GPIO pins
11790
* Service type: RPC call
11891
* Service name: SCA_GPIO_WRITE
119-
* Parameters: SCA data
92+
* Parameters:
93+
* SCA data
12094
* Return: SCA data
12195
122-
#### Temperature
96+
#### PUBLISH_REGISTERS_START
97+
Starts a service that publishes the contents of the given register addresses at the specified interval.
98+
Values are published as array of 32 bit unsigned integers.
99+
The service will have the DNS name: `ALF/SERIAL_[serial number]/LINK_[link]/PUBLISH_REGISTERS/[service name]`.
100+
* Service type: RPC call
101+
* Parameters:
102+
* Service name
103+
* Interval in seconds. The server supports intervals with millisecond precision
104+
* Register addresses. Multiple may be given separated by newlines
105+
* Return: empty
106+
107+
#### PUBLISH_REGISTERS_STOP
108+
Stops a service started with PUBLISH_REGISTERS_START.
109+
* Service type: RPC call
110+
* Parameters:
111+
* Service name
112+
* Return: empty
113+
114+
#### PUBLISH_SCA_SEQUENCE_START
115+
Starts a service that executes and publishes the results of the given SCA sequence at the specified interval.
116+
Values are published as array of 32 bit unsigned integers (for format, see SCA_SEQUENCE).
117+
If an error occurred, the corresponding result will be set to 0xffffffff and the rest of the sequence is aborted.
118+
The service will have the DNS name: `ALF/SERIAL_[serial number]/LINK_[link]/PUBLISH_SCA_SEQUENCE/[service name]`.
119+
* Service type: RPC call
120+
* Parameters:
121+
* Service name
122+
* Interval in seconds. The server supports intervals with millisecond precision
123+
* SCA sequence (for format, see SCA_SEQUENCE)
124+
* Return: empty
125+
126+
#### PUBLISH_SCA_SEQUENCE_STOP
127+
Stops a service started with PUBLISH_SCA_SEQUENCE_START.
128+
* Service type: RPC call
129+
* Parameters:
130+
* Service name
131+
* Return: empty
132+
133+
#### CRU_TEMPERATURE
123134
Card's core temperature in degrees Celsius
124135
* Service type: Published
125-
* Service name: TEMPERATURE
126136
* Value type: double
127-

0 commit comments

Comments
 (0)