fix(gateways): hardcode the listener and zone names

This commit is contained in:
Shawn 2021-07-15 14:26:12 +08:00
parent f6702b020e
commit bcae0cbb50
3 changed files with 6 additions and 3 deletions

View File

@ -371,7 +371,8 @@ clientinfo(#state{peername = {PeerHost, _},
clientid = ClientId, clientid = ClientId,
username = Username, username = Username,
password = Password}) -> password = Password}) ->
#{zone => undefined, #{zone => default,
listener => mqtt_tcp, %% FIXME: this won't work
protocol => coap, protocol => coap,
peerhost => PeerHost, peerhost => PeerHost,
sockport => 5683, %% FIXME: sockport => 5683, %% FIXME:

View File

@ -219,7 +219,8 @@ send(Data, #state{socket = {esockd_transport, Sock}}) ->
-define(DEFAULT_GC_OPTS, #{count => 1000, bytes => 1024*1024}). -define(DEFAULT_GC_OPTS, #{count => 1000, bytes => 1024*1024}).
-define(DEFAULT_IDLE_TIMEOUT, 30000). -define(DEFAULT_IDLE_TIMEOUT, 30000).
-define(DEFAULT_OOM_POLICY, #{max_heap_size => 4194304,message_queue_len => 32000}). -define(DEFAULT_OOM_POLICY, #{enable => true, max_heap_size => 4194304,
max_message_queue_len => 32000}).
init(Parent, WrappedSock, Peername, Options) -> init(Parent, WrappedSock, Peername, Options) ->
case esockd_wait(WrappedSock) of case esockd_wait(WrappedSock) of

View File

@ -441,7 +441,8 @@ take_place(Text, Placeholder, Value) ->
clientinfo(#lwm2m_state{peername = {PeerHost, _}, clientinfo(#lwm2m_state{peername = {PeerHost, _},
endpoint_name = EndpointName, endpoint_name = EndpointName,
mountpoint = Mountpoint}) -> mountpoint = Mountpoint}) ->
#{zone => undefined, #{zone => default,
listener => mqtt_tcp, %% FIXME: this won't work
protocol => lwm2m, protocol => lwm2m,
peerhost => PeerHost, peerhost => PeerHost,
sockport => 5683, %% FIXME: sockport => 5683, %% FIXME: