NordicID / nur_sdk

NUR SDK docs and libraries for various platforms
12 stars 19 forks source link

Bug in public NurCmdLock(boolean secured, int passwd, int sBank, int sAddress, int sMaskBitLength, byte[] sMask, int memoryMask, int action, boolean raw) constructor #16

Open KuznetsovS opened 4 years ago

KuznetsovS commented 4 years ago

Begin code of the constructor is: public NurCmdLock(boolean secured, int passwd, int sBank, int sAddress, int sMaskBitLength, byte[] sMask, int memoryMask, int action, boolean raw) throws NurApiException { super(54, 0, 18 + sMaskBitLength); if (action <= 3 && sMaskBitLength <= 255) { this.mNoAccessPwd = !secured; if (raw) { this.mMemoryMask = memoryMask; this.mAction = action; } else { ... in case of raw = true, action value should not be checked (action <= 3). Otherwise it causes wrong "Invalid parameter" exception.