public static int getOpCode(final byte[] accessPayload, final int opCodeCount) {
        switch (opCodeCount) {
            case 1:
                return unsignedByteToInt(accessPayload[0]);
            case 2:
                return unsignedBytesToInt(accessPayload[1], accessPayload[0]);
            default:
                // Returns the 6 bit opcode from a 3-octet opcode of a vendor model message
                return unsignedByteToInt(accessPayload[0]) & 0x3F;
        }
    }
Returns the opcode within the access payload

@param accessPayload payload
@return array of opcodes
mesh/src/main/java/no/nordicsemi/android/mesh/utils/MeshParserUtils.java