Skip to content

Commit

Permalink
Merge pull request #62 from NordicSemiconductor/bugfix/vendor-model-o…
Browse files Browse the repository at this point in the history
…pcode-parsing

bug fix vendor model opcode
  • Loading branch information
roshanrajaratnam authored Sep 18, 2018
2 parents f4c94aa + b34fcf9 commit cad2dff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit cad2dff

Please sign in to comment.