controllers

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceConfigController

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

func NewDeviceConfigController

func NewDeviceConfigController(settings *config.Settings, logger *zerolog.Logger, database *sql.DB, userDeviceSvc services.UserDeviceService, deviceDefSvc services.DeviceDefinitionsService) DeviceConfigController

NewDeviceConfigController constructor

func (*DeviceConfigController) GetConfigURLs

func (d *DeviceConfigController) GetConfigURLs(c *fiber.Ctx, ud *pb.UserDevice) error

func (*DeviceConfigController) GetConfigURLsFromEthAddr added in v0.3.2

func (d *DeviceConfigController) GetConfigURLsFromEthAddr(c *fiber.Ctx) error

GetConfigURLsFromEthAddr godoc @Description Retrieve the URLs for PID, DeviceSettings, and DBC configuration based on device's Ethereum Address @Tags vehicle-signal-decoding @Produce json @Success 200 {object} DeviceConfigResponse "Successfully retrieved configuration URLs" @Failure 404 "Not Found - No templates available for the given parameters" @Param ethAddr path string false "Ethereum Address" @Router /device-config/eth-addr/{ethAddr}/urls [get]

func (*DeviceConfigController) GetConfigURLsFromVIN added in v0.3.2

func (d *DeviceConfigController) GetConfigURLsFromVIN(c *fiber.Ctx) error

GetConfigURLsFromVIN godoc @Description Retrieve the URLs for PID, DeviceSettings, and DBC configuration based on a given VIN @Tags vehicle-signal-decoding @Produce json @Success 200 {object} DeviceConfigResponse "Successfully retrieved configuration URLs" @Failure 404 "Not Found - No templates available for the given parameters" @Param vin path string true "vehicle identification number (VIN)" @Router /device-config/vin/{vin}/urls [get]

func (*DeviceConfigController) GetDBCFileByTemplateName

func (d *DeviceConfigController) GetDBCFileByTemplateName(c *fiber.Ctx) error

GetDBCFileByTemplateName godoc @Description Fetches the DBC file from the dbc_files table given a template name @Tags vehicle-signal-decoding @Produce plain @Success 200 {string} string "Successfully retrieved DBC file" @Failure 404 "No DBC file found for the given template name." @Param templateName path string true "template name" @Router /device-config/{templateName}/dbc [get]

func (*DeviceConfigController) GetDeviceSettingsByTemplate

func (d *DeviceConfigController) GetDeviceSettingsByTemplate(c *fiber.Ctx) error

GetDeviceSettingsByTemplate godoc @Description Fetches the device settings configurations from device_settings table given a template name @Tags vehicle-signal-decoding @Produce json @Success 200 {object} DeviceSetting "Successfully retrieved Device Settings" @Failure 404 "No Device Settings data found for the given template name." @Param templateName path string true "template name" @Router /device-config/{templateName}/deviceSettings [get]

func (*DeviceConfigController) GetPIDsByTemplate

func (d *DeviceConfigController) GetPIDsByTemplate(c *fiber.Ctx) error

GetPIDsByTemplate godoc @Description Retrieves a list of PID configurations from the database given a template name @Tags vehicle-signal-decoding @Produce json @Success 200 {object} grpc.PIDRequests "Successfully retrieved PID Configurations" @Failure 404 "No PID Config data found for the given template name." @Param templateName path string true "template name" @Router /device-config/{templateName}/pids [get]

type DeviceConfigResponse added in v0.2.8

type DeviceConfigResponse struct {
	PidURL           string `json:"pidUrl"`
	DeviceSettingURL string `json:"deviceSettingUrl"`
	DbcURL           string `json:"dbcURL,omitempty"`
	Version          string `json:"version"`
}

type DeviceSetting

type DeviceSetting struct {
	TemplateName                           string `json:"template_name"`
	BatteryCriticalLevelVoltage            string `json:"battery_critical_level_voltage"`
	SafetyCutOutVoltage                    string `json:"safety_cut_out_voltage"`
	SleepTimerEventDrivenInterval          string `json:"sleep_timer_event_driven_interval"`
	SleepTimerEventDrivenPeriod            string `json:"sleep_timer_event_driven_period"`
	SleepTimerInactivityAfterSleepInterval string `json:"sleep_timer_inactivity_after_sleep_interval"`
	SleepTimerInactivityFallbackInterval   string `json:"sleep_timer_inactivity_fallback_interval"`
	WakeTriggerVoltageLevel                string `json:"wake_trigger_voltage_level"`
}

type PIDConfig

type PIDConfig struct {
	ID              int64  `json:"id"`
	TemplateName    string `json:"template_name,omitempty"`
	Header          []byte `json:"header"`
	Mode            []byte `json:"mode"`
	Pid             []byte `json:"pid"`
	Formula         string `json:"formula"`
	IntervalSeconds int    `json:"interval_seconds"`
	Protocol        string `json:"protocol,omitempty"`
}

Jump to

Keyboard shortcuts

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