Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup bogus docstrings.

  • Loading branch information...
commit f3f2c3f741caba0a7b894328d30f8f2d61928bcd 1 parent f95800e
@archaelus authored
Showing with 1 addition and 53 deletions.
  1. +1 −53 src/enet_eth_iface.erl
View
54 src/enet_eth_iface.erl
@@ -36,11 +36,7 @@
%%====================================================================
%% API
%%====================================================================
-%%--------------------------------------------------------------------
-%% @spec start_link(Device, OSIfconfig) -> {ok,Pid} | ignore | {error,Error}
-%% @doc Starts the server
-%% @end
-%%--------------------------------------------------------------------
+
start_link(Device, IfConfig) when is_list(Device), is_list(IfConfig) ->
gen_server:start_link(?MODULE, [#state{dev=Device,
mac=?DEFAULT_MAC}, IfConfig], []).
@@ -55,33 +51,14 @@ send(Interface, Data) ->
%% gen_server callbacks
%%====================================================================
-%%--------------------------------------------------------------------
%% @private
-%% @spec init(Args) -> {ok, State} |
-%% {ok, State, Timeout} |
-%% ignore |
-%% {stop, Reason}
-%% @doc Initialises the server's state
-%% @end
-%%--------------------------------------------------------------------
init([S = #state{dev=Device}, IfConfig]) ->
Port = enet_tap:open(Device),
{ok, S#state{port=Port
,osifconfig=IfConfig
,pubsub=pubsub:new()}}.
-%%--------------------------------------------------------------------
%% @private
-%% @spec
-%% handle_call(Request, From, State) -> {reply, Reply, State} |
-%% {reply, Reply, State, Timeout} |
-%% {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, Reply, State} |
-%% {stop, Reason, State}
-%% @doc Call message handler callbacks
-%% @end
-%%--------------------------------------------------------------------
handle_call({pubsub, Op}, _From, S = #state{pubsub=P}) ->
NewPub = pubsub:process_msg(Op, P),
{reply, ok, S#state{pubsub=NewPub}};
@@ -89,15 +66,7 @@ handle_call(Call, _From, State) ->
?WARN("Unexpected call ~p.", [Call]),
{noreply, State}.
-%%--------------------------------------------------------------------
%% @private
-%% @spec
-%% handle_cast(Msg, State) -> {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State}
-%% @doc Cast message handler callbacks
-%% @end
-%%--------------------------------------------------------------------
handle_cast({send, #raw{data=Frame}}, S = #state{port=P})
when is_port(P), is_binary(Frame) ->
publish_tx(Frame, unknown, S),
@@ -107,15 +76,7 @@ handle_cast(Msg, State) ->
?WARN("Unexpected cast ~p", [Msg]),
{noreply, State}.
-%%--------------------------------------------------------------------
%% @private
-%% @spec
-%% handle_info(Info, State) -> {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State}
-%% @doc Non gen-server message handler callbacks
-%% @end
-%%--------------------------------------------------------------------
handle_info({Port, {exit_status, N}}, S = #state{port=Port}) ->
{stop, {interface_shutdown, N}, S#state{port=undefined}};
handle_info({Port, {data, PortPacket}}, S = #state{port=Port}) ->
@@ -151,27 +112,14 @@ handle_frame(Frame, S) ->
end,
{noreply, S}.
-%%--------------------------------------------------------------------
%% @private
-%% @spec terminate(Reason, State) -> void()
-%% @doc This function is called by a gen_server when it is about to
-%% terminate. It should be the opposite of Module:init/1 and do any necessary
-%% cleaning up. When it returns, the gen_server terminates with Reason.
-%% The return value is ignored.
-%% @end
-%%--------------------------------------------------------------------
terminate(Reason, S = #state{port=P}) when is_port(P) ->
catch enet_tap:close(P),
terminate(Reason, S#state{port=undefined});
terminate(_Reason, _State) ->
ok.
-%%--------------------------------------------------------------------
%% @private
-%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}
-%% @doc Convert process state when code is changed
-%% @end
-%%--------------------------------------------------------------------
code_change(_OldVsn, {state, Dev, Port, Pubsub, Osifconfig}, _Extra) ->
{state, Dev, ?DEFAULT_MAC, Port, Pubsub, Osifconfig};
code_change(_OldVsn, State, _Extra) ->
Please sign in to comment.
Something went wrong with that request. Please try again.