godexrcvr

package module
v0.0.0-...-3a8c678 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

godexrcvr

Go driver for Dexcom USB receiver

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DexcomVendor        = gousb.ID(0x22a3)
	Gen4ReceiverProduct = gousb.ID(0x0047)
)
View Source
var SyncByte = 0x01

SyncByte is a wire-signal for stuff

Functions

func DexcomFilter

func DexcomFilter(desc *gousb.DeviceDesc) bool

func DoAPing

func DoAPing(device *serial.Port) bool

func OpenDevice

func OpenDevice(device string) (*serial.Port, error)

func ReadBatteryLevel

func ReadBatteryLevel(device *serial.Port) (int, error)

func ReadFirmwareHeader

func ReadFirmwareHeader(device *serial.Port)

func ReadGeneric

func ReadGeneric(device *serial.Port, cmd DexcomCmd) error

func ReadTransmitterID

func ReadTransmitterID(device *serial.Port) (string, error)

Types

type DexcomCmd

type DexcomCmd byte
const (
	CmdNull                       DexcomCmd = 0x00
	CmdAck                        DexcomCmd = 0x01
	CmdNak                        DexcomCmd = 0x02
	CmdInvalidCommand             DexcomCmd = 0x03
	CmdInvalidParam               DexcomCmd = 0x04
	CmdIncompletePacketReceived   DexcomCmd = 0x05
	CmdReceiverError              DexcomCmd = 0x06
	CmdInvalidMode                DexcomCmd = 0x07
	CmdPing                       DexcomCmd = 0x0A
	CmdReadFirmwareHeader         DexcomCmd = 0x0B
	CmdReadDatabasePartitionInfo  DexcomCmd = 0x0F
	CmdReadDataPageRange          DexcomCmd = 0x10
	CmdReadDataPages              DexcomCmd = 0x11
	CmdReadDataPageHeader         DexcomCmd = 0x12
	CmdReadLanguage               DexcomCmd = 0x1B
	CmdReadDisplayTimeOffset      DexcomCmd = 0x1C
	CmdWriteDisplayTimeOffset     DexcomCmd = 0x1D
	CmdReadSystemTime             DexcomCmd = 0x22
	CmdReadSystemTimeOffset       DexcomCmd = 0x23
	CmdReadGlucoseUnit            DexcomCmd = 0x25
	CmdReadClockMode              DexcomCmd = 0x29
	CmdReadTransmitterID          DexcomCmd = 0x19
	CmdWriteTransmitterID         DexcomCmd = 0x1A
	CmdWriteLanguage              DexcomCmd = 0x1C
	CmdReadRTC                    DexcomCmd = 0x1F
	CmdResetReceiver              DexcomCmd = 0x20
	CmdReadBatteryLevel           DexcomCmd = 0x21
	CmdWriteSystemTime            DexcomCmd = 0x24
	CmdWriteGlucoseUnit           DexcomCmd = 0x26
	CmdReadBlindedMode            DexcomCmd = 0x27
	CmdWriteBlindedMode           DexcomCmd = 0x28
	CmdWriteClockMode             DexcomCmd = 0x2A
	CmdReadDeviceMode             DexcomCmd = 0x2B
	CmdEraseDatabase              DexcomCmd = 0x2D
	CmdShutdownReceiver           DexcomCmd = 0x2E
	CmdWritePcParameters          DexcomCmd = 0x2F
	CmdReadBatteryState           DexcomCmd = 0x30
	CmdReadHardwareBoardID        DexcomCmd = 0x31
	CmdReadFirmwareSettings       DexcomCmd = 0x36
	CmdReadEnableSetupWizardFlag  DexcomCmd = 0x37
	CmdReadSetupWizardState       DexcomCmd = 0x39
	CmdReadChargerCurrentSetting  DexcomCmd = 0x3b
	CmdWriteChargerCurrentSetting DexcomCmd = 0x3c
)

func (DexcomCmd) String

func (cmd DexcomCmd) String() string

type DexcomPacket

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

func ReadPacket

func ReadPacket(device *serial.Port) (*DexcomPacket, error)

type FirmwareHeader

type FirmwareHeader struct {
	SchemaVersion      string `xml:"SchemaVersion,attr"`
	ApiVersion         string `xml:"ApiVersion,attr"`
	TestApiVersion     string `xml:"TestApiVersion,attr"`
	ProductId          string `xml:"ProductId,attr"`
	ProductName        string `xml:"ProductName,attr"`
	SoftwareNumber     string `xml:"SoftwareNumber,attr"`
	FirmwareVersion    string `xml:"FirmwareVersion,attr"`
	PortVersion        string `xml:"PortVersion,attr"`
	RFVersion          string `xml:"RFVersion,attr"`
	BLESoftwareVersion string `xml:"BLESoftwareVersion,attr"`
	BLEHardwareVersion string `xml:"BLEHardwareVersion,attr"`
	BLEDeviceAddress   string `xml:"BLEDeviceAddress,attr"`
	DexBootVersion     string `xml:"DexBootVersion,attr"`
}

type Partition

type Partition struct {
	Name           string `xml:"Name,attr"`
	Id             string `xml:"Id,attr"`
	RecordRevision string `xml:"RecordRevision,attr"`
	RecordLength   string `xml:"RecordLength,attr"`
}

type PartitionInfo

type PartitionInfo struct {
	SchemaVersion     string      `xml:"SchemaVersion,attr"`
	PageHeaderVersion string      `xml:"PageHeaderVersion,attr"`
	PageDataLength    string      `xml:"PageDataLength,attr"`
	Partitions        []Partition `xml:"Partition"`
}

func ReadDatabasePartionInfo

func ReadDatabasePartionInfo(device *serial.Port) (*PartitionInfo, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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