nrf24

package module
v0.0.0-...-aa37e6d Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: GPL-3.0 Imports: 5 Imported by: 34

README

NRF24

This package allows interaction with nRF24LU1+ based dongles and the RFStorm firmware.

Dependencies

sudo apt-get install libusb-1.0
go get -v github.com/google/gousb

Example

See the examples folder.

License

This package is made with ♥ by evilsocket and it's released under the GPL 3 license.

Documentation

Overview

Package nrf24 allows interaction with nRF24LU1+ based dongles and RFStorm firmware. Ref. https://github.com/BastilleResearch/nrf-research-firmware

Index

Constants

View Source
const (
	VendorID  gousb.ID = 0x1915
	ProductID gousb.ID = 0x0102
)
View Source
const (
	PacketSize = 64
	MinChannel = 1
	TopChannel = 83
	MaxChannel = 125
)

Variables

This section is empty.

Functions

func ConvertAddress

func ConvertAddress(address string) (error, []byte)

func LoopChannels

func LoopChannels(idx *int) int

func NthChannel

func NthChannel(idx int) int

Types

type Command

type Command byte
const (
	CmdTransmitPayload         Command = 0x04
	CmdEnterSnifferMode        Command = 0x05
	CmdEnterPromiscMode        Command = 0x06
	CmdEnterToneTestMode       Command = 0x07
	CmdTransmitAckPayload      Command = 0x08
	CmdSetChannel              Command = 0x09
	CmdGetChannel              Command = 0x0A
	CmdEnableLNAPA             Command = 0x0B
	CmdTransmitPayloadGeneric  Command = 0x0C
	CmdEnterPromiscModeGeneric Command = 0x0D
	CmdReceivePayload          Command = 0x12
)

USB commands

type Dongle

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

func Open

func Open() (dongle *Dongle, err error)

func (*Dongle) Close

func (d *Dongle) Close()

func (*Dongle) Command

func (d *Dongle) Command(cmd Command, data []byte) (int, error)

func (*Dongle) EnableLNA

func (d *Dongle) EnableLNA() error

func (*Dongle) EnterPromiscMode

func (d *Dongle) EnterPromiscMode() error

func (*Dongle) EnterPromiscModeFor

func (d *Dongle) EnterPromiscModeFor(prefix []byte) error

func (*Dongle) EnterPromiscModeGeneric

func (d *Dongle) EnterPromiscModeGeneric() error

func (*Dongle) EnterPromiscModeGenericDefaultFor

func (d *Dongle) EnterPromiscModeGenericDefaultFor(prefix []byte) error

func (*Dongle) EnterPromiscModeGenericFor

func (d *Dongle) EnterPromiscModeGenericFor(prefix []byte, rate RfRate, payloadLength int) error

func (*Dongle) EnterSnifferMode

func (d *Dongle) EnterSnifferMode() error

func (*Dongle) EnterSnifferModeFor

func (d *Dongle) EnterSnifferModeFor(address []byte) error

func (*Dongle) EnterToneTestMode

func (d *Dongle) EnterToneTestMode() error

func (*Dongle) GetChannel

func (d *Dongle) GetChannel() (int, error)

func (*Dongle) Read

func (d *Dongle) Read() (int, []byte, error)

func (*Dongle) ReceivePayload

func (d *Dongle) ReceivePayload() ([]byte, error)

func (*Dongle) SetChannel

func (d *Dongle) SetChannel(ch int) error

func (*Dongle) String

func (d *Dongle) String() string

func (*Dongle) TransmitAckPayload

func (d *Dongle) TransmitAckPayload(payload []byte) error

func (*Dongle) TransmitPayload

func (d *Dongle) TransmitPayload(payload []byte, timeout int, retransmits int) error

func (*Dongle) TransmitPayloadGeneric

func (d *Dongle) TransmitPayloadGeneric(payload []byte, address []byte) error

type RfRate

type RfRate byte
const (
	RfRate250K RfRate = 0
	RfRate1M   RfRate = 1
	RfRate2M   RfRate = 2
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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