From b34fcf9651c9a9026862f8f8417b58bb88a60e2e Mon Sep 17 00:00:00 2001 From: "Rajaratnam, Roshan" Date: Tue, 18 Sep 2018 13:56:20 +0200 Subject: [PATCH] wip bug fix vendor model opcode --- .../android/meshprovisioner/models/VendorModel.java | 6 ++---- .../android/meshprovisioner/transport/AccessLayer.java | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/models/VendorModel.java b/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/models/VendorModel.java index 463421f50..cf2772c2f 100644 --- a/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/models/VendorModel.java +++ b/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/models/VendorModel.java @@ -54,8 +54,7 @@ public VendorModel(final int modelIdentifier) { super(modelIdentifier); final ByteBuffer buffer = ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN); buffer.putInt(modelIdentifier); - buffer.position(2); - this.companyIdentifier = buffer.getShort(); + this.companyIdentifier = buffer.getShort(0); this.companyName = CompanyIdentifiers.getCompanyName(companyIdentifier); Log.v(TAG, "Company name: " + companyName); } @@ -64,8 +63,7 @@ private VendorModel(final Parcel source) { super(source); final ByteBuffer buffer = ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN); buffer.putInt(mModelId); - buffer.position(2); - this.companyIdentifier = buffer.getShort(); + this.companyIdentifier = buffer.getShort(0); this.companyName = CompanyIdentifiers.getCompanyName(companyIdentifier); } diff --git a/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/transport/AccessLayer.java b/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/transport/AccessLayer.java index 3ab5ea15a..bb77c6af5 100644 --- a/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/transport/AccessLayer.java +++ b/android-nrf-mesh-library/meshprovisioner/src/main/java/no/nordicsemi/android/meshprovisioner/transport/AccessLayer.java @@ -103,7 +103,9 @@ public final void createCustomAccessMessage(final AccessMessage accessMessage) { accessMessageBuffer = ByteBuffer.allocate(opCodesCompanyIdentifier.length); accessMessageBuffer.put(opCodesCompanyIdentifier); } - accessMessage.setAccessPdu(accessMessageBuffer.array()); + final byte [] accessPdu = accessMessageBuffer.array(); + Log.v(TAG, "Created Access PDU " + MeshParserUtils.bytesToHex(accessPdu, false)); + accessMessage.setAccessPdu(accessPdu); } /**