You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2017/07/27 21:21:39 UTC

[mynewt-newtmgr] branch 1_1_0_dev updated: remove currantlabs/ble from windows

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch 1_1_0_dev
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git


The following commit(s) were added to refs/heads/1_1_0_dev by this push:
     new 9e50a2a  remove currantlabs/ble from windows
9e50a2a is described below

commit 9e50a2a8bd2b7918a218e25de0a0da8d7cc21ae3
Author: cwanda <wa...@happycity.com>
AuthorDate: Thu Jul 27 14:21:37 2017 -0700

    remove currantlabs/ble from windows
    
    remove currantlabs/ble from windows
---
 newtmgr/bll/bll_common.go                          |  2 +
 newtmgr/bll/bll_oic_sesn.go                        |  2 +
 newtmgr/bll/bll_plain_sesn.go                      |  2 +
 newtmgr/bll/bll_sesn_cfg.go                        |  2 +
 .../{bll_sesn_cfg.go => bll_sesn_cfg_windows.go}   |  5 +-
 newtmgr/bll/bll_util.go                            |  2 +
 newtmgr/bll/bll_xport.go                           |  2 +
 .../bll/{bll_xport.go => bll_xports_windows.go}    | 33 +++-----------
 newtmgr/config/bll_config.go                       |  2 +
 .../{bll_config.go => bll_config_windows.go}       | 53 ++--------------------
 10 files changed, 26 insertions(+), 79 deletions(-)

diff --git a/newtmgr/bll/bll_common.go b/newtmgr/bll/bll_common.go
index 5e3add2..93efd06 100644
--- a/newtmgr/bll/bll_common.go
+++ b/newtmgr/bll/bll_common.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_oic_sesn.go b/newtmgr/bll/bll_oic_sesn.go
index c4f32e4..6cd5736 100644
--- a/newtmgr/bll/bll_oic_sesn.go
+++ b/newtmgr/bll/bll_oic_sesn.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_plain_sesn.go b/newtmgr/bll/bll_plain_sesn.go
index d01ba51..cf6507e 100644
--- a/newtmgr/bll/bll_plain_sesn.go
+++ b/newtmgr/bll/bll_plain_sesn.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_sesn_cfg.go b/newtmgr/bll/bll_sesn_cfg.go
index a011439..4861fc9 100644
--- a/newtmgr/bll/bll_sesn_cfg.go
+++ b/newtmgr/bll/bll_sesn_cfg.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_sesn_cfg.go b/newtmgr/bll/bll_sesn_cfg_windows.go
similarity index 95%
copy from newtmgr/bll/bll_sesn_cfg.go
copy to newtmgr/bll/bll_sesn_cfg_windows.go
index a011439..83a4910 100644
--- a/newtmgr/bll/bll_sesn_cfg.go
+++ b/newtmgr/bll/bll_sesn_cfg_windows.go
@@ -1,3 +1,5 @@
+// +build windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,14 +24,11 @@ package bll
 import (
 	"time"
 
-	"github.com/currantlabs/ble"
-
 	"mynewt.apache.org/newtmgr/nmxact/sesn"
 )
 
 type BllSesnCfg struct {
 	MgmtProto    sesn.MgmtProto
-	AdvFilter    ble.AdvFilter
 	PreferredMtu int
 	ConnTimeout  time.Duration
 }
diff --git a/newtmgr/bll/bll_util.go b/newtmgr/bll/bll_util.go
index d15f0de..af514e1 100644
--- a/newtmgr/bll/bll_util.go
+++ b/newtmgr/bll/bll_util.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_xport.go b/newtmgr/bll/bll_xport.go
index aa3519f..cc821f6 100644
--- a/newtmgr/bll/bll_xport.go
+++ b/newtmgr/bll/bll_xport.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/bll/bll_xport.go b/newtmgr/bll/bll_xports_windows.go
similarity index 72%
copy from newtmgr/bll/bll_xport.go
copy to newtmgr/bll/bll_xports_windows.go
index aa3519f..093059a 100644
--- a/newtmgr/bll/bll_xport.go
+++ b/newtmgr/bll/bll_xports_windows.go
@@ -1,3 +1,5 @@
+// +build windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,9 +24,6 @@ package bll
 import (
 	"fmt"
 
-	"github.com/currantlabs/ble"
-	"github.com/currantlabs/ble/examples/lib/dev"
-
 	"mynewt.apache.org/newtmgr/nmxact/scan"
 	"mynewt.apache.org/newtmgr/nmxact/sesn"
 )
@@ -50,40 +49,20 @@ func NewBllXport(cfg XportCfg) *BllXport {
 }
 
 func (bx *BllXport) BuildSesn(cfg sesn.SesnCfg) (sesn.Sesn, error) {
-	return nil, fmt.Errorf("BllXport.BuildSesn() not supported; " +
-		"use BllXport.BuildBllSesn instead")
+	return nil, fmt.Errorf("Not Supported On Windows")
 }
 
 func (bx *BllXport) BuildBllSesn(cfg BllSesnCfg) (sesn.Sesn, error) {
-	switch cfg.MgmtProto {
-	case sesn.MGMT_PROTO_NMP:
-		return NewBllPlainSesn(cfg), nil
-	case sesn.MGMT_PROTO_OMP:
-		return NewBllOicSesn(cfg), nil
-	default:
-		return nil, fmt.Errorf(
-			"Invalid management protocol: %d; expected NMP or OMP",
-			cfg.MgmtProto)
-	}
+	return nil, fmt.Errorf("Not Supported On Windows")
 }
 
 func (bx *BllXport) Start() error {
-	d, err := dev.NewDevice(bx.cfg.CtlrName)
-	if err != nil {
-		return err
-	}
 
-	ble.SetDefaultDevice(d)
-
-	return nil
+	return fmt.Errorf("Not Supported On Windows")
 }
 
 func (bx *BllXport) Stop() error {
-	if err := ble.Stop(); err != nil {
-		return err
-	}
-
-	return nil
+	return fmt.Errorf("Not Supported On Windows")
 }
 
 func (bx *BllXport) BuildScanner() (scan.Scanner, error) {
diff --git a/newtmgr/config/bll_config.go b/newtmgr/config/bll_config.go
index 3289fec..c476a19 100644
--- a/newtmgr/config/bll_config.go
+++ b/newtmgr/config/bll_config.go
@@ -1,3 +1,5 @@
+// +build !windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/newtmgr/config/bll_config.go b/newtmgr/config/bll_config_windows.go
similarity index 56%
copy from newtmgr/config/bll_config.go
copy to newtmgr/config/bll_config_windows.go
index 3289fec..7595fdb 100644
--- a/newtmgr/config/bll_config.go
+++ b/newtmgr/config/bll_config_windows.go
@@ -1,3 +1,5 @@
+// +build windows
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,13 +23,9 @@ package config
 
 import (
 	"fmt"
-	"strings"
-
-	"github.com/currantlabs/ble"
 
 	"mynewt.apache.org/newt/util"
 	"mynewt.apache.org/newtmgr/newtmgr/bll"
-	"mynewt.apache.org/newtmgr/newtmgr/nmutil"
 )
 
 type BllConfig struct {
@@ -46,56 +44,13 @@ func einvalBllConnString(f string, args ...interface{}) error {
 }
 
 func ParseBllConnString(cs string) (*BllConfig, error) {
-	bc := NewBllConfig()
-
-	if strings.TrimSpace(cs) == "" {
-		return bc, nil
-	}
-
-	parts := strings.Split(cs, ",")
-	for _, p := range parts {
-		kv := strings.SplitN(p, "=", 2)
-		if len(kv) != 2 {
-			return nil, einvalBllConnString("expected comma-separated "+
-				"key=value pairs; no '=' in: %s", p)
-		}
 
-		k := kv[0]
-		v := kv[1]
-
-		switch k {
-		case "ctlr_name":
-			bc.CtlrName = v
-		case "peer_id":
-			bc.PeerId = v
-		case "peer_name":
-			bc.PeerName = v
-		default:
-			return nil, einvalBllConnString("Unrecognized key: %s", k)
-		}
-	}
-
-	return bc, nil
+	return nil, util.FmtNewtError("Not Supported on Windows")
 }
 
 func BuildBllSesnCfg(bc *BllConfig) (bll.BllSesnCfg, error) {
-	if nmutil.DeviceName != "" {
-		bc.PeerName = nmutil.DeviceName
-	}
 
 	sc := bll.NewBllSesnCfg()
 
-	if bc.PeerName != "" {
-		sc.AdvFilter = func(a ble.Advertisement) bool {
-			return a.LocalName() == bc.PeerName
-		}
-	} else if bc.PeerId != "" {
-		sc.AdvFilter = func(a ble.Advertisement) bool {
-			return a.Address().String() == bc.PeerId
-		}
-	} else {
-		return sc, util.NewNewtError("bll session lacks a peer specifier")
-	}
-
-	return sc, nil
+	return sc, util.FmtNewtError("Not Supported on Windows")
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" <co...@mynewt.apache.org>'].