GPIO Namespace

This namespace provides a .Net binding to the MuntsOS GPIO ONC/RPC server.
Classes
 | Class | Description
Public class | Exception | This exception will be raised upon any error encountered while communicating with the ONC/RPC server.
Public class | Pin | This class encapsulates a single GPIO pin.
Public class | Server | This class encapsulates a connection to a single MuntsOS ONC/RPC GPIO server.
Enumerations
 | Enumeration | Description
Public enumeration | Direction | This enumeration type encapsulates GPIO data direction configuration values.
Send comments on this topic to Philip Munts


Direction Enumeration

This enumeration type encapsulates GPIO data direction configuration values.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public enum Direction
Public Enumeration Direction
public enum class Direction
type Direction
Members
Member name | Value | Description
Input | 0 | Configure GPIO pin data direction as input.
Output | 1 | Configure GPIO pin data direction as output.
See Also

Reference

GPIO Namespace


Exception Class

This exception will be raised upon any error encountered while communicating with the ONC/RPC server.
Inheritance Hierarchy
SystemObject
SystemException
GPIOException

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public class Exception : Exception
Public Class Exception
    Inherits Exception
public ref class Exception : public Exception
type Exception =
    class
        inherit Exception
    end
Constructors
 | Name | Description
Public method | Exception | Default constructor without parameters.
Public method | Exception(String) | Constructor including an error message string
Top
See Also

Reference

GPIO Namespace
Send comments on this topic to Philip Munts


Exception Constructor

Overload List
 | Name | Description
Public method | Exception | Default constructor without parameters.
Public method | Exception(String) | Constructor including an error message string
Top
See Also

Reference

Exception Class


Exception Constructor

Default constructor without parameters.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public Exception()
Public Sub New
public:
Exception()
new : unit -> Exception
See Also

Reference

Exception Class
Exception Overload


Exception Constructor (String)

Constructor including an error message string

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public Exception(
    string message
)
Public Sub New (
    message As String
)
public:
Exception(
    String^ message
)
new :
        message : string -> Exception

Parameters

message
Type: SystemString
Error message
See Also

Reference

Exception Class
Exception Overload


Pin Class

This class encapsulates a single GPIO pin.
Inheritance Hierarchy
SystemObject
GPIOPin

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public class Pin
Public Class Pin
public ref class Pin
type Pin =  class end

The Pin type exposes the following members.

Constructors
 | Name | Description
Public method | Pin | GPIO pin object constructor.
Top
Properties
 | Name | Description
Public property | state | This read/write property reflects the state of the GPIO pin.
Top
See Also

Reference

GPIO Namespace
Send comments on this topic to Philip Munts


Pin Constructor

GPIO pin object constructor.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public Pin(
    gpio_server_oncrpcClient server,
    int number
)
Public Sub New (
    server As gpio_server_oncrpcClient,
    number As Integer
)
public:
Pin(
    gpio_server_oncrpcClient^ server,
    int number
)
new :
        server : gpio_server_oncrpcClient *
        number : int -> Pin

Parameters

server
Type: gpio_server_oncrpcClient
ONC/RPC server handle.
number
Type: SystemInt32
GPIO pin number.
Remarks
Do not call this constructor directly; use the Server.OpenPin() factory method instead.
See Also

Reference

Pin Class


Pin Properties

The Pin type exposes the following members.

Properties
 | Name | Description
Public property | state | This read/write property reflects the state of the GPIO pin.
Top
See Also

Reference

Pin Class


Pin.state Property

GPIO ONC/RPC Client Library

Pinstate Property

This read/write property reflects the state of the GPIO pin.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public bool state { get; set; }
Public Property state As Boolean
    Get
    Set
public:
property bool state {
    bool get ();
    void set (bool value);
}
member state : bool with get, set

Property Value

Type: Boolean
Allowed values are true or false.
Remarks
Writing to a pin configured for input has no effect.
See Also

Reference

Pin Class


Server Class

This class encapsulates a connection to a single MuntsOS ONC/RPC GPIO server.
Inheritance Hierarchy
SystemObject
GPIOServer

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public class Server
Public Class Server
public ref class Server
type Server =  class end

The Server type exposes the following members.

Constructors
 | Name | Description
Public method | Server | Open a connection to a ONC/RPC GPIO server.
Top
Methods
 | Name | Description
Public method | OpenPin | This factory method configures the specified GPIO pin and returns a Pin object for it.
Top
See Also

Reference

GPIO Namespace
Send comments on this topic to Philip Munts


Server Constructor

Open a connection to a ONC/RPC GPIO server.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public Server(
    string servername
)
Public Sub New (
    servername As String
)
public:
Server(
    String^ servername
)
new :
        servername : string -> Server

Parameters

servername
Type: SystemString
Server domain name or IP address.
See Also

Reference

Server Class


Server Methods

The Server type exposes the following members.

Methods
 | Name | Description
Public method | OpenPin | This factory method configures the specified GPIO pin and returns a Pin object for it.
Top
See Also

Reference

Server Class


Server.OpenPin Method

GPIO ONC/RPC Client Library

ServerOpenPin Method

This factory method configures the specified GPIO pin and returns a Pin object for it.

Namespace: GPIO
Assembly: GPIO-ONC-RPC-Lib (in GPIO-ONC-RPC-Lib.dll) Version: 1.0.6366.12094
Syntax
C#
VB
C++
F#
Copy
public Pin OpenPin(
    int number,
    Direction direction,
    bool state = false
)
Public Function OpenPin (
    number As Integer,
    direction As Direction,
    Optional state As Boolean = false
) As Pin
public:
Pin^ OpenPin(
    int number,
    Direction direction,
    bool state = false
)
member OpenPin :
        number : int *
        direction : Direction *
        ?state : bool
(* Defaults:
        let _state = defaultArg state false
*)
-> Pin

Parameters

number
Type: SystemInt32
GPIO pin number.
direction
Type: GPIODirection
GPIO pin direction, GPIO.Direction.Input or GPIO.Direction.Output.
state (Optional)
Type: SystemBoolean
GPIO output pin initial state, true or false. Ignored for input pin.

Return Value

Type: Pin
Returns a configured GPIO Pin object.
See Also

Reference

Server Class