Compare commits

...

3 commits

View file

@ -46,7 +46,6 @@ size_t MyOvmsServerV3Reader = 0;
bool OvmsServerV3ReaderCallback(OvmsNotifyType* type, OvmsNotifyEntry* entry) bool OvmsServerV3ReaderCallback(OvmsNotifyType* type, OvmsNotifyEntry* entry)
{ {
ESP_LOGD(TAG, "OvmsServerV3ReaderCallback");
if (MyOvmsServerV3) if (MyOvmsServerV3)
return MyOvmsServerV3->IncomingNotification(type, entry); return MyOvmsServerV3->IncomingNotification(type, entry);
else else
@ -55,7 +54,6 @@ bool OvmsServerV3ReaderCallback(OvmsNotifyType* type, OvmsNotifyEntry* entry)
bool OvmsServerV3ReaderFilterCallback(OvmsNotifyType* type, const char* subtype) bool OvmsServerV3ReaderFilterCallback(OvmsNotifyType* type, const char* subtype)
{ {
ESP_LOGD(TAG, "OvmsServerV3ReaderFilterCallback");
if (MyOvmsServerV3) if (MyOvmsServerV3)
return MyOvmsServerV3->NotificationFilter(type, subtype); return MyOvmsServerV3->NotificationFilter(type, subtype);
else else
@ -64,7 +62,6 @@ bool OvmsServerV3ReaderFilterCallback(OvmsNotifyType* type, const char* subtype)
static void OvmsServerV3MongooseCallback(struct mg_connection *nc, int ev, void *p) static void OvmsServerV3MongooseCallback(struct mg_connection *nc, int ev, void *p)
{ {
ESP_LOGD(TAG, "OvmsServerV3MongooseCallback");
struct mg_mqtt_message *msg = (struct mg_mqtt_message *) p; struct mg_mqtt_message *msg = (struct mg_mqtt_message *) p;
switch (ev) switch (ev)
{ {
@ -263,7 +260,6 @@ OvmsServerV3::~OvmsServerV3()
void OvmsServerV3::TransmitAllMetrics() void OvmsServerV3::TransmitAllMetrics()
{ {
ESP_LOGD(TAG, "TransmitAllMetrics");
OvmsMutexLock mg(&m_mgconn_mutex); OvmsMutexLock mg(&m_mgconn_mutex);
if (!m_mgconn) if (!m_mgconn)
return; return;
@ -282,7 +278,6 @@ void OvmsServerV3::TransmitAllMetrics()
void OvmsServerV3::TransmitModifiedMetrics() void OvmsServerV3::TransmitModifiedMetrics()
{ {
ESP_LOGD(TAG, "TransmitModifiedMetrics");
OvmsMutexLock mg(&m_mgconn_mutex); OvmsMutexLock mg(&m_mgconn_mutex);
if (!m_mgconn) if (!m_mgconn)
return; return;
@ -321,7 +316,6 @@ void OvmsServerV3::TransmitMetric(OvmsMetric* metric)
int OvmsServerV3::TransmitNotificationInfo(OvmsNotifyEntry* entry) int OvmsServerV3::TransmitNotificationInfo(OvmsNotifyEntry* entry)
{ {
ESP_LOGD(TAG, "TransmitNotificationInfo");
std::string topic(m_topic_prefix); std::string topic(m_topic_prefix);
topic.append("notify/info/"); topic.append("notify/info/");
topic.append(entry->m_subtype); topic.append(entry->m_subtype);
@ -337,7 +331,6 @@ int OvmsServerV3::TransmitNotificationInfo(OvmsNotifyEntry* entry)
int OvmsServerV3::TransmitNotificationError(OvmsNotifyEntry* entry) int OvmsServerV3::TransmitNotificationError(OvmsNotifyEntry* entry)
{ {
ESP_LOGD(TAG, "TransmitNotificationError");
std::string topic(m_topic_prefix); std::string topic(m_topic_prefix);
topic.append("notify/error/"); topic.append("notify/error/");
topic.append(entry->m_subtype); topic.append(entry->m_subtype);
@ -353,7 +346,6 @@ int OvmsServerV3::TransmitNotificationError(OvmsNotifyEntry* entry)
int OvmsServerV3::TransmitNotificationAlert(OvmsNotifyEntry* entry) int OvmsServerV3::TransmitNotificationAlert(OvmsNotifyEntry* entry)
{ {
ESP_LOGD(TAG, "TransmitNotificationAlert");
std::string topic(m_topic_prefix); std::string topic(m_topic_prefix);
topic.append("notify/alert/"); topic.append("notify/alert/");
topic.append(entry->m_subtype); topic.append(entry->m_subtype);
@ -369,7 +361,6 @@ int OvmsServerV3::TransmitNotificationAlert(OvmsNotifyEntry* entry)
int OvmsServerV3::TransmitNotificationData(OvmsNotifyEntry* entry) int OvmsServerV3::TransmitNotificationData(OvmsNotifyEntry* entry)
{ {
ESP_LOGD(TAG, "TransmitNotificationData");
char base[32]; char base[32];
std::string topic(m_topic_prefix); std::string topic(m_topic_prefix);
topic.append("notify/data/"); topic.append("notify/data/");
@ -397,7 +388,6 @@ int OvmsServerV3::TransmitNotificationData(OvmsNotifyEntry* entry)
void OvmsServerV3::TransmitPendingNotificationsInfo() void OvmsServerV3::TransmitPendingNotificationsInfo()
{ {
ESP_LOGD(TAG, "TransmitPendingNotificationsInfo");
// Find the type object // Find the type object
OvmsNotifyType* info = MyNotify.GetType("info"); OvmsNotifyType* info = MyNotify.GetType("info");
if (info == NULL) if (info == NULL)
@ -420,7 +410,6 @@ void OvmsServerV3::TransmitPendingNotificationsInfo()
void OvmsServerV3::TransmitPendingNotificationsError() void OvmsServerV3::TransmitPendingNotificationsError()
{ {
ESP_LOGD(TAG, "TransmitPendingNotificationsError");
// Find the type object // Find the type object
OvmsNotifyType* error = MyNotify.GetType("error"); OvmsNotifyType* error = MyNotify.GetType("error");
if (error == NULL) if (error == NULL)
@ -443,7 +432,6 @@ void OvmsServerV3::TransmitPendingNotificationsError()
void OvmsServerV3::TransmitPendingNotificationsAlert() void OvmsServerV3::TransmitPendingNotificationsAlert()
{ {
ESP_LOGD(TAG, "TransmitPendingNotificationsAlert");
// Find the type object // Find the type object
OvmsNotifyType* alert = MyNotify.GetType("alert"); OvmsNotifyType* alert = MyNotify.GetType("alert");
if (alert == NULL) if (alert == NULL)
@ -466,7 +454,6 @@ void OvmsServerV3::TransmitPendingNotificationsAlert()
void OvmsServerV3::TransmitPendingNotificationsData() void OvmsServerV3::TransmitPendingNotificationsData()
{ {
ESP_LOGD(TAG, "TransmitPendingNotificationsData");
if (m_notify_data_waitcomp != 0) return; if (m_notify_data_waitcomp != 0) return;
// Find the type object // Find the type object
@ -539,7 +526,6 @@ void OvmsServerV3::IncomingPubRec(int id)
void OvmsServerV3::IncomingEvent(std::string event, void* data) void OvmsServerV3::IncomingEvent(std::string event, void* data)
{ {
ESP_LOGD(TAG, "IncomingEvent");
// Publish the event, if we are connected... // Publish the event, if we are connected...
if (m_mgconn == NULL) return; if (m_mgconn == NULL) return;
if (!StandardMetrics.ms_s_v3_connected->AsBool()) return; if (!StandardMetrics.ms_s_v3_connected->AsBool()) return;
@ -761,10 +747,10 @@ void OvmsServerV3::SetStatus(const char* status, bool fault /*=false*/, State ne
void OvmsServerV3::MetricModified(OvmsMetric* metric) void OvmsServerV3::MetricModified(OvmsMetric* metric)
{ {
ESP_LOGD(TAG, "MetricModified");
if (!StandardMetrics.ms_s_v3_connected->AsBool()) return; if (!StandardMetrics.ms_s_v3_connected->AsBool()) return;
if (m_streaming) int now = StandardMetrics.ms_m_monotonic->AsInt();
if (m_streaming && now > m_lasttx_stream+m_streaming) //Test counter without caron message
{ {
OvmsMutexLock mg(&m_mgconn_mutex); OvmsMutexLock mg(&m_mgconn_mutex);
if (!m_mgconn) if (!m_mgconn)
@ -776,7 +762,6 @@ void OvmsServerV3::MetricModified(OvmsMetric* metric)
bool OvmsServerV3::NotificationFilter(OvmsNotifyType* type, const char* subtype) bool OvmsServerV3::NotificationFilter(OvmsNotifyType* type, const char* subtype)
{ {
ESP_LOGD(TAG, "NotificationFilter");
if (strcmp(type->m_name, "info") == 0 || if (strcmp(type->m_name, "info") == 0 ||
strcmp(type->m_name, "error") == 0 || strcmp(type->m_name, "error") == 0 ||
strcmp(type->m_name, "alert") == 0 || strcmp(type->m_name, "alert") == 0 ||