Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Extension IPC Callee

TheSnowfield edited this page Jul 23, 2021 · 4 revisions

IPC Callee

If the flag of the caller's event is set to Need Result, the callee must respond to the caller else can ignore it.

Structure

Length

|Len        |
+--+--+--+--+
|01|00|00|00|
+--+--+--+--+
0     2     4

It specifies the length of the data, including itself.
It's a 4 bytes little-endian unsigned integer.
In this example, the length is 1.

Metadata

Metadata is fixed with 6 items but only 4 used.
For reserved items please set them to 0x00. The length of each item is 2 bytes.

|Ver  |Seq  |Flg  |Arg  |
+--+--+--+--+--+--+--+--+
|01|00|E9|00|00|00|00|00|
+--+--+--+--+--+--+--+--+
0     2     4     6     8
  1. The protocol version, which contains an unsigned short in little-endian.
    In this example, the version is 1.

  2. The event sequence, must equals with caller's sequence.

  3. The event flag, the callee must set it to 0.

  4. The argument count, the callee must set it to 1.

Result

Raw result data with 0x00 0x00 and its length ahead.

|Zero |Len        |Result     |
+--+--+--+--+--+--+--+--+--+--+
|00|00|04|00|00|00|01|00|00|00|
+--+--+--+--+--+--+--+--+--+--+
0     2     4     6     8     A

In this example, the result value can be 1 or true, depends on the event convention.

Checksum

|S.|
+--+
|FE|
+--+
0  1

The checksum is very simple only 1 byte.
Calculate the sum with every single byte and placed it at the end of the data. including the length.

In this example, the original data is FF FF, so finally the checksum is FE.