com.moxa.mxnportapi

## Class MxNPortService

- java.lang.Object
- - com.moxa.mxnportapi.MxNPortService

-     public class MxNPortService
      extends java.lang.Object

  The MxNPortService class offers service routines for MxNPorts in your system. These routines should be used before accessing MxNPort. For example, the program should use getNPortInfoList to get the list of MxNPort in your system before using any MxNPort object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MxNPortService()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<MxNPort>` | `getNPortInfoList()` Builds and returns a new List<`MxNPort`> from the connected NPort in the same subnet, or returns `null` if a NPort is not available in system.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MxNPortService

          public MxNPortService()

  - ### Method Detail

    - #### getNPortInfoList

          public static java.util.List<MxNPort> getNPortInfoList()

      Builds and returns a new List<`MxNPort`> from the connected NPort in the same subnet, or returns `null` if a NPort is not available in system. The ports are sorted in the sequence they are discovered.

      Example:

             // Get a MxNPort list from current network
             List<MxNPort> mNPortList = MxNPortService.getNPortInfoList();

             if( mNPortList!=null ){
                 // Process more tasks
             }

      Returns:
        A new List<`MxNPort`>, or `null` if no NPort is found.