obex

package
v0.0.0-...-ac156b6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

OBEX D-Bus API description [obex-api.txt]

Index

Constants

This section is empty.

Variables

View Source
var FileTransferInterface = "org.bluez.obex.FileTransfer"
View Source
var Message1Interface = "org.bluez.obex.Message1"
View Source
var MessageAccess1Interface = "org.bluez.obex.MessageAccess1"
View Source
var PhonebookAccess1Interface = "org.bluez.obex.PhonebookAccess1"
View Source
var Synchronization1Interface = "org.bluez.obex.Synchronization1"

Functions

This section is empty.

Types

type FileTransfer

type FileTransfer struct {
	Properties *FileTransferProperties
	// contains filtered or unexported fields
}

FileTransfer File Transfer hierarchy

func NewFileTransfer

func NewFileTransfer(objectPath dbus.ObjectPath) (*FileTransfer, error)

NewFileTransfer create a new instance of FileTransfer

Args: - objectPath: [Session object path]

func (*FileTransfer) ChangeFolder

func (a *FileTransfer) ChangeFolder(folder string) error

ChangeFolder

Change the current folder of the remote device.

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

func (*FileTransfer) Client

func (a *FileTransfer) Client() *bluez.Client

Client return FileTransfer dbus client

func (*FileTransfer) Close

func (a *FileTransfer) Close()

Close the connection

func (*FileTransfer) CopyFile

func (a *FileTransfer) CopyFile(sourcefile string, targetfile string) error

CopyFile

Copy a file within the remote device from source file
to target file.

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

func (*FileTransfer) CreateFolder

func (a *FileTransfer) CreateFolder(folder string) error

CreateFolder

Create a new folder in the remote device.

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

func (*FileTransfer) Delete

func (a *FileTransfer) Delete(file string) error

Delete

Deletes the specified file/folder.

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

func (*FileTransfer) GetFile

func (a *FileTransfer) GetFile(targetfile string, sourcefile string) (dbus.ObjectPath, map[string]interface{}, error)

GetFile

Copy the source file (from remote device) to the
target file (on local filesystem).

If an empty target file is given, a name will be
automatically calculated for the temporary file.

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

func (*FileTransfer) GetObjectManagerSignal

func (a *FileTransfer) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*FileTransfer) GetProperties

func (a *FileTransfer) GetProperties() (*FileTransferProperties, error)

GetProperties load all available properties

func (*FileTransfer) GetPropertiesSignal

func (a *FileTransfer) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*FileTransfer) GetProperty

func (a *FileTransfer) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*FileTransfer) Interface

func (a *FileTransfer) Interface() string

Interface return FileTransfer interface

func (*FileTransfer) ListFolder

func (a *FileTransfer) ListFolder() ([]map[string]interface{}, error)

ListFolder

Returns a dictionary containing information about
the current folder content.

The following keys are defined:

	string Name : Object name in UTF-8 format
	string Type : Either "folder" or "file"
	uint64 Size : Object size or number of items in
			folder
	string Permission : Group, owner and other
				permission
	uint64 Modified : Last change
	uint64 Accessed : Last access
	uint64 Created : Creation date

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

func (*FileTransfer) MoveFile

func (a *FileTransfer) MoveFile(sourcefile string, targetfile string) error

MoveFile

Move a file within the remote device from source file
to the target file.

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

func (*FileTransfer) Path

func (a *FileTransfer) Path() dbus.ObjectPath

Path return FileTransfer object path

func (*FileTransfer) PutFile

func (a *FileTransfer) PutFile(sourcefile string, targetfile string) (dbus.ObjectPath, map[string]interface{}, error)

PutFile

Copy the source file (from local filesystem) to the
target file (on 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

func (*FileTransfer) SetProperty

func (a *FileTransfer) SetProperty(name string, value interface{}) error

SetProperty set a property

func (*FileTransfer) ToProps

func (a *FileTransfer) ToProps() bluez.Properties

ToProps return the properties interface

func (*FileTransfer) UnwatchProperties

func (a *FileTransfer) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*FileTransfer) WatchProperties

func (a *FileTransfer) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type FileTransferProperties

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

FileTransferProperties contains the exposed properties of an interface

func (*FileTransferProperties) FromDBusMap

func (a *FileTransferProperties) FromDBusMap(props map[string]dbus.Variant) (*FileTransferProperties, error)

FromDBusMap convert a map to an FileTransferProperties

func (*FileTransferProperties) FromMap

func (a *FileTransferProperties) FromMap(props map[string]interface{}) (*FileTransferProperties, error)

FromMap convert a map to an FileTransferProperties

func (*FileTransferProperties) Lock

func (p *FileTransferProperties) Lock()

Lock access to properties

func (*FileTransferProperties) ToMap

func (a *FileTransferProperties) ToMap() (map[string]interface{}, error)

ToMap convert a FileTransferProperties to map

func (*FileTransferProperties) Unlock

func (p *FileTransferProperties) Unlock()

Unlock access to properties

type Message1

type Message1 struct {
	Properties *Message1Properties
	// contains filtered or unexported fields
}

Message1 Message hierarchy

func NewMessage1

func NewMessage1(objectPath dbus.ObjectPath) (*Message1, error)

NewMessage1 create a new instance of Message1

Args: - objectPath: [Session object path]/{message0,...}

func (*Message1) Client

func (a *Message1) Client() *bluez.Client

Client return Message1 dbus client

func (*Message1) Close

func (a *Message1) Close()

Close the connection

func (*Message1) Get

func (a *Message1) Get(targetfile string, attachment bool) (dbus.ObjectPath, map[string]interface{}, error)

Get

Download message and store it in the target file.

If an empty target file is given, a temporary file
will be automatically generated.

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

func (*Message1) GetDeleted

func (a *Message1) GetDeleted() (bool, error)

GetDeleted get Deleted value

func (*Message1) GetFolder

func (a *Message1) GetFolder() (string, error)

GetFolder get Folder value

func (*Message1) GetObjectManagerSignal

func (a *Message1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*Message1) GetPriority

func (a *Message1) GetPriority() (bool, error)

GetPriority get Priority value

func (*Message1) GetProperties

func (a *Message1) GetProperties() (*Message1Properties, error)

GetProperties load all available properties

func (*Message1) GetPropertiesSignal

func (a *Message1) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*Message1) GetProperty

func (a *Message1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*Message1) GetProtected

func (a *Message1) GetProtected() (bool, error)

GetProtected get Protected value

func (*Message1) GetRead

func (a *Message1) GetRead() (bool, error)

GetRead get Read value

func (*Message1) GetRecipient

func (a *Message1) GetRecipient() (string, error)

GetRecipient get Recipient value

func (*Message1) GetRecipientAddress

func (a *Message1) GetRecipientAddress() (string, error)

GetRecipientAddress get RecipientAddress value

func (*Message1) GetReplyTo

func (a *Message1) GetReplyTo() (string, error)

GetReplyTo get ReplyTo value

func (*Message1) GetSender

func (a *Message1) GetSender() (string, error)

GetSender get Sender value

func (*Message1) GetSenderAddress

func (a *Message1) GetSenderAddress() (string, error)

GetSenderAddress get SenderAddress value

func (*Message1) GetSent

func (a *Message1) GetSent() (bool, error)

GetSent get Sent value

func (*Message1) GetStatus

func (a *Message1) GetStatus() (string, error)

GetStatus get Status value

func (*Message1) GetSubject

func (a *Message1) GetSubject() (string, error)

GetSubject get Subject value

func (*Message1) GetTimestamp

func (a *Message1) GetTimestamp() (string, error)

GetTimestamp get Timestamp value

func (*Message1) GetType

func (a *Message1) GetType() (string, error)

GetType get Type value

func (*Message1) Interface

func (a *Message1) Interface() string

Interface return Message1 interface

func (*Message1) Path

func (a *Message1) Path() dbus.ObjectPath

Path return Message1 object path

func (*Message1) SetDeleted

func (a *Message1) SetDeleted(v bool) error

SetDeleted set Deleted value

func (*Message1) SetProperty

func (a *Message1) SetProperty(name string, value interface{}) error

SetProperty set a property

func (*Message1) SetRead

func (a *Message1) SetRead(v bool) error

SetRead set Read value

func (*Message1) ToProps

func (a *Message1) ToProps() bluez.Properties

ToProps return the properties interface

func (*Message1) UnwatchProperties

func (a *Message1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*Message1) WatchProperties

func (a *Message1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type Message1Properties

type Message1Properties struct {

	/*
		Timestamp Message timestamp
	*/
	Timestamp string

	/*
		Recipient Message recipient name
	*/
	Recipient string

	/*
		RecipientAddress Message recipient address
	*/
	RecipientAddress string

	/*
		Status Message reception status

				Possible values: "complete",
				"fractioned" and "notification"
	*/
	Status string

	/*
		Protected Message protected flag
	*/
	Protected bool

	/*
		Folder Folder which the message belongs to
	*/
	Folder string

	/*
		Subject Message subject
	*/
	Subject string

	/*
		ReplyTo Message Reply-To address
	*/
	ReplyTo string

	/*
		Sent Message sent flag
	*/
	Sent bool

	/*
		SenderAddress Message sender address
	*/
	SenderAddress string

	/*
		Type Message type

				Possible values: "email", "sms-gsm",
				"sms-cdma" and "mms"

			uint64 Size [readonly]

				Message size in bytes
	*/
	Type string

	/*
		Read Message read flag
	*/
	Read bool

	/*
		Deleted Message deleted flag
	*/
	Deleted bool

	/*
		Sender Message sender name
	*/
	Sender string

	/*
		Priority Message priority flag
	*/
	Priority bool
	// contains filtered or unexported fields
}

Message1Properties contains the exposed properties of an interface

func (*Message1Properties) FromDBusMap

func (a *Message1Properties) FromDBusMap(props map[string]dbus.Variant) (*Message1Properties, error)

FromDBusMap convert a map to an Message1Properties

func (*Message1Properties) FromMap

func (a *Message1Properties) FromMap(props map[string]interface{}) (*Message1Properties, error)

FromMap convert a map to an Message1Properties

func (*Message1Properties) Lock

func (p *Message1Properties) Lock()

Lock access to properties

func (*Message1Properties) ToMap

func (a *Message1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a Message1Properties to map

func (*Message1Properties) Unlock

func (p *Message1Properties) Unlock()

Unlock access to properties

type MessageAccess1

type MessageAccess1 struct {
	Properties *MessageAccess1Properties
	// contains filtered or unexported fields
}

MessageAccess1 Message Access hierarchy

func NewMessageAccess1

func NewMessageAccess1(objectPath dbus.ObjectPath) (*MessageAccess1, error)

NewMessageAccess1 create a new instance of MessageAccess1

Args: - objectPath: [Session object path]

func (*MessageAccess1) Client

func (a *MessageAccess1) Client() *bluez.Client

Client return MessageAccess1 dbus client

func (*MessageAccess1) Close

func (a *MessageAccess1) Close()

Close the connection

func (*MessageAccess1) GetObjectManagerSignal

func (a *MessageAccess1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*MessageAccess1) GetProperties

func (a *MessageAccess1) GetProperties() (*MessageAccess1Properties, error)

GetProperties load all available properties

func (*MessageAccess1) GetPropertiesSignal

func (a *MessageAccess1) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*MessageAccess1) GetProperty

func (a *MessageAccess1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*MessageAccess1) Interface

func (a *MessageAccess1) Interface() string

Interface return MessageAccess1 interface

func (*MessageAccess1) ListFilterFields

func (a *MessageAccess1) ListFilterFields() ([]string, error)

ListFilterFields

Return all available fields that can be used in Fields
filter.

Possible errors: None

func (*MessageAccess1) ListFolders

func (a *MessageAccess1) ListFolders(filter map[string]interface{}) ([]map[string]interface{}, error)

ListFolders

Returns a dictionary containing information about
the current folder content.

The following keys are defined:

	string Name : Folder name

Possible filters: Offset and MaxCount

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

func (*MessageAccess1) ListMessages

func (a *MessageAccess1) ListMessages(folder string, filter map[string]interface{}) ([]dbus.ObjectPath, map[string]interface{}, error)

ListMessages

Returns an array containing the messages found in the
given subfolder of the current folder, or in the
current folder if folder is empty.

Possible Filters: Offset, MaxCount, SubjectLength, Fields,
Type, PeriodStart, PeriodEnd, Status, Recipient, Sender,
Priority

Each message is represented by an object path followed
by a dictionary of the properties.

Properties:

	string Subject:

		Message subject

	string Timestamp:

		Message timestamp

	string Sender:

		Message sender name

	string SenderAddress:

		Message sender address

	string ReplyTo:

		Message Reply-To address

	string Recipient:

		Message recipient name

	string RecipientAddress:

		Message recipient address

	string Type:

		Message type

		Possible values: "email", "sms-gsm",
		"sms-cdma" and "mms"

	uint64 Size:

		Message size in bytes

	boolean Text:

		Message text flag

		Specifies whether message has textual
		content or is binary only

	string Status:

		Message status

		Possible values for received messages:
		"complete", "fractioned", "notification"

		Possible values for sent messages:
		"delivery-success", "sending-success",
		"delivery-failure", "sending-failure"

	uint64 AttachmentSize:

		Message overall attachment size in bytes

	boolean Priority:

		Message priority flag

	boolean Read:

		Message read flag

	boolean Sent:

		Message sent flag

	boolean Protected:

		Message protected flag

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

func (*MessageAccess1) Path

func (a *MessageAccess1) Path() dbus.ObjectPath

Path return MessageAccess1 object path

func (*MessageAccess1) PushMessage

func (a *MessageAccess1) PushMessage(sourcefile string, folder string, args map[string]interface{}) error

PushMessage

Transfer a message (in bMessage format) to the
remote device.

The message is transferred either to the given
subfolder of the current folder, or to the current
folder if folder is empty.

Possible args: Transparent, Retry, Charset

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 GetAll.

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

Filter: uint16 Offset:

	Offset of the first item, default is 0

uint16 MaxCount:

	Maximum number of items, default is 1024

byte SubjectLength:

	Maximum length of the Subject property in the
	message, default is 256

array{string} Fields:

	Message fields, default is all values.

	Possible values can be query with ListFilterFields.

array{string} Types:

	Filter messages by type.

	Possible values: "sms", "email", "mms".

string PeriodBegin:

	Filter messages by starting period.

	Possible values: Date in "YYYYMMDDTHHMMSS" format.

string PeriodEnd:

	Filter messages by ending period.

	Possible values: Date in "YYYYMMDDTHHMMSS" format.

boolean Read:

	Filter messages by read flag.

	Possible values: True for read or False for unread

string Recipient:

	Filter messages by recipient address.

string Sender:

	Filter messages by sender address.

boolean Priority:

	Filter messages by priority flag.

	Possible values: True for high priority or False for
	non-high priority

func (*MessageAccess1) SetFolder

func (a *MessageAccess1) SetFolder(name string) error

SetFolder

Set working directory for current session, *name* may
be the directory name or '..[/dir]'.

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

func (*MessageAccess1) SetProperty

func (a *MessageAccess1) SetProperty(name string, value interface{}) error

SetProperty set a property

func (*MessageAccess1) ToProps

func (a *MessageAccess1) ToProps() bluez.Properties

ToProps return the properties interface

func (*MessageAccess1) UnwatchProperties

func (a *MessageAccess1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*MessageAccess1) UpdateInbox

func (a *MessageAccess1) UpdateInbox() error

UpdateInbox

func (*MessageAccess1) WatchProperties

func (a *MessageAccess1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type MessageAccess1Properties

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

MessageAccess1Properties contains the exposed properties of an interface

func (*MessageAccess1Properties) FromDBusMap

FromDBusMap convert a map to an MessageAccess1Properties

func (*MessageAccess1Properties) FromMap

func (a *MessageAccess1Properties) FromMap(props map[string]interface{}) (*MessageAccess1Properties, error)

FromMap convert a map to an MessageAccess1Properties

func (*MessageAccess1Properties) Lock

func (p *MessageAccess1Properties) Lock()

Lock access to properties

func (*MessageAccess1Properties) ToMap

func (a *MessageAccess1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a MessageAccess1Properties to map

func (*MessageAccess1Properties) Unlock

func (p *MessageAccess1Properties) Unlock()

Unlock access to properties

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

type PhonebookAccess1

type PhonebookAccess1 struct {
	Properties *PhonebookAccess1Properties
	// contains filtered or unexported fields
}

PhonebookAccess1 Phonebook Access hierarchy

func NewPhonebookAccess1

func NewPhonebookAccess1(objectPath dbus.ObjectPath) (*PhonebookAccess1, error)

NewPhonebookAccess1 create a new instance of PhonebookAccess1

Args: - objectPath: [Session object path]

func (*PhonebookAccess1) Client

func (a *PhonebookAccess1) Client() *bluez.Client

Client return PhonebookAccess1 dbus client

func (*PhonebookAccess1) Close

func (a *PhonebookAccess1) Close()

Close the connection

func (*PhonebookAccess1) GetDatabaseIdentifier

func (a *PhonebookAccess1) GetDatabaseIdentifier() (string, error)

GetDatabaseIdentifier get DatabaseIdentifier value

func (*PhonebookAccess1) GetFixedImageSize

func (a *PhonebookAccess1) GetFixedImageSize() (bool, error)

GetFixedImageSize get FixedImageSize value

func (*PhonebookAccess1) GetFolder

func (a *PhonebookAccess1) GetFolder() (string, error)

GetFolder get Folder value

func (*PhonebookAccess1) GetObjectManagerSignal

func (a *PhonebookAccess1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*PhonebookAccess1) GetPrimaryCounter

func (a *PhonebookAccess1) GetPrimaryCounter() (string, error)

GetPrimaryCounter get PrimaryCounter value

func (*PhonebookAccess1) GetProperties

func (a *PhonebookAccess1) GetProperties() (*PhonebookAccess1Properties, error)

GetProperties load all available properties

func (*PhonebookAccess1) GetPropertiesSignal

func (a *PhonebookAccess1) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*PhonebookAccess1) GetProperty

func (a *PhonebookAccess1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*PhonebookAccess1) GetSecondaryCounter

func (a *PhonebookAccess1) GetSecondaryCounter() (string, error)

GetSecondaryCounter get SecondaryCounter value

func (*PhonebookAccess1) GetSize

func (a *PhonebookAccess1) GetSize() (uint16, error)

GetSize

Return the number of entries in the selected phonebook
object that are actually used (i.e. indexes that
correspond to non-NULL entries).

Possible errors: org.bluez.obex.Error.Forbidden
		 org.bluez.obex.Error.Failed

func (*PhonebookAccess1) Interface

func (a *PhonebookAccess1) Interface() string

Interface return PhonebookAccess1 interface

func (*PhonebookAccess1) List

func (a *PhonebookAccess1) List(filters map[string]interface{}) ([]string, string, error)

List

Return an array of vcard-listing data where every entry
consists of a pair of strings containing the vcard
handle and the contact name. For example:
	"1.vcf" : "John"

Possible filters: Order, Offset and MaxCount

Possible errors: org.bluez.obex.Error.InvalidArguments
		 org.bluez.obex.Forbidden

func (*PhonebookAccess1) ListFilterFields

func (a *PhonebookAccess1) ListFilterFields() ([]string, error)

ListFilterFields

Return All Available fields that can be used in Fields
filter.

Possible errors: None

Filter: string Format:

	Items vcard format

	Possible values: "vcard21" (default) or "vcard30"

string Order:

	Items order

	Possible values: "indexed" (default), "alphanumeric" or
	"phonetic"

uint16 Offset:

	Offset of the first item, default is 0

uint16 MaxCount:

	Maximum number of items, default is unlimited (65535)

array{string} Fields:

	Item vcard fields, default is all values.

	Possible values can be query with ListFilterFields.

array{string} FilterAll:

	Filter items by fields using AND logic, cannot be used
	together with FilterAny.

	Possible values can be query with ListFilterFields.

array{string} FilterAny:

	Filter items by fields using OR logic, cannot be used
	together with FilterAll.

	Possible values can be query with ListFilterFields.

bool ResetNewMissedCalls

	Reset new the missed calls items, shall only be used
	for folders mch and cch.

func (*PhonebookAccess1) Path

func (a *PhonebookAccess1) Path() dbus.ObjectPath

Path return PhonebookAccess1 object path

func (*PhonebookAccess1) Pull

func (a *PhonebookAccess1) Pull(vcard string, targetfile string, filters map[string]interface{}) error

Pull

Given a vcard handle, retrieve the vcard in the current
phonebook object and store it in a local file.

If an empty target file is given, a name will be
automatically calculated for the temporary file.

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.

Possbile filters: Format and Fields

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

func (*PhonebookAccess1) PullAll

func (a *PhonebookAccess1) PullAll(targetfile string, filters map[string]interface{}) (dbus.ObjectPath, map[string]interface{}, error)

PullAll

Return the entire phonebook object from the PSE server
in plain string with vcard format, and store it in
a local file.

If an empty target file is given, a name will be
automatically calculated for the temporary file.

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 filters: Format, Order, Offset, MaxCount and
Fields

Possible errors: org.bluez.obex.Error.InvalidArguments
		org.bluez.obex.Forbidden

func (*PhonebookAccess1) Search

func (a *PhonebookAccess1) Search(field string, value string, filters map[string]interface{}) error

Search

Search for entries matching the given condition and
return an array of vcard-listing data where every entry
consists of a pair of strings containing the vcard
handle and the contact name.

vcard : name paired string match the search condition.

field : the field in the vcard to search with
	{ "name" (default) | "number" | "sound" }
value : the string value to search for

Possible filters: Order, Offset and MaxCount

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

func (*PhonebookAccess1) Select

func (a *PhonebookAccess1) Select(location string, phonebook string) error

Select

Select the phonebook object for other operations. Should
be call before all the other operations.

location : Where the phonebook is stored, possible
inputs :
	"int" ( "internal" which is default )
	"sim" ( "sim1" )
	"sim2"
	...

phonebook : Possible inputs :
	"pb" :	phonebook for the saved contacts
	"ich":	incoming call history
	"och":	outgoing call history
	"mch":	missing call history
	"cch":	combination of ich och mch
	"spd":	speed dials entry ( only for "internal" )
	"fav":	favorites entry ( only for "internal" )

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

func (*PhonebookAccess1) SetProperty

func (a *PhonebookAccess1) SetProperty(name string, value interface{}) error

SetProperty set a property

func (*PhonebookAccess1) ToProps

func (a *PhonebookAccess1) ToProps() bluez.Properties

ToProps return the properties interface

func (*PhonebookAccess1) UnwatchProperties

func (a *PhonebookAccess1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*PhonebookAccess1) UpdateVersion

func (a *PhonebookAccess1) UpdateVersion() error

UpdateVersion

Attempt to update PrimaryCounter and SecondaryCounter.

Possible errors: org.bluez.obex.Error.NotSupported
		 org.bluez.obex.Error.Forbidden
		 org.bluez.obex.Error.Failed

func (*PhonebookAccess1) WatchProperties

func (a *PhonebookAccess1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type PhonebookAccess1Properties

type PhonebookAccess1Properties struct {

	/*
		DatabaseIdentifier 128 bits persistent database identifier.

				Possible values: 32-character hexadecimal such
				as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
	*/
	DatabaseIdentifier string

	/*
		PrimaryCounter 128 bits primary version counter.

				Possible values: 32-character hexadecimal such
				as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
	*/
	PrimaryCounter string

	/*
		SecondaryCounter 128 bits secondary version counter.

				Possible values: 32-character hexadecimal such
				as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
	*/
	SecondaryCounter string

	/*
		FixedImageSize Indicate support for fixed image size.

				Possible values: True if image is JPEG 300x300 pixels
				otherwise False.
	*/
	FixedImageSize bool

	/*
		Folder Current folder.
	*/
	Folder string
	// contains filtered or unexported fields
}

PhonebookAccess1Properties contains the exposed properties of an interface

func (*PhonebookAccess1Properties) FromDBusMap

FromDBusMap convert a map to an PhonebookAccess1Properties

func (*PhonebookAccess1Properties) FromMap

func (a *PhonebookAccess1Properties) FromMap(props map[string]interface{}) (*PhonebookAccess1Properties, error)

FromMap convert a map to an PhonebookAccess1Properties

func (*PhonebookAccess1Properties) Lock

func (p *PhonebookAccess1Properties) Lock()

Lock access to properties

func (*PhonebookAccess1Properties) ToMap

func (a *PhonebookAccess1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a PhonebookAccess1Properties to map

func (*PhonebookAccess1Properties) Unlock

func (p *PhonebookAccess1Properties) Unlock()

Unlock access to properties

type Synchronization1

type Synchronization1 struct {
	Properties *Synchronization1Properties
	// contains filtered or unexported fields
}

Synchronization1 Synchronization hierarchy

func NewSynchronization1

func NewSynchronization1(objectPath dbus.ObjectPath) (*Synchronization1, error)

NewSynchronization1 create a new instance of Synchronization1

Args: - objectPath: [Session object path]

func (*Synchronization1) Client

func (a *Synchronization1) Client() *bluez.Client

Client return Synchronization1 dbus client

func (*Synchronization1) Close

func (a *Synchronization1) Close()

Close the connection

func (*Synchronization1) GetObjectManagerSignal

func (a *Synchronization1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*Synchronization1) GetPhonebook

func (a *Synchronization1) GetPhonebook(targetfile string) (dbus.ObjectPath, map[string]interface{}, error)

GetPhonebook

Retrieve an entire Phonebook Object store from remote
device, and stores it in a local file.

If an empty target file is given, a name will be
automatically calculated for the temporary file.

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

func (*Synchronization1) GetProperties

func (a *Synchronization1) GetProperties() (*Synchronization1Properties, error)

GetProperties load all available properties

func (*Synchronization1) GetPropertiesSignal

func (a *Synchronization1) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*Synchronization1) GetProperty

func (a *Synchronization1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*Synchronization1) Interface

func (a *Synchronization1) Interface() string

Interface return Synchronization1 interface

func (*Synchronization1) Path

func (a *Synchronization1) Path() dbus.ObjectPath

Path return Synchronization1 object path

func (*Synchronization1) PutPhonebook

func (a *Synchronization1) PutPhonebook(sourcefile string) (dbus.ObjectPath, map[string]interface{}, error)

PutPhonebook

Send an entire Phonebook Object store to 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

func (*Synchronization1) SetLocation

func (a *Synchronization1) SetLocation(location string) error

SetLocation

Set the phonebook object store location for other
operations. Should be called before all the other
operations.

location: Where the phonebook is stored, possible
values:
	"int" ( "internal" which is default )
	"sim1"
	"sim2"
	......

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

func (*Synchronization1) SetProperty

func (a *Synchronization1) SetProperty(name string, value interface{}) error

SetProperty set a property

func (*Synchronization1) ToProps

func (a *Synchronization1) ToProps() bluez.Properties

ToProps return the properties interface

func (*Synchronization1) UnwatchProperties

func (a *Synchronization1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*Synchronization1) WatchProperties

func (a *Synchronization1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type Synchronization1Properties

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

Synchronization1Properties contains the exposed properties of an interface

func (*Synchronization1Properties) FromDBusMap

FromDBusMap convert a map to an Synchronization1Properties

func (*Synchronization1Properties) FromMap

func (a *Synchronization1Properties) FromMap(props map[string]interface{}) (*Synchronization1Properties, error)

FromMap convert a map to an Synchronization1Properties

func (*Synchronization1Properties) Lock

func (p *Synchronization1Properties) Lock()

Lock access to properties

func (*Synchronization1Properties) ToMap

func (a *Synchronization1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a Synchronization1Properties to map

func (*Synchronization1Properties) Unlock

func (p *Synchronization1Properties) Unlock()

Unlock access to properties

Jump to

Keyboard shortcuts

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