pcr2

package module
v0.0.0-...-9486dc2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 5 Imported by: 0

README

PCR2 cli config tool

The PCR2-IN is a useful sensor to determine whether persons or objects move through in a certain direction. Unfortunately the company behind this sensor only delivers a configuration tool for Microsoft Windows. Since I don't have any Windows machines at home and COVID-19 prevented me from visiting colleagues with Windows machines, I decided to write a small cli configuration tool which should be fairly cross platform and should also be usable for mass provisioning of these devices.

Usage Examples

This cli mostly follows the serial port cli described here, but adds some convience over using something like miniterm

  • Read type string pcr2 get typestr
  • Read device temperaturepcr2 get temp
  • Set radar sensitivity pcr2 set sens 50
  • Set LoRa AppKey pcr2 lora set appkey <appkey>

Known issues

  • clear command does not work. My test device reports that this command is not known. Might be outdated firmware
  • l1,l2,r1,r2 commands do not work. Probably an outdated firmware on the test device.

Documentation

Index

Constants

View Source
const DefaultSerialPort = ""

Variables

View Source
var (
	ErrorCommandNotFound = errors.New("Command not found on device")
)

Functions

This section is empty.

Types

type Device

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

func NewDevice

func NewDevice(transp Transport) *Device

func (*Device) Clear

func (d *Device) Clear() error

func (*Device) Close

func (d *Device) Close() error

func (*Device) Get

func (d *Device) Get(name string) (string, error)

func (*Device) LoraGet

func (d *Device) LoraGet(name string) (string, error)

func (*Device) LoraSet

func (d *Device) LoraSet(name, param string) (string, error)

func (*Device) Set

func (d *Device) Set(name, param string) (string, error)

type SerialTransport

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

func Open

func Open(portname string) (*SerialTransport, error)

func (*SerialTransport) Close

func (s *SerialTransport) Close() error

func (*SerialTransport) Debug

func (s *SerialTransport) Debug(debug bool)

func (*SerialTransport) Write

func (s *SerialTransport) Write(in string) (string, error)

type Transport

type Transport interface {
	io.Closer
	Write(in string) (string, error)
}

Directories

Path Synopsis
cmd
pcr2 command

Jump to

Keyboard shortcuts

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