LN0739_FM_FR7: support for setting and clearing alarm via RMR
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
Change-Id: I11c5b7bf599c49f4ceaaf86cd6fbbf4ce0d885df
diff --git a/alarm/alarm.go b/alarm/alarm.go
index d097c73..5dfe896 100755
--- a/alarm/alarm.go
+++ b/alarm/alarm.go
@@ -55,10 +55,9 @@
r.managerUrl = os.Getenv("ALARM_MANAGER_URL")
}
- if os.Getenv("ALARM_IF_RMR") != "" {
+ if os.Getenv("ALARM_IF_RMR") == "" {
go InitRMR(r)
}
-
return r, nil
}
@@ -136,6 +135,7 @@
}
func (r *RICAlarm) sendAlarmUpdateReq(a AlarmMessage) error {
+
payload, err := json.Marshal(a)
if err != nil {
log.Println("json.Marshal failed with error: ", err)
@@ -162,6 +162,7 @@
log.Println("rmrSend failed with error: ", state)
return errors.New(fmt.Sprintf("rmrSend failed with error: %d", state))
}
+
return nil
}
@@ -204,3 +205,7 @@
return errors.New("rmrInit failed!")
}
+
+func (r *RICAlarm) IsRMRReady() bool {
+ return r.rmrReady
+}