summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-12-11 15:57:41 +0100
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-12-20 22:06:10 +0000
commita46a78ad5f2baa90127808ad1c4d025e4b4a0e77 (patch)
treeb0be9dc2a5e4412a3592acf4384a9165a3326d27 /meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
parent73351742e32772a19f62086cea5a5e7a38fe02f7 (diff)
bump bluez-alsa to master (brings Ofono support)
This takes the mandatory commits to have HFP support over Ofono (56fcc3 from 2018-12-04) Also adds the needed options to the daemon in the service file The license changed due to change of year and author list It was bogus to have hcitop in PACKAGECONFIG. Namely, this is not a feature in yocto, but only an optional feature of bluez-alsa (that helps to perform bandwith measures) However, Ofono is one. This also adds hcitop and rfcomm tools in development images. Those tools help to diagnose bt issues. Change-Id: I426dbee5aa8911c9c64f4ec7399528d149dc651b Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh> Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch')
0 files changed, 0 insertions, 0 deletions
*/ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
package folder

import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"

	common "github.com/iotbzh/xds-common/golib"
	"github.com/iotbzh/xds-server/lib/xdsconfig"
	uuid "github.com/satori/go.uuid"
)

// IFOLDER interface implementation for native/path mapping folders

// PathMap .
type PathMap struct {
	globalConfig *xdsconfig.Config
	config       FolderConfig
}

// NewFolderPathMap Create a new instance of PathMap
func NewFolderPathMap(gc *xdsconfig.Config) *PathMap {
	f := PathMap{
		globalConfig: gc,
		config: FolderConfig{
			Status: StatusDisable,
		},
	}
	return &f
}

// NewUID Get a UUID
func (f *PathMap) NewUID(suffix string) string {
	uuid := uuid.NewV1().String()
	if len(suffix) > 0 {
		uuid += "_" + suffix
	}
	return uuid
}

// Add a new folder
func (f *PathMap) Add(cfg FolderConfig) (*FolderConfig, error) {
	if cfg.DataPathMap.ServerPath == "" {
		return nil, fmt.Errorf("ServerPath must be set")
	}

	// Use shareRootDir if ServerPath is a relative path
	dir := cfg.DataPathMap.ServerPath
	if !filepath.IsAbs(dir) {
		dir = filepath.Join(f.globalConfig.FileConf.ShareRootDir, dir)
	}

	// Sanity check
	if !common.Exists(dir) {
		// try to create if not existing
		if err := os.MkdirAll(dir, 0755); err != nil {
			return nil, fmt.Errorf("Cannot create ServerPath directory: %s", dir)
		}
	}
	if !common.Exists(dir) {
		return nil, fmt.Errorf("ServerPath directory is not accessible: %s", dir)
	}

	f.config = cfg
	f.config.RootPath = dir
	f.config.DataPathMap.ServerPath = dir
	f.config.IsInSync = true

	// Verify file created by XDS agent when needed
	if cfg.DataPathMap.CheckFile != "" {
		errMsg := "ServerPath sanity check error (%d): %v"
		ckFile := f.ConvPathCli2Svr(cfg.DataPathMap.CheckFile)
		if !common.Exists(ckFile) {
			return nil, fmt.Errorf(errMsg, 1, "file not present")
		}
		if cfg.DataPathMap.CheckContent != "" {
			fd, err := os.OpenFile(ckFile, os.O_APPEND|os.O_RDWR, 0600)
			if err != nil {
				return nil, fmt.Errorf(errMsg, 2, err)
			}
			defer fd.Close()

			// Check specific message written by agent
			content, err := ioutil.ReadAll(fd)
			if err != nil {
				return nil, fmt.Errorf(errMsg, 3, err)
			}
			if string(content) != cfg.DataPathMap.CheckContent {
				return nil, fmt.Errorf(errMsg, 4, "file content differ")
			}

			// Write a specific message that will be check back on agent side
			msg := "Pathmap checked message written by xds-server ID: " + f.globalConfig.ServerUID + "\n"
			if n, err := fd.WriteString(msg); n != len(msg) || err != nil {
				return nil, fmt.Errorf(errMsg, 5, err)
			}
		}
	}

	f.config.Status = StatusEnable

	return &f.config, nil
}

// GetConfig Get public part of folder config
func (f *PathMap) GetConfig() FolderConfig {
	return f.config
}

// GetFullPath returns the full path of a directory (from server POV)
func (f *PathMap) GetFullPath(dir string) string {
	if &dir == nil {
		return f.config.DataPathMap.ServerPath
	}
	return filepath.Join(f.config.DataPathMap.ServerPath, dir)
}

// ConvPathCli2Svr Convert path from Client to Server
func (f *PathMap) ConvPathCli2Svr(s string) string {
	if f.config.ClientPath != "" && f.config.DataPathMap.ServerPath != "" {
		return strings.Replace(s,
			f.config.ClientPath,
			f.config.DataPathMap.ServerPath,
			-1)
	}
	return s
}

// ConvPathSvr2Cli Convert path from Server to Client
func (f *PathMap) ConvPathSvr2Cli(s string) string {
	if f.config.ClientPath != "" && f.config.DataPathMap.ServerPath != "" {
		return strings.Replace(s,
			f.config.DataPathMap.ServerPath,
			f.config.ClientPath,
			-1)
	}
	return s
}

// Remove a folder
func (f *PathMap) Remove() error {
	// nothing to do
	return nil
}

// RegisterEventChange requests registration for folder change event
func (f *PathMap) RegisterEventChange(cb *EventCB, data *EventCBData) error {
	return nil
}

// UnRegisterEventChange remove registered callback
func (f *PathMap) UnRegisterEventChange() error {
	return nil
}

// Sync Force folder files synchronization
func (f *PathMap) Sync() error {
	return nil
}

// IsInSync Check if folder files are in-sync
func (f *PathMap) IsInSync() (bool, error) {
	return true, nil
}