Assign sequential pod IDs from the master with NVS-stable bindings.
Replaces MAC-byte self-IDs with master allocation (1–255), slave preferred-ID reconnect, debug reset via UART/UI, and rate-limited ASSIGN to avoid ESP-NOW NO_MEM storms. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -84,13 +84,7 @@ func NewBench(cfg Config) (*Bench, error) {
|
||||
return nil, fmt.Errorf("config %q slave %q: %w", cfg.ID, s.ID, err)
|
||||
}
|
||||
s.MAC = mac
|
||||
if s.ClientID == nil {
|
||||
parts := strings.Split(mac, ":")
|
||||
var last byte
|
||||
fmt.Sscanf(parts[5], "%02x", &last)
|
||||
id := uint(last)
|
||||
s.ClientID = &id
|
||||
}
|
||||
/* client_id is master-assigned (sequential); omit until known from `gotool clients`. */
|
||||
b.slaveByID[s.ID] = s
|
||||
}
|
||||
return b, nil
|
||||
@@ -112,6 +106,9 @@ func (b *Bench) ResolveClientID(slaveID string) (uint32, error) {
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if s.ClientID == nil {
|
||||
return 0, fmt.Errorf("slave %q: client_id required (master-assigned; set in config after join)", slaveID)
|
||||
}
|
||||
return uint32(*s.ClientID), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user