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
/*
### 3.3. PUSH_ACK packet ###
That packet type is used by the server to acknowledge immediately all the
PUSH_DATA packets received.
Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 2
1-2 | same token as the PUSH_DATA packet to acknowledge
3 | PUSH_ACK identifier 0x01
*/
use super::super::simple_down_packet;
use super::{write_preamble, Error as PktError, Identifier, SerializablePacket};
use std::io::{Cursor, Write};
#[derive(Debug, Clone)]
pub struct Packet {
pub random_token: u16,
}
simple_down_packet!(Packet, Identifier::PushAck);
impl From<Packet> for super::Packet {
fn from(packet: Packet) -> super::Packet {
super::Packet::Down(super::Down::PushAck(packet))
}
}