obex

package
v0.0.0-...-f9b8134 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObexClient1

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

ObexClient1 client

func NewObexClient1

func NewObexClient1() *ObexClient1

TODO: https://github.com/blueman-project/blueman/issues/218#issuecomment-89315974 NewObexClient1 create a new ObexClient1 client

func (*ObexClient1) Close

func (a *ObexClient1) Close()

Close the connection

func (*ObexClient1) CreateSession

func (a *ObexClient1) CreateSession(destination string, options map[string]interface{}) (string, error)
Create a new OBEX session for the given remote address.

The last parameter is a dictionary to hold optional or
type-specific parameters. Typical parameters that can
be set in this dictionary include the following:

	string "Target" : type of session to be created
	string "Source" : local address to be used
	byte "Channel"

The currently supported targets are the following:

- "ftp"
- "map"
- "opp"
- "pbap"
- "sync"

Possible errors:
	- org.bluez.obex.Error.InvalidArguments
	- org.bluez.obex.Error.Failed

TODO: Use ObexSession1 struct instead of generic map for options

func (*ObexClient1) RemoveSession

func (a *ObexClient1) RemoveSession(session string) error

Unregister session and abort pending transfers.

Possible errors:

  • org.bluez.obex.Error.InvalidArguments
  • org.bluez.obex.Error.NotAuthorized

type ObexSession1

type ObexSession1 struct {
	Properties *ObexSession1Properties
	// contains filtered or unexported fields
}

ObexSession1 client

func NewObexSession1

func NewObexSession1(path string) *ObexSession1

NewObexSession1 create a new ObexSession1 client

func (*ObexSession1) Close

func (d *ObexSession1) Close()

Close the connection

func (*ObexSession1) GetProperties

func (d *ObexSession1) GetProperties() (*ObexSession1Properties, error)

GetProperties load all available properties

func (*ObexSession1) GetProperty

func (d *ObexSession1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

type ObexSession1Properties

type ObexSession1Properties struct {
	Source      string // [readonly] Bluetooth adapter address
	Destination string // [readonly] Bluetooth device address
	Channel     byte   // [readonly] Bluetooth channel
	Target      string // [readonly] Target UUID
	Root        string // [readonly] Root path
}

ObexSession1Properties exposed properties for ObexSession1

type ObexTransfer1

type ObexTransfer1 struct {
	Properties *ObexTransfer1Properties
	// contains filtered or unexported fields
}

ObexTransfer1 client

func NewObexTransfer1

func NewObexTransfer1(path string) *ObexTransfer1

NewObexTransfer1 create a new ObexTransfer1 client

func (*ObexTransfer1) Cancel

func (a *ObexTransfer1) Cancel() error

Stops the current transference.

Possible errors: org.bluez.obex.Error.NotAuthorized

  • org.bluez.obex.Error.InProgress
  • org.bluez.obex.Error.Failed

func (*ObexTransfer1) Close

func (d *ObexTransfer1) Close()

Close the connection

func (*ObexTransfer1) GetProperties

func (d *ObexTransfer1) GetProperties() (*ObexTransfer1Properties, error)

GetProperties load all available properties

func (*ObexTransfer1) GetProperty

func (d *ObexTransfer1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*ObexTransfer1) Resume

func (a *ObexTransfer1) Resume() error

Resume transference.

Possible errors: org.bluez.obex.Error.NotAuthorized org.bluez.obex.Error.NotInProgress

Note that it is not possible to resume transfers which are queued which is why NotInProgress is listed as possible error.

func (*ObexTransfer1) Suspend

func (a *ObexTransfer1) Suspend() error

Suspend transference.

Possible errors: org.bluez.obex.Error.NotAuthorized org.bluez.obex.Error.NotInProgress

Note that it is not possible to suspend transfers which are queued which is why NotInProgress is listed as possible error.

type ObexTransfer1Properties

type ObexTransfer1Properties struct {
	Status      string
	Session     dbus.ObjectPath
	Name        string
	Type        string
	Time        uint64
	Size        uint64
	Transferred uint64
	Filename    string
}

ObexTransfer1Properties exposed properties for ObexTransfer1

type ObjectPush1

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

ObjectPush1 client

func NewObjectPush1

func NewObjectPush1(sessionPath string) *ObjectPush1

NewObjectPush1 create a new ObjectPush1 client

func (*ObjectPush1) Close

func (d *ObjectPush1) Close()

Close the connection

func (*ObjectPush1) SendFile

func (a *ObjectPush1) SendFile(sourcefile string) (string, *ObexTransfer1Properties, error)

Send one local file to the remote device.

The returned path represents the newly created transfer, which should be used to find out if the content has been successfully transferred or if the operation fails.

The properties of this transfer are also returned along with the object path, to avoid a call to GetProperties.

Possible errors:

  • org.bluez.obex.Error.InvalidArguments
  • org.bluez.obex.Error.Failed

Jump to

Keyboard shortcuts

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