semtech_udp/packet/pull_ack.rs
1/*
2
3### 5.3. PULL_ACK packet ###
4
5That packet type is used by the server to confirm that the network route is
6open and that the server can send PULL_RESP packets at any time.
7
8 Bytes | Function
9:------:|---------------------------------------------------------------------
10 0 | protocol version = 2
11 1-2 | same token as the PULL_DATA packet to acknowledge
12 3 | PULL_ACK identifier 0x04
13
14 */
15
16use super::super::simple_down_packet;
17use super::{write_preamble, Error as PktError, Identifier, SerializablePacket};
18use std::io::{Cursor, Write};
19
20#[derive(Debug, Clone)]
21pub struct Packet {
22 pub random_token: u16,
23}
24
25simple_down_packet!(Packet, Identifier::PullAck);
26
27impl From<Packet> for super::Packet {
28 fn from(packet: Packet) -> super::Packet {
29 super::Packet::Down(super::Down::PullAck(packet))
30 }
31}