#[test]
fn test_disconnect_packet() {
let buf = [0xe0, 0x00];
let parsed = MqttPacket::parse_complete(&buf).unwrap();
}
this is not working unfortunately results in an error:
called `Result::unwrap()` on an `Err` value: Backtrack(ContextError { context: PhantomData<winnow::error::StrContext> })
thread 'v5::packets::disconnect::test::test_disconnect_packet' panicked at mqtt-format/src/v5/packets/disconnect.rs:144:55:
called `Result::unwrap()` on an `Err` value: Backtrack(ContextError { context: PhantomData<winnow::error::StrContext> })
stack backtrace:
The disconnect packet seems to be a special case.
In the standard there is written:
The Client or Server sending the DISCONNECT packet MUST use one of the DISCONNECT Reason Code values [MQTT-3.14.2-1]. The Reason Code and Property Length can be omitted if the Reason Code is 0x00 (Normal disconnecton) and there are no Properties. In this case the DISCONNECT has a Remaining Length of 0.
If using this command to publish a message the parser fails parsing the disconnect packet:
this is not working unfortunately results in an error:
The disconnect packet seems to be a special case. In the standard there is written:
PR incoming...