-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathNetworkProtocol.cpp
33 lines (29 loc) · 1.26 KB
/
NetworkProtocol.cpp
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
/*---------------------------------------------------------*\
| NetworkProtocol.cpp |
| |
| OpenRGB SDK network protocol |
| |
| Adam Honse (CalcProgrammer1) 09 May 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include <cstring>
#include "NetworkProtocol.h"
/*-----------------------------------------------------*\
| OpenRGB SDK Magic Value "ORGB" |
\*-----------------------------------------------------*/
const char openrgb_sdk_magic[OPENRGB_SDK_MAGIC_SIZE] = { 'O', 'R', 'G', 'B' };
void InitNetPacketHeader
(
NetPacketHeader * pkt_hdr,
unsigned int pkt_dev_idx,
unsigned int pkt_id,
unsigned int pkt_size
)
{
memcpy(pkt_hdr->pkt_magic, openrgb_sdk_magic, sizeof(openrgb_sdk_magic));
pkt_hdr->pkt_dev_idx = pkt_dev_idx;
pkt_hdr->pkt_id = pkt_id;
pkt_hdr->pkt_size = pkt_size;
}