Add type/1, qos/1 functions

This commit is contained in:
Feng Lee 2019-09-05 15:00:54 +08:00
parent 847375d2fb
commit 451f0451ce
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,10 @@
-include("emqx.hrl").
-include("emqx_mqtt.hrl").
-export([ type/1
, qos/1
]).
-export([ proto_name/1
, type_name/1
, validate/1
@ -30,6 +34,12 @@
-compile(inline).
type(#mqtt_packet{header = #mqtt_packet_header{type = Type}}) ->
Type.
qos(#mqtt_packet{header = #mqtt_packet_header{qos = QoS}}) ->
QoS.
%% @doc Protocol name of the version.
-spec(proto_name(emqx_types:version()) -> binary()).
proto_name(?MQTT_PROTO_V3) ->