Documentation ¶
Index ¶
- Constants
- Variables
- type AioPin
- type DioPin
- type Gonashi
- type I2CCondition
- type I2CMode
- type I2CPin
- type Konashi
- func (k *Konashi) Connect()
- func (k *Konashi) DisConnect()
- func (k *Konashi) DiscoverCharacteristics() []*gatt.Characteristic
- func (k *Konashi) PinMode(pin DioPin, mode PinIOMode) error
- func (k *Konashi) ReadCharacteristic(c *gatt.Characteristic) ([]byte, error)
- func (k *Konashi) SetMTU(mtu uint16) error
- func (k *Konashi) SetNotifyValue(c *gatt.Characteristic) error
- func (k *Konashi) SetPeripheral(p gatt.Peripheral)
- func (k *Konashi) Update(a *gatt.Advertisement, rssi int)
- func (k *Konashi) WriteCharacteristic(c *gatt.Characteristic, b []byte, noRsp bool) error
- type LED
- type PinIOMode
- type PinLevel
- type PinPullupMode
- type PwmMode
- type TactSwitch
- type UartMode
Constants ¶
View Source
const ( KonashiServiceUUID = "229bff0003fb40da98a7b0def65c2d4b" // PIO KonashiPioSettingUUID = "229b300003fb40da98a7b0def65c2d4b" KonashiPioPullUpUUID = "229b300103fb40da98a7b0def65c2d4b" KonashiPioOutputUUID = "229b300203fb40da98a7b0def65c2d4b" KonashiPioInputNotificationUUID = "229b300303fb40da98a7b0def65c2d4b" KonashiPioInputNotificationReadLen = 1 // PWM KonashiPWmConfigUUID = 0x3004 KonashiPWmParamUUID = 0x3005 KonashiPWmDutyUUID = 0x3006 // Analog KonashiAnalogDriveUUID = 0x3007 KonashiAnalogRead0UUID = 0x3008 KonashiAnalogRead1UUID = 0x3009 KonashiAnalogRead2UUID = 0x300A KonashiAnalogReadLen = 2 // I2C KonashiI2cConfigUUID = 0x300B KonashiI2cStartStopUUID = 0x300C KonashiI2cWriteUUID = 0x300D KonashiI2cReadParamUIUD = 0x300E KonashiI2cReadUUID = 0x300F // Uart KonashiUartConfigUUID = 0x3010 KonashiUartBaudrateUUID = 0x3011 KonashiUartTxUUID = 0x3012 KonashiUartRXNotificationUUID = 0x3013 KonashiUartRXNotificationReadLen = 1 // Hardware KonashiHardwareResetUUID = 0x3014 KonashiHardwareLowBATNotificationUUID = 0x3015 KonashiHardwareLowBATNotificationReadLen = 1 )
View Source
const ( KonashiUartModeDisable UartMode = iota KonashiUartModeEnable KonashiUartBaudrateRate2K4 = 0x000a // 2400bps KonashiUartBaudrateRate9K6 = 0x0028 // 9600bps KonashiUartBaudrateRate19K2 = 0x0050 // 19200bps KonashiUartBaudrateRate38K4 = 0x00a0 // 38400pbs KonashiUartBaudrateRate57K6 = 0x00f0 // 57600pbs KonashiUartBaudrateRate76K8 = 0x0140 // 76800pbs KonashiUartBaudrateRate115K2 = 0x01e0 // 115200pbs )
View Source
const ( KonashiResultSuccess = iota KonashiResultFailure )
Variables ¶
View Source
var ( KonashiService *gatt.Service = gatt.NewService(gatt.MustParseUUID(KonashiServiceUUID)) // PIO KonashiPioSetting *gatt.Characteristic = gatt.NewCharacteristic(gatt.MustParseUUID(KonashiPioSettingUUID), KonashiService, 0, 0, 0) )
View Source
var ClientOptions = []gatt.Option{ gatt.MacDeviceRole(gatt.CentralManager), }
Functions ¶
This section is empty.
Types ¶
type Gonashi ¶
type Gonashi struct {
// contains filtered or unexported fields
}
func NewGonashi ¶
func (*Gonashi) Discovered ¶
func (*Gonashi) GetDiscovered ¶
func (*Gonashi) StopScanning ¶
func (g *Gonashi) StopScanning()
type I2CCondition ¶
type I2CCondition int
const ( KonashiI2CConditionStop I2CCondition = iota KonashiI2CConditionStart KonashiI2CConditionRestart )
type Konashi ¶
type Konashi struct { Peripheral gatt.Peripheral Advertisement *gatt.Advertisement Rssi int T time.Time Connected chan struct{} Disconnected chan struct{} // contains filtered or unexported fields }
func NewKonashi ¶
func NewKonashi(p gatt.Peripheral, a *gatt.Advertisement, rssi int) *Konashi
func (*Konashi) DisConnect ¶
func (k *Konashi) DisConnect()
func (*Konashi) DiscoverCharacteristics ¶
func (k *Konashi) DiscoverCharacteristics() []*gatt.Characteristic
func (*Konashi) ReadCharacteristic ¶
func (k *Konashi) ReadCharacteristic(c *gatt.Characteristic) ([]byte, error)
func (*Konashi) SetNotifyValue ¶
func (k *Konashi) SetNotifyValue(c *gatt.Characteristic) error
func (*Konashi) SetPeripheral ¶
func (k *Konashi) SetPeripheral(p gatt.Peripheral)
func (*Konashi) WriteCharacteristic ¶
type PinPullupMode ¶
type PinPullupMode int
const ( KonashiPinModePullup PinPullupMode = iota KonashiPinModeNoPulls )
Click to show internal directories.
Click to hide internal directories.