Skip to content
Markus Grönholm edited this page Jun 11, 2026 · 4 revisions

ADAPT

Alshain Device Access ProTocol is a fixed-length message protocol used by all Alshain Oy products.

Communication is done using a request-response flow with (usually) one host sending requests to many devices.

Message format


All messages are fixed to 10 bytes in length

|   0  |  1 | 2 3 4 5 6 8 9 10 |
| ADDR | OP |     PAYLOAD      |

 * ADDR = device address, 1 .. 253
     * 0 = broadcast address, all devices receive message, but do not respond
     * 254, 255 = reserved for device-specific use
 * OP = Operation, MSB is set if message is a response
 * PAYLOAD = 8 bytes of payload

Byte ordering for all fields is big-endian (network byte order).


For all messages, when device sends a response, it uses its own address in the address field 
and sets MSB of OP field to 1 to indicate a response.

*** Standard messages (supported by all devices) ***

-- WRITE (OP = 0x01) --
Request:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x01 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value
 * VALUE = 32 bit signed value

Response:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x81 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value ( which key was written )
 * VALUE = 32 bit signed value ( which value was written )

For floating point values, the VALUE field is treated as 32 bit floating point number


-- READ (OP = 0x02 ) --
Request:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x02 |   KEY   |   xxxx   |

 * KEY = 32 bit unsigned value
 * Last 4 bytes are ignored

Response:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x82 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value ( which key was read )
 * VALUE = 32 bit signed value ( value at that key )


For floating point values, the VALUE field is treated as 32 bit floating point number


-- WRITE MEM (OP = 0x19) --
Write to non-volatile memory

Request:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x19 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value
 * VALUE = 32 bit signed value

Response:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x99 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value ( which key was written )
 * VALUE = 32 bit signed value ( which value was written )

For floating point values, the VALUE field is treated as 32 bit floating point number

-- READ MEM (OP = 0x20) --
Read from non-volatile memory

Request:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0x20 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value
 * VALUE = 32 bit signed value

Response:
|   0  |  1   | 2 3 4 5 | 6 8 9 10 |
| ADDR | 0xA0 |   KEY   |   VALUE  |

 * KEY = 32 bit unsigned value ( which key was written )
 * VALUE = 32 bit signed value ( which value was written )

For floating point values, the VALUE field is treated as 32 bit floating point number



Clone this wiki locally