Skip to content

Commit b3468e6

Browse files
author
CI
committed
Sync to GitHub
1 parent ec080ef commit b3468e6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/bacnet/stack/transport/mstp_transport.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if Code.ensure_loaded?(Circuits.UART) do
217217
local_address: 0..254,
218218
log_communication: boolean(),
219219
max_info_frames: pos_integer(),
220-
max_master_address: 0..127,
220+
max_master_address: 1..127,
221221
port_name: binary(),
222222
supervisor: Supervisor.supervisor()
223223
},
@@ -351,7 +351,7 @@ if Code.ensure_loaded?(Circuits.UART) do
351351
| {:log_communication, boolean()}
352352
| {:log_communication_rcv, boolean()}
353353
| {:max_info_frames, pos_integer()}
354-
| {:max_master_address, 0..127}
354+
| {:max_master_address, 1..127}
355355
| {:port_name, binary()}
356356
| {:supervisor, Supervisor.supervisor()}
357357
| GenServer.option()
@@ -479,7 +479,7 @@ if Code.ensure_loaded?(Circuits.UART) do
479479
- `log_communication_rcv: boolean()` - Optional. Logs all communication (debug) of receive states.
480480
- `max_info_frames: pos_integer()` - Optional. This value specifies the maximum number of information
481481
frames the node may send before it must pass the token (defaults to `1`).
482-
- `max_master_address: 0..127` - Optional. The maximum master address that is used in the MS/TP network.
482+
- `max_master_address: 1..127` - Optional. The maximum master address that is used in the MS/TP network.
483483
This is used for polling and successor determination (defaults to `127`).
484484
- `port_name: binary()` - Required. Name of the serial port (use `Circuits.UART.enumerate/0`).
485485
- `supervisor: Supervisor.supervisor()` - Optional. The task supervisor to use to spawn tasks under.
@@ -840,7 +840,7 @@ if Code.ensure_loaded?(Circuits.UART) do
840840
This function will block until the Test-Response APDU has arrived
841841
or the timeout triggers.
842842
"""
843-
@spec send_test(GenServer.server(), source_address(), iodata()) ::
843+
@spec send_test(TransportBehaviour.portal(), source_address(), iodata()) ::
844844
{:ok, iodata()}
845845
| {:error, term()}
846846
| {:error, :invalid_frame_response}
@@ -1828,7 +1828,7 @@ if Code.ensure_loaded?(Circuits.UART) do
18281828
ReceiveFSM.close(state.receive_fsm)
18291829
UART.close(state.uart_pid)
18301830

1831-
{:stop, {:uart_error, reason}, state}
1831+
exit({:uart_error, reason})
18321832
end
18331833

18341834
defp do_handle_info(:wakeup_use_token, %State{} = state) do
@@ -4016,13 +4016,13 @@ if Code.ensure_loaded?(Circuits.UART) do
40164016
nil ->
40174017
:ok
40184018

4019-
term when is_integer(term) and term >= @min_master_addr and term <= @max_master_addr ->
4019+
term when is_integer(term) and term >= 1 and term <= 127 ->
40204020
:ok
40214021

40224022
term ->
40234023
raise ArgumentError,
40244024
mfa <>
4025-
" expected max_master_address to be an integer in the range 0-127, " <>
4025+
" expected max_master_address to be an integer in the range 1-127, " <>
40264026
"got: #{inspect(term)}"
40274027
end
40284028

0 commit comments

Comments
 (0)