This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git
commit 8557eae5fc73a1f6408fc7ce96f4400d72656bee Author: Christopher Collins <ccoll...@apache.org> AuthorDate: Wed Jul 12 18:31:40 2017 -0700 nmxact - Use reserved secure OMP UUID. --- newtmgr/bll/bll_oic_sesn.go | 11 ++++------- nmxact/bledefs/bledefs.go | 12 ++++++++---- nmxact/nmble/ble_oic_sesn.go | 14 +++----------- nmxact/scan/scan.go | 4 ++-- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/newtmgr/bll/bll_oic_sesn.go b/newtmgr/bll/bll_oic_sesn.go index f94fdb0..19fd6c3 100644 --- a/newtmgr/bll/bll_oic_sesn.go +++ b/newtmgr/bll/bll_oic_sesn.go @@ -75,10 +75,9 @@ func (bos *BllOicSesn) discoverAll() error { return err } - iotivitySvcUuid, _ := bledefs.ParseUuid(bledefs.IotivitySvcUuid) - ompSvcUuid := bledefs.BleUuid{U16: bledefs.OmpSvcUuid} - reqChrUuid, _ := bledefs.ParseUuid(bledefs.OmpReqChrUuid) - rspChrUuid, _ := bledefs.ParseUuid(bledefs.OmpRspChrUuid) + ompUnsecSvcUuid, _ := bledefs.ParseUuid(bledefs.OmpUnsecSvcUuid) + reqChrUuid, _ := bledefs.ParseUuid(bledefs.OmpUnsecReqChrUuid) + rspChrUuid, _ := bledefs.ParseUuid(bledefs.OmpUnsecRspChrUuid) for _, s := range p.Services { uuid, err := UuidFromBllUuid(s.UUID) @@ -86,9 +85,7 @@ func (bos *BllOicSesn) discoverAll() error { return err } - if bledefs.CompareUuids(uuid, iotivitySvcUuid) == 0 || - bledefs.CompareUuids(uuid, ompSvcUuid) == 0 { - + if bledefs.CompareUuids(uuid, ompUnsecSvcUuid) == 0 { for _, c := range s.Characteristics { uuid, err := UuidFromBllUuid(c.UUID) if err != nil { diff --git a/nmxact/bledefs/bledefs.go b/nmxact/bledefs/bledefs.go index b61ca91..eeb310f 100644 --- a/nmxact/bledefs/bledefs.go +++ b/nmxact/bledefs/bledefs.go @@ -33,10 +33,14 @@ const BLE_ATT_MTU_DFLT = 23 const NmpPlainSvcUuid = "8D53DC1D-1DB7-4CD3-868B-8A527460AA84" const NmpPlainChrUuid = "DA2E7828-FBCE-4E01-AE9E-261174997C48" -const IotivitySvcUuid = "ADE3D529-C784-4F63-A987-EB69F70EE816" -const OmpSvcUuid = 0x9923 -const OmpReqChrUuid = "AD7B334F-4637-4B86-90B6-9D787F03D218" -const OmpRspChrUuid = "E9241982-4580-42C4-8831-95048216B256" + +const OmpUnsecSvcUuid = "ADE3D529-C784-4F63-A987-EB69F70EE816" +const OmpUnsecReqChrUuid = "AD7B334F-4637-4B86-90B6-9D787F03D218" +const OmpUnsecRspChrUuid = "E9241982-4580-42C4-8831-95048216B256" + +const OmpSecSvcUuid = 0xfe18 +const OmpSecReqChrUuid = 0x1000 +const OmpSecRspChrUuid = 0x1001 type BleAddrType int diff --git a/nmxact/nmble/ble_oic_sesn.go b/nmxact/nmble/ble_oic_sesn.go index d93ab63..9db1c84 100644 --- a/nmxact/nmble/ble_oic_sesn.go +++ b/nmxact/nmble/ble_oic_sesn.go @@ -32,21 +32,13 @@ func NewBleOicSesn(bx *BleXport, cfg sesn.SesnCfg) *BleOicSesn { onCloseCb: cfg.OnCloseCb, } - iotUuid, err := ParseUuid(IotivitySvcUuid) + iotUuid, _ := ParseUuid(OmpUnsecSvcUuid) svcUuids := []BleUuid{ - {U16: OmpSvcUuid}, iotUuid, } - reqChrUuid, err := ParseUuid(OmpReqChrUuid) - if err != nil { - panic(err.Error()) - } - - rspChrUuid, err := ParseUuid(OmpRspChrUuid) - if err != nil { - panic(err.Error()) - } + reqChrUuid, _ := ParseUuid(OmpUnsecReqChrUuid) + rspChrUuid, _ := ParseUuid(OmpUnsecRspChrUuid) bos.bf = NewBleFsm(BleFsmParams{ Bx: bx, diff --git a/nmxact/scan/scan.go b/nmxact/scan/scan.go index 162feb9..318e777 100644 --- a/nmxact/scan/scan.go +++ b/nmxact/scan/scan.go @@ -52,12 +52,12 @@ func BleOmpScanCfg(ScanCb ScanFn) Cfg { Ble: CfgBle{ ScanPred: func(adv bledefs.BleAdvReport) bool { for _, u := range adv.Fields.Uuids16 { - if u == bledefs.OmpSvcUuid { + if u == bledefs.OmpSecSvcUuid { return true } } - iotUuid, _ := bledefs.ParseUuid(bledefs.IotivitySvcUuid) + iotUuid, _ := bledefs.ParseUuid(bledefs.OmpUnsecSvcUuid) for _, u128 := range adv.Fields.Uuids128 { u := bledefs.BleUuid{U128: u128} if bledefs.CompareUuids(u, iotUuid) == 0 { -- To stop receiving notification emails like this one, please contact "commits@mynewt.apache.org" <commits@mynewt.apache.org>.