chore: use PROTO_VER marco
This commit is contained in:
parent
439fb3a403
commit
8e4c2c88c3
|
@ -58,6 +58,8 @@
|
||||||
|
|
||||||
-define(SUBOPTS, #{rh => 0, rap => 0, nl => 0, qos => ?QOS_0, is_new => false}).
|
-define(SUBOPTS, #{rh => 0, rap => 0, nl => 0, qos => ?QOS_0, is_new => false}).
|
||||||
|
|
||||||
|
-define(PROTO_VER, 1).
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% API
|
%% API
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -260,7 +262,7 @@ packet_to_message(Topic, Payload,
|
||||||
emqx_message:make(ClientId, ?QOS_0, Topic, Payload)
|
emqx_message:make(ClientId, ?QOS_0, Topic, Payload)
|
||||||
),
|
),
|
||||||
emqx_message:set_headers(
|
emqx_message:set_headers(
|
||||||
#{ proto_ver => 1
|
#{ proto_ver => ?PROTO_VER
|
||||||
, protocol => coap
|
, protocol => coap
|
||||||
, username => Username
|
, username => Username
|
||||||
, peerhost => PeerHost}, Message).
|
, peerhost => PeerHost}, Message).
|
||||||
|
@ -335,7 +337,7 @@ conninfo(#state{peername = Peername,
|
||||||
peercert => nossl, %% TODO: dtls
|
peercert => nossl, %% TODO: dtls
|
||||||
conn_mod => ?MODULE,
|
conn_mod => ?MODULE,
|
||||||
proto_name => <<"CoAP">>,
|
proto_name => <<"CoAP">>,
|
||||||
proto_ver => 1,
|
proto_ver => ?PROTO_VER,
|
||||||
clean_start => true,
|
clean_start => true,
|
||||||
clientid => ClientId,
|
clientid => ClientId,
|
||||||
username => undefined,
|
username => undefined,
|
||||||
|
|
Loading…
Reference in New Issue