VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
release_node_num_serialize.c
Go to the documentation of this file.
1
#include "
vlcb/net/packet/datagram/module.h
"
2
3
#include <assert.h>
4
#include <memory.h>
5
#include <stddef.h>
6
7
#include "
vlcb/platform/endian.h
"
8
9
inline
void
vlcb_net_pkt_dgram_module_ReleaseNodeNumber_serialize
(
10
VlcbNetPacketDatagram
*
const
packet, VlcbNetDgramReleaseNodeNumber data) {
11
assert(packet != NULL);
12
data.nodeNumber =
htons
(data.nodeNumber);
13
packet->
opc
=
VLCB_OPC_NODE_NUMBER_RELEASED
;
14
packet->
payload_len
=
sizeof
(data.nodeNumber);
15
memcpy(&packet->
payload
, &data.nodeNumber,
sizeof
(data.nodeNumber));
16
}
endian.h
htons
static uint16_t htons(uint16_t hostshort)
Definition
endian.h:21
module.h
vlcb_net_pkt_dgram_module_ReleaseNodeNumber_serialize
void vlcb_net_pkt_dgram_module_ReleaseNodeNumber_serialize(VlcbNetPacketDatagram *const packet, VlcbNetDgramReleaseNodeNumber data)
Definition
release_node_num_serialize.c:9
VlcbNetPacketDatagram
Definition
packet/datagram.h:19
VlcbNetPacketDatagram::payload
VlcbNetDatagramPayload payload
Definition
packet/datagram.h:22
VlcbNetPacketDatagram::opc
VlcbOpCode opc
Definition
packet/datagram.h:20
VlcbNetPacketDatagram::payload_len
uint8_t payload_len
Definition
packet/datagram.h:21
VLCB_OPC_NODE_NUMBER_RELEASED
@ VLCB_OPC_NODE_NUMBER_RELEASED
Definition
vlcb_defs.h:812
net
src
packet
datagram
module
release_node_num_serialize.c
Generated on Mon Nov 4 2024 09:13:33 for VLCB SDK by
1.12.0