semtech_udp/packet/
push_ack.rs

1/*
2
3### 3.3. PUSH_ACK packet ###
4
5That packet type is used by the server to acknowledge immediately all the
6PUSH_DATA packets received.
7
8 Bytes  | Function
9:------:|---------------------------------------------------------------------
10 0      | protocol version = 2
11 1-2    | same token as the PUSH_DATA packet to acknowledge
12 3      | PUSH_ACK identifier 0x01
13
14 */
15use super::super::simple_down_packet;
16use super::{write_preamble, Error as PktError, Identifier, SerializablePacket};
17use std::io::{Cursor, Write};
18
19#[derive(Debug, Clone)]
20pub struct Packet {
21    pub random_token: u16,
22}
23
24simple_down_packet!(Packet, Identifier::PushAck);
25
26impl From<Packet> for super::Packet {
27    fn from(packet: Packet) -> super::Packet {
28        super::Packet::Down(super::Down::PushAck(packet))
29    }
30}