Skip to content

Ben's Thoughts on Message Structure

Ben Templin edited this page May 22, 2021 · 3 revisions

Fields

Here are the fields I think we're going to need to include in a message and a brief description:

field description comments
dst destination of the message I think we should use some type of hashed username for this so it has a standard length. We could do a hash-table to store all the users or something, idk.
src source of the message Same as dst, I think we should use a hash.
tmstmp_lcl timestamp message was sent from device
tmstmp_srv timestamp message was received at server This will initially be NULL when the message is sent.
type what kind of message it is See below for possible type values I'm thinking we'll need.
id_no numerical reference value A unique number to reference this message.
ref id_no of message to reference For use in things like replies or reactions
payload data to send

Type Values

Possible type values I think we'll need:

value name description Visible to User (Y/N)
-1 ERR Error message N
0 MSG Standard message Y
1 RPLY Reply to message Y
2 REAC Reaction to message Y
3 AUTH Request for authentication to server N
4 AACK Authentication acknowledgement from server N
5 ALIV Is this device alive? N
6 ACK Acknowledgement N
7 DBM Database message (for transferring messages b/t devices) N

Message Examples

Here are some example messages with values (in json format) and what the message means:

Clone this wiki locally