chore: use PROTO_VER marco

This commit is contained in:
JianBo He 2021-11-12 10:45:26 +08:00
parent 439fb3a403
commit 8e4c2c88c3
1 changed files with 4 additions and 2 deletions

View File

@ -58,6 +58,8 @@
-define(SUBOPTS, #{rh => 0, rap => 0, nl => 0, qos => ?QOS_0, is_new => false}).
-define(PROTO_VER, 1).
%%--------------------------------------------------------------------
%% API
%%--------------------------------------------------------------------
@ -260,7 +262,7 @@ packet_to_message(Topic, Payload,
emqx_message:make(ClientId, ?QOS_0, Topic, Payload)
),
emqx_message:set_headers(
#{ proto_ver => 1
#{ proto_ver => ?PROTO_VER
, protocol => coap
, username => Username
, peerhost => PeerHost}, Message).
@ -335,7 +337,7 @@ conninfo(#state{peername = Peername,
peercert => nossl, %% TODO: dtls
conn_mod => ?MODULE,
proto_name => <<"CoAP">>,
proto_ver => 1,
proto_ver => ?PROTO_VER,
clean_start => true,
clientid => ClientId,
username => undefined,