Hi,
I'm getting back "01 10 06" when attempting to send 0x01 Start DFU to the DFU Control Point from my gateway which is a Pi3 running Noble. Notifications are enabled. With the NRF ToolBox I do not seem to get this error. If I send 0x05 or 0x06 from the gateway, the peripheral reboots perfectly fine.
Code:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static _reconnect(peripheral) {
peripheral.once('disconnect', (error)=>{
console.log("Final d/c")
})
peripheral.connect((error)=>{
console.log("Connected, about to send 0x01 to control point")
peripheral.discoverServices([DFU_UPDATE_SERVICE], (error_, services) => {
let dfuService = services[0]
dfuService.discoverCharacteristics([DFU_CONTROL_POINT, DFU_PACKET_CHAR], (error__, characteristics) => {
let controlPointChar = characteristics[1]
let dfuPacketChar = characteristics[0]
// Must enable notifications (subscribe in Noble) to write to control point
this._initResponseListener(controlPointChar)
controlPointChar.subscribe((er)=>{
let dat = Buffer.from(new Uint8Array([START_DFU]))
// Notification param must be false
controlPointChar.write(dat, false, (error___) => {
console.log("Wrote 0x01 to Ctrl Pt..", error___)
})
//this._sendImageSize(controlPointChar, dfuPacketChar)
Logs:
Connected, about to send 0x01 to control point
Wrote 0x01 to Ctrl Pt.. null
Control pt res: <Buffer 10 01 06>
isNotif: true