mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 19:07:47 +00:00
ucentral-event: fix polled telemetry stream
Fixes: WIFI-12341 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -43,7 +43,14 @@ function event(object, verb, payload) {
|
||||
let type = object;
|
||||
if (verb)
|
||||
type += '.' + verb;
|
||||
if (match(object, type, config.bulk?.filter))
|
||||
|
||||
if (match(object, type, config.realtime?.filter))
|
||||
ubus.call('ucentral', 'event', {
|
||||
type,
|
||||
payload
|
||||
});
|
||||
|
||||
else if (!config.bulk?.interval || match(object, type, config.bulk?.filter))
|
||||
ubus.call('ucentral', 'telemetry', {
|
||||
event: 'event',
|
||||
payload: {
|
||||
@@ -51,11 +58,6 @@ function event(object, verb, payload) {
|
||||
payload
|
||||
}
|
||||
});
|
||||
else if (match(object, type, config.realtime?.filter))
|
||||
ubus.call('ucentral', 'event', {
|
||||
type,
|
||||
payload
|
||||
});
|
||||
}
|
||||
|
||||
let handlers = {
|
||||
@@ -114,7 +116,7 @@ let handlers = {
|
||||
|
||||
|
||||
function hapd_subscriber_notify_cb(notify) {
|
||||
if (config.wifi?.filter == '*' || index(config.wifi?.filter || [], notify.type) > 0) {
|
||||
if (config.wifi?.filter == '*' || index(config.wifi?.filter || [], notify.type) >= 0) {
|
||||
let payload = {};
|
||||
payload[notify.type] = notify.data;
|
||||
ubus.call('ucentral', 'telemetry', {
|
||||
@@ -181,7 +183,7 @@ function hapd_subscriber_remove_cb(remove) {
|
||||
}
|
||||
|
||||
function dhcp_subscriber_notify_cb(notify) {
|
||||
if (config.dhcp?.filter == '*' || index(config.dhcp?.filter || [], notify.type) > 0) {
|
||||
if (config.dhcp?.filter == '*' || index(config.dhcp?.filter || [], notify.type) >= 0) {
|
||||
notify.data.type = notify.type;
|
||||
ubus.call('ucentral', 'telemetry', {
|
||||
event: 'dhcp-snooping',
|
||||
|
||||
Reference in New Issue
Block a user