uart

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

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 5 Imported by: 0

README

go-ble-nordic-uart

Nordic UART service for go-ble.

Introduction

This library provides a UART service that implements the Nordic UART service, which is a service that provides an RX and TX channel for communication. The API provides an io.ReadWriter compatible interface.

License

See the LICENSE.md file (MIT license).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CharacteristicRx = ble.MustParse("6e400002-b5a3-f393-e0a9-e50e24dcca9e")
	CharacteristicTx = ble.MustParse("6e400003-b5a3-f393-e0a9-e50e24dcca9e")
)

UUIDs of the characteristics.

View Source
var ServiceUART = ble.MustParse("6e400001-b5a3-f393-e0a9-e50e24dcca9e")

ServiceUART is the UUID of the Nordic UART Service. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/

Functions

This section is empty.

Types

type Service

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

Service is the interface for the device information BLE service. Only properties that are non-nil will be advertised by this service.

func New

func New() *Service

New initializes a new instance of Service.

func (*Service) Create

func (s *Service) Create() *ble.Service

Create will return an instance of ble.Service, that can be used to advertise the device information service.

func (*Service) Read

func (s *Service) Read(p []byte) (n int, err error)

Read implements io.Reader.Read by reading from the receive buffer. It will block until data is received.

func (*Service) Write

func (s *Service) Write(p []byte) (n int, err error)

Write implements io.Writer.Write by writing the data directly to the transmit observable.

Jump to

Keyboard shortcuts

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