Skip to content

Commit

Permalink
handle more codes as potential indirect timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Jan 30, 2024
1 parent 5a7d0a7 commit fd78fac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/AfController.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const Q = require('@halleyassist/q-lite')
const debug = require('debug')("zstack-af:controller")

/**
NO_ROUTE_AVAIL 0
"INDIRECT_TRANS_EXPIRY": 6,
"VALIDATE_ROUTE": 10,
"SOURCE_ROUTE_FAILURE": 11,
NWKSTAT_MANY_TO_ONE_ROUTE_FAILURE 0x0c
*/
const DefaultCodesOfInterest = [6, 0x10, 0x11, 0xb2]
const DefaultCodesOfInterest = [0, 6, 0x10, 0x11, 0x0c, 0xb2]

class AfController extends EventEmitter {
constructor(){
Expand Down Expand Up @@ -112,7 +114,10 @@ class AfController extends EventEmitter {
if(result != 6 && i != retries) {
const waitTime = 3500 - (Date.now() - attemptStart)
if(waitTime > 0) await Q.cancelledRace([Q.delay(waitTime), workPromise])
canSrcRtg = false

// After a MTO failure we can still srcrtg, the coordinator will send a RReq
// NO_ROUTE_AVAIL occurs when the device has no free space for new routes
if(result != 0x0c) canSrcRtg = false
}
// if is 6 (INDIRECT_TRANS_EXPIRY) we continue
}
Expand Down

0 comments on commit fd78fac

Please sign in to comment.