restapi

package
v0.0.0-...-da18671 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: camerafocus.go provides a REST API for the camera focus control. -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: fixled.go provides the REST API endpoint to control the fix LED on the Merlin board. -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: irleds.go provides the REST API endpoint to control the IR LEDs on the Merlin board. -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: laser.go provides the REST API endpoint to control the laser on the Merlin board. -----------------------------------------------------------------------------

----------------------------------------------------------------------------- Copyright (c) 2024-2025 Sven C. Zeisberg, Zeisberg GmbH, Germany. All rights reserved. Description: This package provides a REST API for the Merlin board. The REST API is implemented using the standard library. The REST API provides the following endpoints: -----------------------------------------------------------------------------

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CameraExposure

type CameraExposure struct {
	Right int `json:"right"`
	Left  int `json:"left"`
}

CameraExposure is a struct to exchange the exposure of the cameras.

type CameraFocus

type CameraFocus struct {
	Right int `json:"right"`
	Left  int `json:"left"`
}

CameraFocus is a struct to exchange the focus of the cameras.

type CameraGain

type CameraGain struct {
	Right int `json:"right"`
	Left  int `json:"left"`
}

CameraFocus is a struct to exchange the focus of the cameras.

type LEDFuncStruct

type LEDFuncStruct struct {
	Right bool `json:"right"` // Right is the state of the right fix LED.
	Left  bool `json:"left"`  // Left is the state of the left fix LED.
}

LEDFuncStruct is a struct to control the fix LED on the Merlin board.

type LaserFuncStruct

type LaserFuncStruct struct {
	Laser bool `json:"laser"`
}

type RestAPI

type RestAPI struct {
	// contains filtered or unexported fields
}

func NewRestAPI

func NewRestAPI(appname string, m *merlin.Merlin, address string, port int) *RestAPI

NewRestAPI creates a new RestAPI object

func (*RestAPI) AddEndpoints

func (api *RestAPI) AddEndpoints()

func (*RestAPI) GET_cameraexposure

func (api *RestAPI) GET_cameraexposure(c *fiber.Ctx) error

GET_cameraexposure returns the exposure of the cameras as JSON object. The JSON object has the following structure:

{
  "right": <gain value>,
  "left": <gain value>
}

The exposure value is the current exposure of the cameras.

func (*RestAPI) GET_camerafocus

func (api *RestAPI) GET_camerafocus(c *fiber.Ctx) error

GET_camerafocus is a handler function to get the focus of the cameras.

func (*RestAPI) GET_cameragain

func (api *RestAPI) GET_cameragain(c *fiber.Ctx) error

GetGain returns the gain of the cameras as JSON object. The gain is the current gain of the cameras as reported by v4l2. The JSON object has the following structure:

{
  "right": <gain value>,
  "left": <gain value>
}

func (*RestAPI) GET_fixled

func (api *RestAPI) GET_fixled(c *fiber.Ctx) error

GET_fixled returns the status of the Fixation LEDs as JSON object. The JSON object has the following structure:

{
  "right": <status>,
  "left": <status>
}

The status is the current status of the Fixation LEDs.

func (*RestAPI) GET_irleds

func (api *RestAPI) GET_irleds(c *fiber.Ctx) error

GET_irleds returns the status of the IR LEDs as JSON object. The JSON object has the following structure:

{
  "right": <status>,
  "left": <status>
}

The status is the current status of the IR LEDs.

func (*RestAPI) GET_laser

func (api *RestAPI) GET_laser(c *fiber.Ctx) error

GET_laser returns the status of the Laser as JSON object. The JSON object has the following structure:

{
  "laser": <status>
}

The status is the current status of the Laser.

func (*RestAPI) PUT_cameraexposure

func (api *RestAPI) PUT_cameraexposure(c *fiber.Ctx) error

PUT_cameraexposure sets the exposure in the cameras if streaming is on

func (*RestAPI) PUT_camerafocus

func (api *RestAPI) PUT_camerafocus(c *fiber.Ctx) error

PUT_camerafocus is a handler function to set the focus of the cameras.

func (*RestAPI) PUT_cameragain

func (api *RestAPI) PUT_cameragain(c *fiber.Ctx) error

SetCamGain sets the gain in the cameras if streaming is on

func (*RestAPI) PUT_fixled

func (api *RestAPI) PUT_fixled(c *fiber.Ctx) error

PUT_fixled sets the status of the Fixation LEDs.

func (*RestAPI) PUT_irleds

func (api *RestAPI) PUT_irleds(c *fiber.Ctx) error

PUT_irleds sets the status of the IR LEDs.

func (*RestAPI) PUT_laser

func (api *RestAPI) PUT_laser(c *fiber.Ctx) error

PUT_laser sets the status of the Laser.

func (*RestAPI) Start

func (api *RestAPI) Start()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL